Skip to main content
POST
/
v1
/
ui
/
checkout-sessions
Create a checkout session for a customer
curl --request POST \
  --url https://api.example.com/v1/ui/checkout-sessions \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerRef": "<string>",
  "productRef": "<string>",
  "planRef": "<string>",
  "returnUrl": "<string>",
  "purpose": "credit_topup"
}
'
{
  "id": "507f1f77bcf86cd799439011",
  "sessionId": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "amount": 2999,
  "currency": "USD",
  "status": "active",
  "checkoutUrl": "https://solvapay.com/customer/checkout?id=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}

Body

application/json
customerRef
string
required
Minimum string length: 1
productRef
string
Minimum string length: 1
planRef
string
returnUrl
string
purpose
enum<string>
Available options:
credit_topup

Response

Checkout session created successfully

id
string
required

Checkout session ID

Example:

"507f1f77bcf86cd799439011"

sessionId
string
required

Public session ID used in checkout URL

Example:

"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"

amount
number
required

Amount in cents

Example:

2999

currency
string
required

Currency code

Example:

"USD"

status
string
required

Session status

Example:

"active"

checkoutUrl
string
required

Checkout URL to open the checkout page

Example:

"https://solvapay.com/customer/checkout?id=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"