WalletD developers
Catalog

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.

PUT/v1/clients/{clientId}/offerings/{offeringId}/variants/{variantId}

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. 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), not_found (404), invalid_transition (409) for an archived variant, and conflict (409) for a SKU or option combination another variant already uses.

Authorization

bearerAuth
AuthorizationBearer <token>

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

clientId*string
Formatuuid
offeringId*string
Formatuuid
variantId*string
Formatuuid

Request 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 PUT "https://example.com/v1/clients/497f6eca-6276-4993-bfeb-53cbbbba6f08/offerings/497f6eca-6276-4993-bfeb-53cbbbba6f08/variants/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -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"}