cURL
curl -X PATCH https://api.neuraldraft.io/v1/products/32 \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"price":2799}'await nd.products.update(32, { price: 2799 });
requests.patch("https://api.neuraldraft.io/v1/products/32",
headers={"Authorization": f"Bearer {key}"}, json={"price":2799})
<?php
$client->patch('products/32', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['price' => 2799],
]);
{
"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://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"instance": "req_2Nh4PqRsTuVw"
}Commerce
Update a product
PATCH
/
products
/
{id}
cURL
curl -X PATCH https://api.neuraldraft.io/v1/products/32 \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"price":2799}'await nd.products.update(32, { price: 2799 });
requests.patch("https://api.neuraldraft.io/v1/products/32",
headers={"Authorization": f"Bearer {key}"}, json={"price":2799})
<?php
$client->patch('products/32', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['price' => 2799],
]);
{
"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://api.neuraldraft.io/errors/not_found",
"title": "Not found",
"status": 404,
"detail": "No such resource.",
"code": "not_found",
"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.
Path Parameters
Example:
32
Body
application/json
Maximum string length:
500Available options:
physical, digital, service Available options:
draft, active, archived Response
Updated.
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