curl -X POST https://api.neuraldraft.io/v1/checkout-sessions \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Anna","email":"anna@example.com"},"success_url":"https://lakesideyoga.uk/success","cancel_url":"https://lakesideyoga.uk/cart"}'const session = await nd.checkout.create({
items: [{ productId: 32, quantity: 1 }],
customer: { name: "Anna", email: "anna@example.com" },
successUrl: "https://lakesideyoga.uk/success",
cancelUrl: "https://lakesideyoga.uk/cart",
});
window.location = session.checkout_url;
r = requests.post("https://api.neuraldraft.io/v1/checkout-sessions",
headers={"Authorization": f"Bearer {key}"},
json={"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Anna","email":"anna@example.com"},"success_url":"https://lakesideyoga.uk/success","cancel_url":"https://lakesideyoga.uk/cart"})
<?php
$session = json_decode((string) $client->post('checkout-sessions', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['items'=>[['product_id'=>32,'quantity'=>1]],'customer'=>['name'=>'Anna','email'=>'anna@example.com'],'success_url'=>'https://lakesideyoga.uk/success','cancel_url'=>'https://lakesideyoga.uk/cart'],
])->getBody(), true);
{
"order_id": 902,
"stripe_session_id": "cs_live_a1b2c3d4",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1b2c3d4",
"expires_at": "2026-04-19T11:14:02Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/connect_not_ready",
"title": "Stripe Connect not ready",
"status": 402,
"detail": "This project's Stripe Connect account is not yet onboarded.",
"code": "connect_not_ready"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}{
"type": "https://api.neuraldraft.io/errors/rate_limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit exceeded. Retry in 12 seconds.",
"code": "rate_limited",
"instance": "req_2Nh4PqRsTuVw"
}Create a Stripe Checkout session
Server-side or browser-side initiation of Stripe Checkout. Returns a
checkout_url to redirect the buyer to. Stripe Checkout settles into
the project’s connected Stripe account. The created Order lives in
pending until the Stripe webhook flips it to paid.
Costs 0 credits — Stripe processing fees apply on the connected account.
curl -X POST https://api.neuraldraft.io/v1/checkout-sessions \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Anna","email":"anna@example.com"},"success_url":"https://lakesideyoga.uk/success","cancel_url":"https://lakesideyoga.uk/cart"}'const session = await nd.checkout.create({
items: [{ productId: 32, quantity: 1 }],
customer: { name: "Anna", email: "anna@example.com" },
successUrl: "https://lakesideyoga.uk/success",
cancelUrl: "https://lakesideyoga.uk/cart",
});
window.location = session.checkout_url;
r = requests.post("https://api.neuraldraft.io/v1/checkout-sessions",
headers={"Authorization": f"Bearer {key}"},
json={"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Anna","email":"anna@example.com"},"success_url":"https://lakesideyoga.uk/success","cancel_url":"https://lakesideyoga.uk/cart"})
<?php
$session = json_decode((string) $client->post('checkout-sessions', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['items'=>[['product_id'=>32,'quantity'=>1]],'customer'=>['name'=>'Anna','email'=>'anna@example.com'],'success_url'=>'https://lakesideyoga.uk/success','cancel_url'=>'https://lakesideyoga.uk/cart'],
])->getBody(), true);
{
"order_id": 902,
"stripe_session_id": "cs_live_a1b2c3d4",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1b2c3d4",
"expires_at": "2026-04-19T11:14:02Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/connect_not_ready",
"title": "Stripe Connect not ready",
"status": 402,
"detail": "This project's Stripe Connect account is not yet onboarded.",
"code": "connect_not_ready"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}{
"type": "https://api.neuraldraft.io/errors/rate_limited",
"title": "Too many requests",
"status": 429,
"detail": "Rate limit exceeded. Retry in 12 seconds.",
"code": "rate_limited",
"instance": "req_2Nh4PqRsTuVw"
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Headers
Unique key (any string up to 255 chars; UUID recommended). Retries with the same key within 24 hours return the original response without re-executing side effects.
255Body
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Stripe redirects here after successful payment. May contain
{CHECKOUT_SESSION_ID} placeholder which Stripe replaces.
Show child attributes
Show child attributes