Create a session
POST/checkout/sessions
This endpoint creates a Session. Sessions can only be paid successfully once
Request
- application/json
Body
required
Array [
]
Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
UUID v4
Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
UUID v4
Possible values: <= 36 characters, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
UUID v4
ISO 4217 representation of the currency
Possible values: <= 255 characters
A reference set by the merchant. This can be the merchant's order ID or anything useful to associate this session
A URL the customer will be redirected in case of a successful payment
A URL the customer will be redirected when cancelling the checkout session
Unix timestamp (seconds since epoch)
A description set by the merchant regarding this session
items
object[]
required
Possible values: >= 1
Description of the item
Possible values: <= 9999999999
Amount expressed in cents. 1 USD should be submitted as 100 cents
Possible values: <= 9999999999
Amount expressed in cents. 1 USD should be submitted as 100 cents
Possible values: >= 1
Quantity of the item
metadata
object
A metadata object containing key-value pairs. Keys must be strings, and values are strings. The object can also be empty.
Responses
- 201
- 401
- 403
- 409
- 422
- 500
Session created successfully
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [success]
data
object
Create Session Response
Url to redirect the customer to complete the payment
Possible values: [201]
Possible values: [Successful request]
{
"status": "success",
"data": {
"checkout_url": "string"
},
"code": 201,
"message": "Successful request"
}
Access token is missing or invalid
Access denied
Request failed due to a conflict in the provided entity
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [fail]
Possible values: [409]
Failure reason
{
"status": "fail",
"code": 409,
"message": "Entity with Id already exists"
}
Request failed due to validation failure
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [error]
Possible values: [422]
{
"status": "error",
"data": {
"dob": {
"day": "Value expected to be 'integer', 'string' given."
}
},
"code": 422,
"message": "cannot process the provided entity"
}
Server error