Create a checkout session
Create a checkout session by supplying the correct parameters. When a customer pays on the checkout session an order will be created.
Merchant JWT bearer token
In: header
Scope: checkouts.create
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/checkouts" \ -H "Content-Type: application/json" \ -d '{ "lineItemParams": [ { "item": "string", "quantity": 0 } ] }'{
"id": "string",
"status": "PENDING",
"lineItems": [
{
"item": {
"metaData": {
"property1": "string",
"property2": "string"
},
"referenceId": "string",
"description": "string",
"imageUrls": [
"https://www.randomurl.com"
],
"attributes": {
"size": "xs",
"color": "blue"
},
"sku": "string",
"amountMoney": {
"amount": 100,
"currency": "AED"
},
"name": "string",
"id": "string"
},
"quantity": 0,
"subtotalMoney": {
"amount": 100,
"currency": "AED"
},
"totalMoney": {
"amount": 100,
"currency": "AED"
}
}
],
"subtotalMoney": {
"amount": 100,
"currency": "AED"
},
"totalMoney": {
"amount": 100,
"currency": "AED"
},
"expirationDate": "2019-08-24T14:15:22Z",
"url": "https://www.randomurl.com",
"customerId": "string",
"paymentId": "string",
"groupPaymentId": "string",
"isDynamicPricingEnabled": false,
"checkoutPageOptions": {
"successUrl": "https://www.randomurl.com",
"approvedUrl": "https://www.randomurl.com",
"cancelUrl": "https://www.randomurl.com",
"expireUrl": "https://www.randomurl.com",
"style": {
"secondaryColor": "string",
"primaryColor": "string"
}
},
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"referenceId": "string",
"metaData": {
"property1": "string",
"property2": "string"
},
"source": "string"
}{
"http_status_code": 100,
"moreInfo": "https://www.randomurl.com",
"name": "string",
"detail": "string",
"instance": "/pets/dogs/123",
"property1": null,
"property2": null
}