cURL
curl -X POST https://api.neuraldraft.io/v1/orders \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Joe","email":"joe@example.com"},"payment_method":"manual"}'const order = await nd.orders.create({
items: [{ productId: 32, quantity: 1 }],
customer: { name: "Joe", email: "joe@example.com" },
paymentMethod: "manual",
});
r = requests.post("https://api.neuraldraft.io/v1/orders",
headers={"Authorization": f"Bearer {key}", "Idempotency-Key": str(uuid.uuid4())},
json={"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Joe","email":"joe@example.com"},"payment_method":"manual"})
<?php
$client->post('orders', [
'headers' => ['Authorization' => 'Bearer '.$key, 'Idempotency-Key' => Str::uuid()->toString()],
'json' => ['items'=>[['product_id'=>32,'quantity'=>1]],'customer'=>['name'=>'Joe','email'=>'joe@example.com'],'payment_method'=>'manual'],
]);
{
"id": 901,
"order_number": "ND-1745014102-A8F2",
"customer_email": "jsmith@example.com",
"status": "pending",
"payment_status": "unpaid",
"total": 123,
"currency": "gbp",
"customer_name": "<string>",
"customer_phone": "<string>",
"subtotal": 123,
"tax_amount": 123,
"shipping_amount": 123,
"discount_amount": 123,
"payment_method": "stripe",
"billing_address": {},
"shipping_address": {},
"notes": "<string>",
"admin_notes": "<string>",
"items": [
{
"name": "<string>",
"quantity": 1,
"unit_price": 2999,
"total": 2999,
"product_id": 123,
"product_variant_id": 123,
"sku": "<string>",
"metadata": {}
}
],
"paid_at": "2023-11-07T05:31:56Z",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"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/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"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."
]
}
}Commerce
Create a manual order (admin)
Admin-created order without going through Stripe Checkout. Useful for
offline / cash sales. Bypasses payment, sets payment_method: manual.
Stock is decremented if track_inventory is true.
POST
/
orders
cURL
curl -X POST https://api.neuraldraft.io/v1/orders \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Joe","email":"joe@example.com"},"payment_method":"manual"}'const order = await nd.orders.create({
items: [{ productId: 32, quantity: 1 }],
customer: { name: "Joe", email: "joe@example.com" },
paymentMethod: "manual",
});
r = requests.post("https://api.neuraldraft.io/v1/orders",
headers={"Authorization": f"Bearer {key}", "Idempotency-Key": str(uuid.uuid4())},
json={"items":[{"product_id":32,"quantity":1}],"customer":{"name":"Joe","email":"joe@example.com"},"payment_method":"manual"})
<?php
$client->post('orders', [
'headers' => ['Authorization' => 'Bearer '.$key, 'Idempotency-Key' => Str::uuid()->toString()],
'json' => ['items'=>[['product_id'=>32,'quantity'=>1]],'customer'=>['name'=>'Joe','email'=>'joe@example.com'],'payment_method'=>'manual'],
]);
{
"id": 901,
"order_number": "ND-1745014102-A8F2",
"customer_email": "jsmith@example.com",
"status": "pending",
"payment_status": "unpaid",
"total": 123,
"currency": "gbp",
"customer_name": "<string>",
"customer_phone": "<string>",
"subtotal": 123,
"tax_amount": 123,
"shipping_amount": 123,
"discount_amount": 123,
"payment_method": "stripe",
"billing_address": {},
"shipping_address": {},
"notes": "<string>",
"admin_notes": "<string>",
"items": [
{
"name": "<string>",
"quantity": 1,
"unit_price": 2999,
"total": 2999,
"product_id": 123,
"product_variant_id": 123,
"sku": "<string>",
"metadata": {}
}
],
"paid_at": "2023-11-07T05:31:56Z",
"shipped_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"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/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"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."
]
}
}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.
Maximum string length:
255Body
application/json
Response
Created.
Example:
901
Example:
"ND-1745014102-A8F2"
Available options:
pending, paid, processing, shipped, delivered, cancelled, refunded Available options:
unpaid, paid, partially_refunded, refunded, failed Example:
"gbp"
Available options:
stripe, manual Hidden in public lookups.
Show child attributes
Show child attributes