> ## Documentation Index
> Fetch the complete documentation index at: https://developer.hellgate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Initial Unscheduled Payment

> Set up unscheduled payments with an initial on-session payment.

Unscheduled payments are a special case of payments. They are used to process payments that are not scheduled in advance, but rather initiated by the merchant at a later point in time. This is useful for scenarios where the payment amount is not known at the time of the initial payment, or where the payment is triggered by an event that occurs after the initial payment.

Like with recurring payments, it is also the way to get payment credentials from the customers, as they are on-session for the first payment. Subsequent unscheduled payments will be processed in the background without a customer on-session.

## Request

Find the API documentation for the request [here](/products/commerce/v2/api-reference/payments_ci/initial-unscheduled).

```text theme={null}
POST /payments/unscheduled
```

The payload for the request is very straightforward and in the simplest case looks like this:

```json theme={null}
{
  "amount": 1000,
  "currency_code": "EUR",
  "reference": "Order #12345",
  "source": { "type": "checkout" }
}
```

### Remarks

* Commerce encodes amounts in minor units of the respective currency. The example above would be 10.00 EUR.
* The `source.type` denotes that the payment will be initiated fully on the front-end, and the card details need to be entered there.

## Response

Commerce responds with a HTTP 200 OK and a JSON payload. The payload contains the session ID to handle the action requirement:

```json theme={null}
{
  "id": "54ba1fdb-7e4e-402b-aebb-66f9d5345cf8",
  "amount": { "requested": 1000 },
  "action_requirement": {
    "type": "use_sdk",
    "session_id": "d5b8e449-13da-4594-bf00-643146fb35d1"
  },
  "credential_id": "54ba1fdb-7e4e-402b-aebb-66f9d5345cf8",
  "created_at": "2023-10-10T00:00:00Z",
  "currency_code": "EUR",
  "reference": "Order #12345",
  "status": "processing",
  "use_case": "UNSCHEDULED"
}
```

<Info>
  This use-case automatically creates payment credentials on file for the customer. The `credential_id` allows you to refer to the credentials in later actions.
</Info>
