Storefront API
Checkout
Checkout attempts, payment methods and what happened in each attempt.
- POSTStart checkout from a cart (holds stock for 15 minutes)
- GETA checkout
- PATCHContact details, shipping address and marketing consent
- POSTStart a payment for the placed order
- GETPayment status (poll while pending)
- POSTHand over the provider callback; it is verified and checked with the provider
- POSTTest mode only: choose what happens to the payment
- POSTPlace the order (cash on delivery, or unpaid until an online payment succeeds)
Start checkout from a cart (holds stock for 15 minutes)
POST/storefront/2026-11/checkouts
storefront tokenIdempotency-Key required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
Request body
cart_idID (crt_...)required
Response 201
idID (chk_...)requiredstatusenumrequiredOne of
openblockedcompletedexpiredcart_idID (crt_...)requiredbuyerobjectrequiredbuyer.namestringrequiredbuyer.emailstring or nullrequiredbuyer.phonestring or nullrequiredshipping_addressobject or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredlinesarray of objectrequiredlines[].variant_idID (var_...)requiredlines[].titlestringrequiredlines[].variant_titlestringrequiredlines[].quantityintegerrequiredlines[].unit_priceintegerrequiredlines[].totalintegerrequiredsubtotalintegerrequireddiscountobject or nullrequireddiscount.codestringrequireddiscount.amountintegerrequiredshippingintegerrequiredtax_totalintegerrequiredtotalintegerrequiredrequires_shippingbooleanrequiredpayment_optionsarray of enumrequiredOne of
codonlineonline_methodsarray of enumrequiredOne of
upicardnetbankingwalletemipaylatertest_modebooleanrequiredPayments are simulated: no money moves.
orderobject or nullrequiredorder.idID (ord_...)requiredorder.namestringrequiredorder.payment_statusstringrequiredexpires_attimestamprequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | checkout_closed | This checkout is already completed or expired. Start again from the cart. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 409 | out_of_stock | An item does not have enough stock for this quantity. Lower the quantity or remove it. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/storefront/2026-11/checkouts \
-H "Storefront-Token: <storefront token>" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts', {
method: 'POST',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R"
}),
});
const data = await res.json();{
"id": "chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"status": "open",
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"buyer": {
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
},
"shipping_address": {},
"accepts_email": false,
"accepts_whatsapp": false,
"lines": [
{
"variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"title": "Festive saree",
"variant_title": "Festive saree",
"quantity": 1,
"unit_price": 49900,
"total": 49900
}
],
"subtotal": 49900,
"discount": {
"code": "string",
"amount": 49900
},
"shipping": 1,
"tax_total": 49900,
"total": 49900,
"requires_shipping": false,
"payment_options": [
"cod"
],
"online_methods": [
"upi"
],
"test_mode": false,
"order": {
"id": "ord_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"payment_status": "string"
},
"expires_at": "2026-11-04T10:00:00.000Z"
}A checkout
GET/storefront/2026-11/checkouts/{id}
storefront token
Path parameters
idID (chk_...)required
Response 200
idID (chk_...)requiredstatusenumrequiredOne of
openblockedcompletedexpiredcart_idID (crt_...)requiredbuyerobjectrequiredbuyer.namestringrequiredbuyer.emailstring or nullrequiredbuyer.phonestring or nullrequiredshipping_addressobject or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredlinesarray of objectrequiredlines[].variant_idID (var_...)requiredlines[].titlestringrequiredlines[].variant_titlestringrequiredlines[].quantityintegerrequiredlines[].unit_priceintegerrequiredlines[].totalintegerrequiredsubtotalintegerrequireddiscountobject or nullrequireddiscount.codestringrequireddiscount.amountintegerrequiredshippingintegerrequiredtax_totalintegerrequiredtotalintegerrequiredrequires_shippingbooleanrequiredpayment_optionsarray of enumrequiredOne of
codonlineonline_methodsarray of enumrequiredOne of
upicardnetbankingwalletemipaylatertest_modebooleanrequiredPayments are simulated: no money moves.
orderobject or nullrequiredorder.idID (ord_...)requiredorder.namestringrequiredorder.payment_statusstringrequiredexpires_attimestamprequired
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
-H "Storefront-Token: <storefront token>"const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R', {
method: 'GET',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
},
});
const data = await res.json();{
"id": "chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"status": "open",
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"buyer": {
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
},
"shipping_address": {},
"accepts_email": false,
"accepts_whatsapp": false,
"lines": [
{
"variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"title": "Festive saree",
"variant_title": "Festive saree",
"quantity": 1,
"unit_price": 49900,
"total": 49900
}
],
"subtotal": 49900,
"discount": {
"code": "string",
"amount": 49900
},
"shipping": 1,
"tax_total": 49900,
"total": 49900,
"requires_shipping": false,
"payment_options": [
"cod"
],
"online_methods": [
"upi"
],
"test_mode": false,
"order": {
"id": "ord_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"payment_status": "string"
},
"expires_at": "2026-11-04T10:00:00.000Z"
}Contact details, shipping address and marketing consent
PATCH/storefront/2026-11/checkouts/{id}
storefront token
Path parameters
idID (chk_...)required
Request body
namestringUp to 120 characters
emailstring or nullphonestring or nullshipping_addressobjectshipping_address.namestringrequiredAt least 1 characters · Up to 120 characters
shipping_address.line1stringrequiredAt least 1 characters · Up to 200 characters
shipping_address.line2stringUp to 200 characters
shipping_address.citystringrequiredAt least 1 characters · Up to 100 characters
shipping_address.statestringrequiredshipping_address.pincodestringrequiredshipping_address.country"IN"Default "IN"
shipping_address.phonestring or nullaccepts_emailbooleanaccepts_whatsappbooleandiscount_codestring or null
Response 200
idID (chk_...)requiredstatusenumrequiredOne of
openblockedcompletedexpiredcart_idID (crt_...)requiredbuyerobjectrequiredbuyer.namestringrequiredbuyer.emailstring or nullrequiredbuyer.phonestring or nullrequiredshipping_addressobject or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredlinesarray of objectrequiredlines[].variant_idID (var_...)requiredlines[].titlestringrequiredlines[].variant_titlestringrequiredlines[].quantityintegerrequiredlines[].unit_priceintegerrequiredlines[].totalintegerrequiredsubtotalintegerrequireddiscountobject or nullrequireddiscount.codestringrequireddiscount.amountintegerrequiredshippingintegerrequiredtax_totalintegerrequiredtotalintegerrequiredrequires_shippingbooleanrequiredpayment_optionsarray of enumrequiredOne of
codonlineonline_methodsarray of enumrequiredOne of
upicardnetbankingwalletemipaylatertest_modebooleanrequiredPayments are simulated: no money moves.
orderobject or nullrequiredorder.idID (ord_...)requiredorder.namestringrequiredorder.payment_statusstringrequiredexpires_attimestamprequired
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | checkout_closed | This checkout is already completed or expired. Start again from the cart. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X PATCH https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
-H "Storefront-Token: <storefront token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R', {
method: 'PATCH',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
}),
});
const data = await res.json();{
"id": "chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"status": "open",
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"buyer": {
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
},
"shipping_address": {},
"accepts_email": false,
"accepts_whatsapp": false,
"lines": [
{
"variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"title": "Festive saree",
"variant_title": "Festive saree",
"quantity": 1,
"unit_price": 49900,
"total": 49900
}
],
"subtotal": 49900,
"discount": {
"code": "string",
"amount": 49900
},
"shipping": 1,
"tax_total": 49900,
"total": 49900,
"requires_shipping": false,
"payment_options": [
"cod"
],
"online_methods": [
"upi"
],
"test_mode": false,
"order": {
"id": "ord_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"payment_status": "string"
},
"expires_at": "2026-11-04T10:00:00.000Z"
}Start a payment for the placed order
POST/storefront/2026-11/checkouts/{id}/attempts
storefront tokenIdempotency-Key required
Path parameters
idID (chk_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
Request body
methodenumrequiredOne of
upicardnetbankingwalletemipaylater
Response 201
idID (att_...)requiredstateenumrequiredOne of
createdawaiting_paymentauthorizedpendingpaidfailedabandonedlate_successcancelledmethodenumrequiredOne of
upicardnetbankingwalletemipaylateramountintegerrequiredtrace_idstringrequiredclient_payloadobject or nullrequiredWhat the payment step needs (provider order and key).
cause_codeenum or nullrequiredOne of
buyer_cancelledbuyer_left_upi_appbuyer_wrong_pin_or_otpbuyer_insufficient_fundsbuyer_limit_exceededbuyer_otherbank_issuer_downbank_timeoutbank_declinedupi_app_not_respondingbank_otherprovider_5xxprovider_slow_orderprovider_rate_limitedprovider_risk_declinedprovider_otherplatform_api_errorplatform_price_mismatchplatform_reservation_errorplatform_checkout_script_errorplatform_signature_invalidplatform_otherstore_kyc_pendingstore_method_not_enabled...messagestring or nullrequiredPlain sentence for the buyer when the payment did not go through.
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | checkout_closed | This checkout is already completed or expired. Start again from the cart. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts \
-H "Storefront-Token: <storefront token>" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"method": "upi"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts', {
method: 'POST',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"method": "upi"
}),
});
const data = await res.json();{
"id": "att_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"state": "created",
"method": "upi",
"amount": 49900,
"trace_id": "string",
"client_payload": {},
"cause_code": "buyer_cancelled",
"message": "Hand block printed cotton."
}Payment status (poll while pending)
GET/storefront/2026-11/checkouts/{id}/attempts/{attempt_id}
storefront token
Path parameters
idID (chk_...)requiredattempt_idID (att_...)required
Response 200
idID (att_...)requiredstateenumrequiredOne of
createdawaiting_paymentauthorizedpendingpaidfailedabandonedlate_successcancelledmethodenumrequiredOne of
upicardnetbankingwalletemipaylateramountintegerrequiredtrace_idstringrequiredclient_payloadobject or nullrequiredWhat the payment step needs (provider order and key).
cause_codeenum or nullrequiredOne of
buyer_cancelledbuyer_left_upi_appbuyer_wrong_pin_or_otpbuyer_insufficient_fundsbuyer_limit_exceededbuyer_otherbank_issuer_downbank_timeoutbank_declinedupi_app_not_respondingbank_otherprovider_5xxprovider_slow_orderprovider_rate_limitedprovider_risk_declinedprovider_otherplatform_api_errorplatform_price_mismatchplatform_reservation_errorplatform_checkout_script_errorplatform_signature_invalidplatform_otherstore_kyc_pendingstore_method_not_enabled...messagestring or nullrequiredPlain sentence for the buyer when the payment did not go through.
Errors
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
-H "Storefront-Token: <storefront token>"const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R', {
method: 'GET',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
},
});
const data = await res.json();{
"id": "att_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"state": "created",
"method": "upi",
"amount": 49900,
"trace_id": "string",
"client_payload": {},
"cause_code": "buyer_cancelled",
"message": "Hand block printed cotton."
}Hand over the provider callback; it is verified and checked with the provider
POST/storefront/2026-11/checkouts/{id}/attempts/{attempt_id}/confirm
storefront tokenIdempotency-Key required
Path parameters
idID (chk_...)requiredattempt_idID (att_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
Request body
payloadobjectrequiredsignaturestringrequiredAt least 1 characters · Up to 500 characters
Response 200
idID (att_...)requiredstateenumrequiredOne of
createdawaiting_paymentauthorizedpendingpaidfailedabandonedlate_successcancelledmethodenumrequiredOne of
upicardnetbankingwalletemipaylateramountintegerrequiredtrace_idstringrequiredclient_payloadobject or nullrequiredWhat the payment step needs (provider order and key).
cause_codeenum or nullrequiredOne of
buyer_cancelledbuyer_left_upi_appbuyer_wrong_pin_or_otpbuyer_insufficient_fundsbuyer_limit_exceededbuyer_otherbank_issuer_downbank_timeoutbank_declinedupi_app_not_respondingbank_otherprovider_5xxprovider_slow_orderprovider_rate_limitedprovider_risk_declinedprovider_otherplatform_api_errorplatform_price_mismatchplatform_reservation_errorplatform_checkout_script_errorplatform_signature_invalidplatform_otherstore_kyc_pendingstore_method_not_enabled...messagestring or nullrequiredPlain sentence for the buyer when the payment did not go through.
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | signature_invalid | The payment confirmation could not be verified. The payment is checked with the provider instead. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R/confirm \
-H "Storefront-Token: <storefront token>" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"payload": {},
"signature": "string"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R/confirm', {
method: 'POST',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"payload": {},
"signature": "string"
}),
});
const data = await res.json();{
"id": "att_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"state": "created",
"method": "upi",
"amount": 49900,
"trace_id": "string",
"client_payload": {},
"cause_code": "buyer_cancelled",
"message": "Hand block printed cotton."
}Test mode only: choose what happens to the payment
POST/storefront/2026-11/checkouts/{id}/attempts/{attempt_id}/test-payment
storefront tokenIdempotency-Key required
Path parameters
idID (chk_...)requiredattempt_idID (att_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
Request body
outcomestringrequired
Response 200
payloadobjectrequiredsignaturestringrequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 403 | forbidden | You do not have access to this resource. |
| 404 | resource_not_found | The object does not exist or belongs to another store. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R/test-payment \
-H "Storefront-Token: <storefront token>" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"outcome": "string"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/attempts/att_01JCG8ZQ5S7T0V4X8K2M3N6P9R/test-payment', {
method: 'POST',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"outcome": "string"
}),
});
const data = await res.json();{
"payload": {},
"signature": "string"
}Place the order (cash on delivery, or unpaid until an online payment succeeds)
POST/storefront/2026-11/checkouts/{id}/place
storefront tokenIdempotency-Key required
Path parameters
idID (chk_...)required
Headers
Idempotency-KeystringrequiredUnique key for this request. Retries with the same key return the first response.
At least 1 characters · Up to 255 characters
Request body
paymentenumrequiredOne of
codonline
Response 200
idID (chk_...)requiredstatusenumrequiredOne of
openblockedcompletedexpiredcart_idID (crt_...)requiredbuyerobjectrequiredbuyer.namestringrequiredbuyer.emailstring or nullrequiredbuyer.phonestring or nullrequiredshipping_addressobject or nullrequiredaccepts_emailbooleanrequiredaccepts_whatsappbooleanrequiredlinesarray of objectrequiredlines[].variant_idID (var_...)requiredlines[].titlestringrequiredlines[].variant_titlestringrequiredlines[].quantityintegerrequiredlines[].unit_priceintegerrequiredlines[].totalintegerrequiredsubtotalintegerrequireddiscountobject or nullrequireddiscount.codestringrequireddiscount.amountintegerrequiredshippingintegerrequiredtax_totalintegerrequiredtotalintegerrequiredrequires_shippingbooleanrequiredpayment_optionsarray of enumrequiredOne of
codonlineonline_methodsarray of enumrequiredOne of
upicardnetbankingwalletemipaylatertest_modebooleanrequiredPayments are simulated: no money moves.
orderobject or nullrequiredorder.idID (ord_...)requiredorder.namestringrequiredorder.payment_statusstringrequiredexpires_attimestamprequired
Errors
| 400 | idempotency_key_required | Every POST needs an Idempotency-Key header. |
| 400 | validation_failed | A field in the request is missing or invalid. See param. |
| 401 | authentication_required | Send a valid access token or session. |
| 409 | checkout_closed | This checkout is already completed or expired. Start again from the cart. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 409 | out_of_stock | An item does not have enough stock for this quantity. Lower the quantity or remove it. |
| 409 | price_changed | A price changed since the checkout started. Review the new total and place the order again. |
| 422 | idempotency_key_reused | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Wait for the time in RateLimit-Reset. |
| 500 | internal_error | Something went wrong on our side. Quote the trace_id to support. |
curl -X POST https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/place \
-H "Storefront-Token: <storefront token>" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"payment": "cod"
}'const res = await fetch('https://api.storelyne.com/storefront/2026-11/checkouts/chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R/place', {
method: 'POST',
headers: {
'Storefront-Token': process.env.STORELYNE_STOREFRONT_TOKEN,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"payment": "cod"
}),
});
const data = await res.json();{
"id": "chk_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"status": "open",
"cart_id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"buyer": {
"name": "Festive saree",
"email": "buyer@example.com",
"phone": "+919876543210"
},
"shipping_address": {},
"accepts_email": false,
"accepts_whatsapp": false,
"lines": [
{
"variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"title": "Festive saree",
"variant_title": "Festive saree",
"quantity": 1,
"unit_price": 49900,
"total": 49900
}
],
"subtotal": 49900,
"discount": {
"code": "string",
"amount": 49900
},
"shipping": 1,
"tax_total": 49900,
"total": 49900,
"requires_shipping": false,
"payment_options": [
"cod"
],
"online_methods": [
"upi"
],
"test_mode": false,
"order": {
"id": "ord_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
"name": "Festive saree",
"payment_status": "string"
},
"expires_at": "2026-11-04T10:00:00.000Z"
}