Products
List products of every type, read one with its options and stock, change an option’s price, stock or visibility.
GET
/v1/products Your shop’s API keyproducts:read Every product of the shop (all types), newest first, 50 a page. type filters by product type, q searches names.
- typestringqueryA product type: keys, files, software, service, accounts, dynamic, physical, subscription, course, ticket, giftcard, bundle.
- qstringqueryWords in the name.
- pageintegerqueryPage number (from 1).
Errors
403missing_scope— The key lacks products:read.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X GET 'https://api.tocler.com/v1/products' \
-H 'Authorization: Bearer tk_live_…'{
"object": "list",
"data": [
{
"id": "665f1c2e9b1e8a00aaaaaaaa",
"object": "product",
"name": "Game top-up",
"type": "dynamic",
"visibility": "public",
"on_hold": false,
"price": {
"amount": "9.99",
"currency": "EUR"
},
"price_from": true,
"variants": 3,
"stock": {
"mode": "unlimited",
"available": null,
"in_checkouts": 0,
"status": "ok"
}
}
],
"page": 1,
"pages": 1,
"total": 1
} GET
/v1/products/{id} Your shop’s API keyproducts:read A product with every option: price, compare-at price, stock (keys left, a count, or unlimited) and how many are held by checkouts in progress.
- idstringpathrequiredThe product’s id.
Errors
403missing_scope— The key lacks products:read.404not_found— No such product in this shop.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X GET 'https://api.tocler.com/v1/products/{id}' \
-H 'Authorization: Bearer tk_live_…'{
"id": "665f1c2e9b1e8a00aaaaaaaa",
"object": "product",
"name": "Game top-up",
"type": "dynamic",
"type_label": "API delivery",
"visibility": "public",
"on_hold": false,
"url": "https://teststore.tocler.com/products/665f1c2e9b1e8a00aaaaaaaa",
"currency": "EUR",
"variants": [
{
"id": "665f1c2e9b1e8a00bbbbbbbb",
"name": "500 gems",
"sku": "TOPUP-500",
"hidden": false,
"built_in": false,
"price": {
"amount": "9.99",
"currency": "EUR"
},
"compare_at": null,
"stock": {
"mode": "unlimited",
"available": null,
"in_checkouts": 0
}
}
]
} PATCH
/v1/products/{id}/variants/{variant_id} Your shop’s API keyproducts:write Change one option’s price (and compare-at price), its stock count (physical goods and counted stock — keys are uploaded in the Dashboard) or whether it is shown. Send only what changes. A new count is written only if the stock is still the number you send as expect (a sale meanwhile → 409, read again). Send an Idempotency-Key header.
- Idempotency-Keystringheaderrequired1–64 letters, digits,
_ - : .— the same one when you retry. The same key with another body → 409 idempotency_mismatch. - idstringpathrequiredThe product’s id.
- variant_idstringpathrequiredThe option’s id (a product without options has one built-in option whose id is the product’s id).
- pricestringbodyThe new price in the shop’s currency, e.g. "12.50".
- compare_atstringbodyThe crossed-out old price, or null to remove it.
- stockobjectbody{ "count": 40, "expect": 35, "reason": "received" } — reasons: received, recount, damaged, lost, returned, correction. Or { "delta": -2, "reason": "damaged" }.
- hiddenbooleanbodytrue hides the option in the shop (at least one stays visible).
Errors
403missing_scope— The key lacks products:write.400invalid_request— A value is not allowed (the message says which).404not_found— No such product or option.409conflict— The stock changed since you read it (a sale) — read again.401invalid_key— No key, a wrong key, or a revoked / expired key (key_revoked, key_expired).429rate_limited— Over the key’s requests per minute — wait for RateLimit-Reset.
curl -X PATCH 'https://api.tocler.com/v1/products/{id}/variants/{variant_id}' \
-H 'Authorization: Bearer tk_live_…' \
-H 'Content-Type: application/json' \
-d '{
"price": "12.50",
"stock": {
"count": 40,
"expect": 35,
"reason": "received"
}
}'{
"price": "12.50",
"stock": {
"count": 40,
"expect": 35,
"reason": "received"
}
}{
"id": "665f1c2e9b1e8a00aaaaaaaa",
"object": "product",
"name": "Game top-up",
"type": "dynamic",
"type_label": "API delivery",
"visibility": "public",
"on_hold": false,
"url": "https://teststore.tocler.com/products/665f1c2e9b1e8a00aaaaaaaa",
"currency": "EUR",
"variants": [
{
"id": "665f1c2e9b1e8a00bbbbbbbb",
"name": "500 gems",
"sku": "TOPUP-500",
"hidden": false,
"built_in": false,
"price": {
"amount": "9.99",
"currency": "EUR"
},
"compare_at": null,
"stock": {
"mode": "unlimited",
"available": null,
"in_checkouts": 0
}
}
]
} Was this page helpful?