Add a variant to an item
Adds a variant to a product, with its own option values, price or cost-plus markup, SKU and optional inventory tracking.
/v1/clients/{clientId}/offerings/{offeringId}/variantsAdds a variant to a product, with its own option values, price or cost-plus markup, SKU and optional inventory tracking. Needs authority over the client — membership of its organization, an API key bound to this client, or tenant staff holding clients:manage; anything else is refused not_client_member or insufficient_scope (403), and an unknown client client_not_found (404). Refuses invalid_request (400) when the variant does not carry one value per product option or the product is already at its variant ceiling, not_found (404), and conflict (409) when another variant already uses the SKU or that combination of options.
Authorization
bearerAuth A tenant API key (sk_{env}_{id}_{secret}), a wallet user token, or an IdP access token. Which principal the credential resolves to decides the scopes it carries; see the authentication guide.
In: header
Path Parameters
uuiduuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A variant as the merchant writes it. amount is required in manual mode and ignored in cost_plus mode, where it derives from cost_amount and the most specific markup. initial_stock is honoured on create only; later counts change through the stock endpoint so the movement log is whole.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/v1/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/offerings/497f6eca-6276-4993-bfeb-53cbbbba6f08/variants" \ -H "Content-Type: application/json" \ -d '{}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "offering_id": "a7d124b6-6a8c-44d1-9d46-4636e3f8c04e", "sku": "string", "barcode": "string", "option_values": [ "string" ], "position": 0, "pricing_mode": "manual", "cost_amount": 0, "markup": { "kind": "percent", "value": 0 }, "amount": 0, "image_url": "string", "inventory": { "track_inventory": true, "in_stock": true, "low_stock": true, "on_hand": 0, "reserved": 0, "available": 0, "allow_backorder": true, "low_stock_threshold": 0 }, "status": "active", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Archive an offering (draft or published)
Retires an offering, draft or published: it leaves discovery and can no longer be edited or bought.
Edit a variant; a price change is recorded in history
Edits one variant. A price change is written to the client's price history with the actor that made it, so a shopper's disputed price can be explained later.