cURL
curl https://api.neuraldraft.io/v1/products/32/variants \
-H "Authorization: Bearer ndsk_live_yourkey"const variants = await nd.products.variants.list(32);variants = requests.get("https://api.neuraldraft.io/v1/products/32/variants",
headers={"Authorization": f"Bearer {key}"}).json()["data"]<?php
$vs = json_decode((string) $client->get('products/32/variants', [
'headers' => ['Authorization' => 'Bearer '.$key],
])->getBody(), true)['data'];{
"data": [
{
"id": 71,
"product_id": 32,
"name": "Natural cork",
"sku": "ND-CORK-PAIR-N",
"price": 2999,
"stock_quantity": 18,
"options": {
"color": "natural"
},
"sort_order": 0,
"is_active": true
},
{
"id": 72,
"product_id": 32,
"name": "Charcoal cork",
"sku": "ND-CORK-PAIR-C",
"price": 3299,
"stock_quantity": 6,
"options": {
"color": "charcoal"
},
"sort_order": 1,
"is_active": true
}
]
}{
"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
List product variants
GET
/
products
/
{id}
/
variants
cURL
curl https://api.neuraldraft.io/v1/products/32/variants \
-H "Authorization: Bearer ndsk_live_yourkey"const variants = await nd.products.variants.list(32);variants = requests.get("https://api.neuraldraft.io/v1/products/32/variants",
headers={"Authorization": f"Bearer {key}"}).json()["data"]<?php
$vs = json_decode((string) $client->get('products/32/variants', [
'headers' => ['Authorization' => 'Bearer '.$key],
])->getBody(), true)['data'];{
"data": [
{
"id": 71,
"product_id": 32,
"name": "Natural cork",
"sku": "ND-CORK-PAIR-N",
"price": 2999,
"stock_quantity": 18,
"options": {
"color": "natural"
},
"sort_order": 0,
"is_active": true
},
{
"id": 72,
"product_id": 32,
"name": "Charcoal cork",
"sku": "ND-CORK-PAIR-C",
"price": 3299,
"stock_quantity": 6,
"options": {
"color": "charcoal"
},
"sort_order": 1,
"is_active": true
}
]
}{
"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
Response
Variants.
Show child attributes
Show child attributes
⌘I