Update a variant's declared availability

Declares how many spots are left on one variant, and whether it is on sale. Idempotent: send only what changed, repeat it as often as you like. The product can be addressed by Trama's id or by your own `externalReferenceCode`. 🔴 This is a DECLARATION, not a booking ledger. Trama never decrements it when a conversation closes, there are no holds and no overbooking checks — the number is whatever you last wrote. `inventoryUpdatedAt` is stamped by the server on every write; a `sold_out` or `closed` variant stops being quoted by the AI agent, and a remaining count stops being repeated once it goes stale.

PATCH
/v1/catalog/products/{productId}/variants/{variantId}

Declares how many spots are left on one variant, and whether it is on sale. Idempotent: send only what changed, repeat it as often as you like. The product can be addressed by Trama's id or by your own externalReferenceCode.

🔴 This is a DECLARATION, not a booking ledger. Trama never decrements it when a conversation closes, there are no holds and no overbooking checks — the number is whatever you last wrote. inventoryUpdatedAt is stamped by the server on every write; a sold_out or closed variant stops being quoted by the AI agent, and a remaining count stops being repeated once it goes stale.

Authorization

AuthorizationBearer <token>

The organization API key, sent as Authorization: Bearer <key>.

In: header

Path Parameters

productId*string

Trama's product id, or the externalReferenceCode you set for it. The code is what lets you sync from your own system without storing Trama ids.

variantId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

inventoryStatus?|

Declared commercial state. open = on sale, sold_out = no spots left, closed = off sale. Send null to stop tracking availability — which is NOT the same as open. A sold_out or closed variant stops being quoted by the AI agent.

Value in

  • "open"
  • "sold_out"
  • "closed"
  • null
remaining?|

How many spots are left, as YOUR system knows it. Send null to stop tracking the count. Sending 0 implies sold_out. Sending a positive number on a variant with no state opens it for sale. Omit the field to leave it untouched.

Range0 <= value

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/catalog/products/string/variants/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "capacityMax": 0,  "capacityMin": 0,  "currency": "string",  "description": "string",  "durationDays": 0,  "durationHours": 0,  "excludes": [    "string"  ],  "fromPrice": 0,  "id": "string",  "includes": [    "string"  ],  "inventoryRemaining": 0,  "inventoryStatus": "open",  "inventoryUpdatedAt": "2019-08-24T14:15:22Z",  "label": "string",  "position": 0,  "priceMax": 0,  "shortDescription": "string",  "status": "active"}