SessionsCreate checkout session

Create checkout session

Creates a payment session for the authenticated application.

curl -X POST "https://api.example.com/api/v1/sessions" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: example_string" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -d '{
  "orderReference": "ORD-2024-001",
  "paymentMethod": "card",
  "currency": "AUD",
  "locale": "en_AU",
  "amount": {
    "total": 140.76,
    "shipping": 9.95,
    "tax": 11.81
  },
  "orderItems": [
    {
      "name": "Wireless Headphones",
      "sku": "WH-100",
      "quantity": 1,
      "unitPrice": 119
    }
  ],
  "customer": {
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane.smith@example.com",
    "phone": "+61412345678",
    "billingAddress": {
      "line1": "123 Collins Street",
      "line2": "Level 5",
      "city": "Melbourne",
      "state": "VIC",
      "postalCode": "3000",
      "country": "AU"
    },
    "shippingAddress": {
      "line1": "123 Collins Street",
      "line2": "Level 5",
      "city": "Melbourne",
      "state": "VIC",
      "postalCode": "3000",
      "country": "AU"
    }
  },
  "shipping": {
    "type": "express",
    "method": "aus_post"
  },
  "additionalInformation": {
    "campaignId": "summer-sale-2024",
    "referralCode": "REF-ABC"
  },
  "redirectUrls": {
    "success": "https://merchant.example.com/checkout/success",
    "failure": "https://merchant.example.com/checkout/failure"
  }
}'
{
  "sessionId": "e4b8c1a2-b088-4e79-99ad-2c3e0fa3f1b9",
  "checkoutUrl": "https://checkout.stripe.com/pay/cs_test_123",
  "status": "PENDING",
  "routing": {
    "selectedProvider": "stripe",
    "score": 92.5
  },
  "expiresAt": "2024-01-15T12:00:00Z",
  "createdAt": "2024-01-15T11:00:00Z"
}
POST
/api/v1/sessions
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

Bearer token (JWT) - just enter the token, "Bearer" prefix will be added automatically

Content-Typestring
Required

The media type of the request body

Options: application/json
header
Idempotency-Keystring
Required

Client-generated unique key used to safely retry session creation. Can be any opaque string up to 255 characters.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). Authentication token required.

Headers

Idempotency-Keystring
Required

Client-generated unique key used to safely retry session creation. Can be any opaque string up to 255 characters.

Body

application/json
orderReferencestring
Required
Example:
ORD-2024-001
paymentMethodstring
Required
Allowed values:card
currencystring
Required

ISO 4217 alphabetic currency code.

Example:
AUD
localestring

Locale code, for example en_AU.

Example:
en_AU
amountobject
Required
customerobject
Required
shippingobject

Responses