cURL
curl -X POST https://api.neuraldraft.io/v1/products \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"Cork yoga block (pair)","price":2999,"currency":"gbp","type":"physical","status":"active"}'await nd.products.create({ name:"Cork yoga block (pair)", price:2999, currency:"gbp", type:"physical", status:"active" });
requests.post("https://api.neuraldraft.io/v1/products",
headers={"Authorization": f"Bearer {key}"},
json={"name":"Cork yoga block (pair)","price":2999,"currency":"gbp","type":"physical","status":"active"})
<?php
$client->post('products', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name'=>'Cork yoga block (pair)','price'=>2999,'currency'=>'gbp','type'=>'physical','status'=>'active'],
]);
{
"id": 32,
"name": "Cork yoga block (pair)",
"slug": "cork-yoga-block-pair",
"price": 2999,
"currency": "gbp",
"status": "active",
"description": "<string>",
"short_description": "<string>",
"compare_at_price": 3999,
"type": "physical",
"sku": "ND-CORK-PAIR",
"stock_quantity": 24,
"track_inventory": false,
"weight": 0.6,
"images": [
"<string>"
],
"metadata": {},
"category_id": 4,
"featured": false,
"published_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": 71,
"product_id": 32,
"name": "Natural cork",
"price": 2999,
"sku": "ND-CORK-PAIR-N",
"stock_quantity": 123,
"options": {
"color": "natural"
},
"sort_order": 0,
"is_active": true
}
],
"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://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/conflict",
"title": "Conflict",
"status": 409,
"detail": "A resource with this slug already exists.",
"code": "conflict",
"instance": "req_2Nh4PqRsTuVw"
}Commerce
Create a product
POST
/
products
cURL
curl -X POST https://api.neuraldraft.io/v1/products \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"Cork yoga block (pair)","price":2999,"currency":"gbp","type":"physical","status":"active"}'await nd.products.create({ name:"Cork yoga block (pair)", price:2999, currency:"gbp", type:"physical", status:"active" });
requests.post("https://api.neuraldraft.io/v1/products",
headers={"Authorization": f"Bearer {key}"},
json={"name":"Cork yoga block (pair)","price":2999,"currency":"gbp","type":"physical","status":"active"})
<?php
$client->post('products', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name'=>'Cork yoga block (pair)','price'=>2999,'currency'=>'gbp','type'=>'physical','status'=>'active'],
]);
{
"id": 32,
"name": "Cork yoga block (pair)",
"slug": "cork-yoga-block-pair",
"price": 2999,
"currency": "gbp",
"status": "active",
"description": "<string>",
"short_description": "<string>",
"compare_at_price": 3999,
"type": "physical",
"sku": "ND-CORK-PAIR",
"stock_quantity": 24,
"track_inventory": false,
"weight": 0.6,
"images": [
"<string>"
],
"metadata": {},
"category_id": 4,
"featured": false,
"published_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": 71,
"product_id": 32,
"name": "Natural cork",
"price": 2999,
"sku": "ND-CORK-PAIR-N",
"stock_quantity": 123,
"options": {
"color": "natural"
},
"sort_order": 0,
"is_active": true
}
],
"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://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/conflict",
"title": "Conflict",
"status": 409,
"detail": "A resource with this slug already exists.",
"code": "conflict",
"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.
Body
application/json
Maximum string length:
500Available options:
physical, digital, service Available options:
draft, active, archived Response
Created.
Example:
32
Example:
"Cork yoga block (pair)"
Example:
"cork-yoga-block-pair"
Example:
2999
Example:
"gbp"
Available options:
draft, active, archived Example:
"active"
Maximum string length:
500Example:
3999
Available options:
physical, digital, service Example:
"physical"
Example:
"ND-CORK-PAIR"
Example:
24
Example:
0.6
Example:
4
Show child attributes
Show child attributes