Bulk upsert products
const url = 'https://api.loyx.se/partners/v1/products/bulk';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"products":[{"brand":"example","categories":["example"],"description":"example","external_product_id":"example","identifiers":[{"type":"example","value":"example"}],"image_link":"example","is_loyalty_program_eligible":true,"loyx_app_active":true,"loyx_business_app_active":true,"name":"example","page_url":"example","price":{"currency":"SEK","value":1},"stores":[{"price":{"currency":"SEK","value":1},"store_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}],"unit":"ea"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.loyx.se/partners/v1/products/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "products": [ { "brand": "example", "categories": [ "example" ], "description": "example", "external_product_id": "example", "identifiers": [ { "type": "example", "value": "example" } ], "image_link": "example", "is_loyalty_program_eligible": true, "loyx_app_active": true, "loyx_business_app_active": true, "name": "example", "page_url": "example", "price": { "currency": "SEK", "value": 1 }, "stores": [ { "price": { "currency": "SEK", "value": 1 }, "store_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "unit": "ea" } ] }'Create or update up to 100 products in one call, each matched on its required external_product_id with the same rules as POST /products. Items are processed independently and in order: a failing item does not roll back the others, and the response carries one result per item (created, updated or failed with the error). The call is safe to retry — resend the whole request or only the failed items. A key repeated within one request fails from its second occurrence (duplicate_in_request).
Always 207 Multi-Status, even when every item succeeded: read each item’s status. With an Idempotency-Key, a resend of the same body within 24 h returns the first result without running again; the same key with a different body is 409 idempotency_key_reused, and a resend while the first call is still running is 409 idempotency_request_in_progress.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Up to 100 products, each created or updated by its external_product_id.
object
1–100 products. Each is upserted independently; one failing item does not roll back the others. A key may appear only once per request.
One product in a bulk upsert. Same body as create, but the key is required.
Without external_product_id a retried bulk call would create duplicates,
so the bulk endpoint only accepts keyed items.
object
Category labels defined on the company. Must match existing categories.
Your product key — the upsert match key. Required in a bulk call.
Typed identifiers (gtin/ean13/ean8/sku/pos). Each (type, value) pair must be unique per company across non-deleted products.
Typed product identifier (gtin / ean13 / ean8 / sku / pos).
object
Identifier type: gtin, ean13, ean8, sku, or pos.
When true, purchases of this product accrue loyalty points or stamps.
When true, the product is visible in the consumer LoyX app.
When true, the product is visible in the LoyX Business (staff) app.
Display name shown in the mobile app and digital receipts.
Base price in minor units paired with a currency code.
object
ISO 4217 currency code
Amount in minor units (e.g. öre, cents)
Stores that carry this product — at least one. Each entry may set a per-store price override.
Store assortment entry: a store that carries the product.
object
Monetary amount in minor units + currency code (request input).
object
ISO 4217 currency code
Amount in minor units (e.g. öre, cents)
Internal UUID of a store that carries this product.
Unit the product is sold in (ea, kg, g, l, ml, m, pack). Defaults to ea (each).
Responses
Section titled “Responses”One result per item, in request order, plus counts.
Per-item results plus counts. Always 207 Multi-Status, even when some items failed.
object
How many items created a new product.
How many items were not written; see their error.
One result per request item, in request order.
Outcome of one bulk item, in request order.
object
Why one bulk item was not written.
The item’s match key, as stored.
Position of the item in the request products array.
Catalog-only product response.
Per-store pricing lives in the stores_products schemas
(GET /stores/{store_id}/products).
object
Typed product identifier in API responses.
object
Monetary amount in minor units + currency code + formatting metadata (response).
Includes minor_units (divisor to convert to major units) and locale (RFC 5646) so the client can display prices without hardcoding rules.
object
ISO 4217 currency code
RFC 5646 locale for formatting (e.g. sv-SE)
Divisor to convert to major units (e.g. 100 for SEK)
Amount in minor units (e.g. öre, cents)
created (new product), updated (key matched) or failed.
How many items updated an existing product.
Example
{ "results": [ { "product": { "price": { "currency": "SEK" } }, "status": "created" } ]}missing_token, invalid_authorization_header or invalid_token: get a new access token and retry once.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}insufficient_scope: the API key lacks the scope this route needs.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Idempotency-Key reused with another body, or still in progress.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Validation Error
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}rate_limit_exceeded: wait Retry-After seconds.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}internal_server_error or database_error (type internal_error): our fault. Retry with backoff; quote request_id.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}