cURL
curl -X POST https://api.neuraldraft.io/v1/product-categories \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"Blocks","parent_id":4}'await nd.productCategories.create({ name: "Blocks", parentId: 4 });
requests.post("https://api.neuraldraft.io/v1/product-categories",
headers={"Authorization": f"Bearer {key}"},
json={"name":"Blocks","parent_id":4})
<?php
$client->post('product-categories', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name' => 'Blocks', 'parent_id' => 4],
]);
{
"id": 4,
"name": "Studio essentials",
"slug": "studio-essentials",
"description": "<string>",
"image": "<string>",
"parent_id": 123,
"sort_order": 0,
"is_active": true,
"children": "<array>"
}{
"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/conflict",
"title": "Conflict",
"status": 409,
"detail": "A resource with this slug already exists.",
"code": "conflict",
"instance": "req_2Nh4PqRsTuVw"
}Commerce
Create a product category
POST
/
product-categories
cURL
curl -X POST https://api.neuraldraft.io/v1/product-categories \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"Blocks","parent_id":4}'await nd.productCategories.create({ name: "Blocks", parentId: 4 });
requests.post("https://api.neuraldraft.io/v1/product-categories",
headers={"Authorization": f"Bearer {key}"},
json={"name":"Blocks","parent_id":4})
<?php
$client->post('product-categories', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name' => 'Blocks', 'parent_id' => 4],
]);
{
"id": 4,
"name": "Studio essentials",
"slug": "studio-essentials",
"description": "<string>",
"image": "<string>",
"parent_id": 123,
"sort_order": 0,
"is_active": true,
"children": "<array>"
}{
"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/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