{"openapi":"3.1.0","info":{"title":"TPP Public API","version":"1.28.1","contact":{"name":"TPP support","email":"support@thepowerplugin.com"},"description":"**Reward your players. Anywhere.** Plug your CRM, loyalty\nengine or partner integration into TPP and:\n\n- 🎁 **Onboard players** the moment they sign up on your casino.\n- 🪙 **Run their coin wallet** — credit bonuses, debit redemptions, audit every movement.\n- 📦 **Place and track orders** from `pending` to `completed`, with carrier + tracking.\n- 🛍️ **Browse the live catalog** scoped to your sub-brand and country.\n- ↩️ **Retry safely** — money-moving calls take an `Idempotency-Key`, and every response carries an `x-request-id`.\n\n### Environments\n\n| Environment | Base URL | API keys |\n|---|---|---|\n| Production | `https://api.thepowerplugin.com` | `tpp_live_*` only |\n| Staging | `https://stg-api.thepowerplugin.com` | `tpp_test_*` issued on staging |\n| Demo (sandbox) | `https://sandbox.thepowerplugin.com` | `tpp_test_*` issued on demo |\n\nEach environment has its own keys and data: a key works only in the\nenvironment that issued it, and production rejects `tpp_test_*` keys.\nBuild and test against staging or demo, then switch the base URL and\nkey for production.\n\n**Quick start.** Get a `tpp_test_*` key for staging or demo (backoffice\nof that environment → **Sub-brand → API keys**, or ask your TPP\ncontact), pick the matching server in the request panel, paste the key\ninto the auth panel and try any endpoint from this page. **Try it only\ncalls staging or demo, never production.** Wire format is `snake_case`\nJSON; money is integer minor units with a separate `currency`;\ntimestamps are ISO-8601 UTC; IDs are UUIDv7 strings.\n\n**Versioning.** Within v1 only additive changes ship (new endpoints,\noptional fields, enum values). Renames and removals go to `/api/v2/`,\nand v1 stays available for a 6-month deprecation window.\n\nNew here? Open the **Integration** page in the sidebar for the full\npicture of how a partner integration flows end to end, and **Webhooks**\nfor the events TPP sends you. Questions: support@thepowerplugin.com."},"servers":[{"url":"https://stg-api.thepowerplugin.com","description":"Staging — test data; use a `tpp_test_*` key issued on staging"},{"url":"https://sandbox.thepowerplugin.com","description":"Demo (sandbox) — test data; use a `tpp_test_*` key issued on demo"}],"tags":[{"name":"Integration","description":"A partner integration is **five HTTP calls** in a loop — onboard\na player, credit their wallet, browse the catalog, reserve an\norder, track it to the door.\n\nThe full walkthrough — flow diagram + a paragraph per endpoint +\nquick-start + partner guarantees — lives on a dedicated,\nfull-width page:\n\n### 👉 [Open the Integration Guide](https://demo-api.thepowerplugin.com/api/v1/guide)\n\nPrefer to dive straight into the endpoints? Every operation in\nthe sidebar has a live \"Try it\" console — paste your bearer\ntoken into the auth panel and go."},{"name":"Agentic Integration","description":"**AI first.** Point your coding agent at our skill and it knows how\nto integrate with TPP — endpoints, envelope, idempotency, webhooks,\nthe hosted storefront, the shipping window and the MCP server — with\nthe guardrails built in. One line, paste it into Claude Code, Cursor,\nCodex or any agent that can fetch a URL:\n\n```text\nAdd TPP rewards to my app: https://demo-api.thepowerplugin.com/api/v1/SKILL.md\n```\n\n### 👉 [Open the Agentic Integration page](https://demo-api.thepowerplugin.com/api/v1/agents)\n\n| Artefact | URL | What it is |\n|---|---|---|\n| Agent skill | `https://demo-api.thepowerplugin.com/api/v1/SKILL.md` | the playbook (Agent Skills format: frontmatter + instructions) |\n| llms.txt | `https://demo-api.thepowerplugin.com/api/v1/llms.txt` (also `https://demo.thepowerplugin.com/llms.txt`) | index of everything an LLM should read first |\n| OpenAPI 3.1 | `https://demo-api.thepowerplugin.com/api/v1/openapi.json` | the authoritative contract the skill tells the agent to fetch |\n| MCP server | `https://demo.thepowerplugin.com/api/mcp` · manifest `https://demo.thepowerplugin.com/api/mcp/tools` | operate TPP from an agent with the same bearer key |\n\nThe skill never contains a key: the agent asks you for a `tpp_test_*`\nkey, keeps it server-side and verifies it against `/api/v1/health` on\nstaging (`https://stg-api.thepowerplugin.com`) or demo\n(`https://sandbox.thepowerplugin.com`) first — test keys are not accepted\nin production."},{"name":"Webhooks","description":"TPP pushes events to an HTTPS endpoint you register for your sub-brand\n(backoffice → **Sub-brand → Webhooks**, or ask your TPP contact). Each\nendpoint has its own signing secret (`whsec_…`, shown when it is created;\na sub-brand owner can reveal it again in the backoffice) and a list\nof subscribed event types.\n\n### Events\n\n| Type | When |\n|---|---|\n| `order.created` | an order was placed: API, backoffice, a game or raffle prize, or a store checkout (`data.source: \"storefront\"`; omitted otherwise) |\n| `order.status_changed` | the order status moved in the backoffice, or the order was cancelled or bought back (`pending` → `processing` → `shipped` → `completed`, or `cancelled` / `failed`). Fraud cancellations, item fulfilment and order-line edits send none |\n| `order.paid` | a `pay_per_order` order's payment was marked paid |\n| `order.shipping_updated` | address, carrier or tracking changed (optional `data.source`: `shipping_window`, `api`, `backoffice` or `provider`) |\n| `batch.closed` · `batch.invoiced` · `batch.paid` | monthly billing batch lifecycle |\n| `balance.topped_up` | your prepaid balance was credited |\n| `product.availability_changed` | a product became available or unavailable |\n\nNew event types may be added within v1: answer `2xx` and ignore types\nyou do not handle.\n\nA store order has no partner redemption record: its coins are already\nsettled at checkout. **Do not debit coins** on `order.created` when\n`data.source` is `\"storefront\"`. `data.order.status_url` and\n`status_token` are always `null` in a webhook.\n\n### Product availability and the Products API\n\n`data.product.family_id` is the id for `GET /api/v1/products/{id}`;\n`data.product.market_id` is the `listing_market_id` to send to\n`POST /api/v1/orders`. `variant_id` matches a variant in the product\ndetail, but is not accepted as a product id.\n\nAn event can be about a product `GET /api/v1/products` does not return\nyet. A listing change (stock, a market switched on or off, a product\napproved or paused) is sent for every product from your providers, and\nevery custom product your brand created, in a country you operate —\nwhether or not it is in one of your catalogs. The Products API only\nreturns products in an **active catalog** your sub-brand can use, with\nan orderable listing in your markets. A `404` for a `family_id` from a\nwebhook therefore usually means the product is not in an active catalog\nof yours: add it to one in the backoffice (**Catalog → Catalogs**). When\nit becomes visible to the API you receive `product.availability_changed`\nwith `status: available` and `reason: visibility-gained`; when it stops\nbeing visible, `status: unavailable` and `reason: visibility-lost`.\n\n### Envelope and signature\n\nBody: `{ \"id\", \"type\", \"created_at\", \"sub_brand_id\", \"data\" }`, JSON,\n`User-Agent: TPP-Webhooks/1`. Signed with\n[Standard Webhooks](https://www.standardwebhooks.com): `webhook-id`\n(identical on every retry and on a manual resend — dedupe on this header,\nnot on `id` in the body, which a payload template can drop),\n`webhook-timestamp` (unix seconds of this attempt) and\n`webhook-signature` (`v1,<base64 HMAC-SHA256>` over\n`<webhook-id>.<webhook-timestamp>.<raw body>`; several space-separated\nvalues while a secret is being rotated). Verify the **raw** body with an\nofficial Standard Webhooks library and reject timestamps older than 5\nminutes. A legacy `X-TPP-Signature` header is also sent; it is\ndeprecated — do not build on it.\n\n### Delivery and retries\n\n- Only a `2xx` answer counts as delivered. Redirects (`3xx`) are not\n  followed and count as a failure, like `4xx`, `5xx` and timeouts.\n- Each attempt times out after **10 seconds**: acknowledge first, then\n  process asynchronously.\n- Up to **7 attempts**: the first, then retries 1 min, 5 min, 30 min,\n  2 h, 6 h and 12 h after each failure — the last one about **20 h 36 min**\n  after the first. No further attempts are made after the seventh.\n- Delivery is at-least-once and not ordered: dedupe on `webhook-id`\n  and read the current state from the API when order matters. Answer a\n  duplicate `200`: a `4xx` counts as a failed delivery.\n- The endpoint is disabled after **20 failed attempts in a row** whose\n  first failure is **at least 24 hours old**; a success or a re-enable\n  resets the streak, and a failure more than 48 h after the previous one\n  starts a new streak. A low-traffic dead endpoint can stay enabled\n  because it never reaches 20. A disabled endpoint receives nothing, and\n  events in the meantime are not queued, until it is re-enabled in the\n  backoffice; re-enabling does not backfill. Reconcile with the API.\n- Endpoints share delivery capacity fairly. While an endpoint is failing,\n  its backlog drains slowly until it answers `2xx` again."},{"name":"Customers","description":"Your players, on TPP. Register them the moment they sign up — an `external_id` is enough; the hosted shipping form fills in their name later — keep their profile in sync, and run their virtual-coin wallet (credits, debits, full movement history) from your loyalty backend. Each customer belongs to one sub-brand, so multi-brand operators get clean isolation out of the box."},{"name":"Orders","description":"Where redemptions become packages. Place an order, track it through `pending → processing → shipped → completed` (or `cancelled` / `failed`), read carrier and tracking details for customer-facing UIs, collect the delivery address with the hosted shipping form, or cancel before it ships. Billing-aware: an order placed while a prepaid brand's balance is insufficient comes back with `billing_status: \"blocked_balance\"` and is not fulfilled until the balance is topped up."},{"name":"System","description":"Operational endpoints for your integration's plumbing. Verify your key works with `/health`, download the machine-readable contract from `/api/v1/openapi.json`, or share these pages with a colleague at `/api/v1/docs`."},{"name":"Stores","description":"The storefronts where your players shop. Read them to deep-link players to the right URL, attribute redemptions to the right store, and show live data in companion apps. With the `stores:create` / `stores:update` scopes you can also create a store and design it through a draft (theme, sections, languages) using the same rules as the backoffice editor, then publish it."},{"name":"Media","description":"Upload images for your store designs, games and raffles. Prepare a signed, short-lived upload, `PUT` the bytes to the returned URL, then confirm it: TPP checks the size, hash and type, re-encodes the image as WebP and returns a URL you can use in a design. Requires the `media:create` scope."},{"name":"Games","description":"Arcade games (plinko, tower, mines, deal) for your storefront. List and read them, create one from a preset with a published RTP of at most 90 % and your brand's art, edit its name, copy and art, and publish it. Economic terms are never changed through the API. Creating a game answers `403` when that game type is not enabled for your sub-brand."},{"name":"Raffles","description":"Prize draws for your storefront. Create a draft raffle with catalogue prizes, edit its name, copy and art while it is a draft or scheduled, and publish it to schedule the automatic draw. Claimed prizes become orders billed to your brand. Creating a raffle answers `403` when raffles are not enabled for your sub-brand."},{"name":"Catalogs","description":"Curated product selections for each sub-brand. Catalogs can be brand-wide (accepted per sub-brand) or exclusive to one sub-brand. The API returns only the catalogs your key can use right now — catalogs still awaiting acceptance, rejected or disabled are not listed."},{"name":"Categories","description":"TPP's global product categories. Use a category `id` as `category_id` on `GET /api/v1/products` to filter the catalog; `slug` is stable for URLs."},{"name":"Brands","description":"Metadata of the brand and sub-brand your key belongs to — names, slug, country, logo and default currency, for display in your integration. A key reads only its own sub-brand."},{"name":"Products","description":"Everything redeemable, from the latest console to a branded hoodie. Filter by category or catalog, search by name, fetch full variant detail with SKUs and images. Only active products in a catalog your sub-brand can use, with an orderable listing in your markets, are returned — including brand-level custom products owned by your brand and custom products owned by your sub-brand. A sub-brand-owned product never crosses to a sibling or another brand, even when its id is known. A valid default provider never hides your owned custom products. Every product carries its final price; every variant carries the `listing_market_id` to send to `POST /api/v1/orders`. Custom products have no provider reservation integration: TPP Operations coordinates fulfilment manually today, and the long-term owner/process must be agreed with TPP during onboarding."},{"name":"Store sessions","description":"Sign a player from your site into a TPP storefront without a second login. Your backend mints a short-lived hand-off URL per player (creating the customer on first use); redirect the player to it or load it as an iframe `src`."},{"name":"Embed sessions","description":"Sign players into TPP's standalone games on your own site. Your backend mints a short-lived, single-use token per player; the TPP loader (`<script src=\"https://app.thepowerplugin.com/embed/v1/loader.js\" async>`) hands it to the game iframe, which exchanges it once. Available only when TPP has enabled embedded games for your sub-brand — otherwise `404`."},{"name":"Engine","description":"Award points from your own events — deposits, logins, missions. TPP configures the event definitions for your sub-brand; list them with `GET /api/v1/engine/definitions`, then deliver events as JSON (`POST /api/v1/engine/events`) or as a provider webhook payload (`POST /api/v1/engine/webhooks/{code}`). A `200` is not \"points granted\": read `data.status`. Answers `403` when the Engine is not enabled for your brand."}],"security":[{"BearerApiKey":[]}],"paths":{"/api/v1/customers/{id}/coins":{"get":{"operationId":"getCustomerCoins","summary":"Get a customer's coin wallet snapshot","description":"Returns the cached balance plus the 10 most recent movements\nfor the customer. Convenient for an activity-feed UI that\nshows running history without a separate paginated call.\n\nReturns `balance: 0` with an empty `recent_movements` array\nwhen the customer's wallet has never been touched.\n\nFor the full history, page through\n`GET /customers/{id}/coins/movements`.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoinWallet"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"adjustCustomerCoins","summary":"Adjust a customer's coin balance","description":"Credits (positive `delta`) or debits (negative `delta`) the\ncustomer's virtual-coin wallet. Adjustments on one wallet are\nserialised, so concurrent debits can never take the balance below\nzero.\n\nUse it to debit the coins a redemption costs: `POST /orders` does\nnot move coins.\n\n**Idempotency-Key is required.** A retry with the same key and body\nreturns the original response with `Idempotent-Replay: true` (the\nbalance from the original execution, NOT a fresh read). The same\nkey with a different body, or while the first request is still\nrunning, returns 409 `idempotency_conflict`.\n\nConstraints:\n- `delta` is a signed integer, non-zero, `|delta| <= 1_000_000`.\n- A debit larger than the balance returns 409 `conflict` with\n  `error.field_errors.reason: [\"insufficient_balance\"]`; a credit\n  that would overflow the wallet returns 409 with\n  `reason: [\"balance_overflow\"]`. Nothing is applied in either case.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:coins"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"welcome-bonus-player-48213"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","maxLength":500}},"required":["delta"]}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CoinAdjustment"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders":{"get":{"operationId":"listOrders","summary":"List orders","description":"Cursor-paginated list of orders for the calling sub-brand. Newest\nfirst. Filter by status, store id, or a creation-time window.\n\nBilling-layer fields (billing batch references, payment references)\nare not exposed by the public API.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:read"],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["pending","processing","shipped","completed","failed","cancelled"]}},{"in":"query","name":"store_id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"customer_id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"q","schema":{"type":"string","minLength":1}},{"in":"query","name":"created_from","schema":{"description":"Inclusive lower bound on `created_at` (ISO-8601).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Inclusive lower bound on `created_at` (ISO-8601)."},{"in":"query","name":"created_to","schema":{"description":"Inclusive upper bound on `created_at` (ISO-8601).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Inclusive upper bound on `created_at` (ISO-8601)."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"address_state","schema":{"description":"Filter by derived shipping-address state: missing, captured, or locked.","type":"string","enum":["missing","captured","locked"]},"description":"Filter by derived shipping-address state: missing, captured, or locked."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"reserveOrder","summary":"Reserve a new order","description":"Creates an order in the calling key's sub-brand from one or more\ncatalog listings. Each line item references a `listing_market_id`\n(from `variants[]` of `GET /products` or `GET /products/{id}`) and\nan existing customer of the same sub-brand. Only catalog listings\ncan be ordered. A customer whose `status` is `restricted` or\n`banned` cannot receive an order (403 `forbidden`).\n\nOwned custom products use the same visibility rule as `GET /products`:\nbrand-level products are available to every sub-brand of their brand,\nwhile a sub-brand-owned product is available only to that sub-brand.\nA sibling or foreign `listing_market_id` is returned as the same opaque\nunknown-market error. The internal custom provider has no reservation\nintegration, so TPP Operations coordinates fulfilment manually today;\nagree the long-term owner and process with TPP during onboarding.\n\nCoins are not debited by this call: debit the player's wallet\nyourself with `POST /customers/{id}/coins` (negative `delta`), or\nlet TPP do it through your inbound webhooks integration.\n\n**Idempotency-Key is required.** A retry with the same key and\nbody returns the original response with `Idempotent-Replay: true`\n(the order was created once). The same key with a different body\nor while the first request is still running returns 409\n`idempotency_conflict`.\n\n**Shipping window.** The response carries `shipping_url`: the hosted\naddress form (`embed=1`, ready for an iframe/modal), minted once here\nso you do not need a second call. Null when the order has no store\n(pass `store_id`) or the platform cannot sign the link — never a\nfallback to `status_url`, which is a different, read-only page.\nOrder reads omit the field; use `POST /orders/{id}/shipping-link`\nfor a fresh link, a full-page (non-embedded) one, a custom TTL,\n`parent_origin` or `single_use`.\n\n**Pricing.** Each line's `unit_price_cents` is the final price\n(TPP's commission and any brand discount included), snapshotted at\ncreation so later configuration changes never move historical\ntotals.\n\n**Billing.**\n- `prepaid_balance` brands: the brand balance is reserved\n  atomically. If it is insufficient and the brand does not allow a\n  negative balance, the order is created with\n  `billing_status='blocked_balance'` — fulfilment cannot proceed\n  until the brand tops up. Watch the field on the response.\n- `monthly_billing` brands: the order is attached to the current\n  open billing batch (created lazily for the period).\n- `pay_per_order` brands: the order is born with\n  `payment_status='pending_payment'` — fulfilment is gated until\n  the admin marks it paid in the backoffice.\n\n**Market gate.** Every listing must be available in one of the\nsub-brand's markets; otherwise 403 `forbidden`. An inactive or\nout-of-stock listing returns 409 `conflict`.\n\n**Transient-failure fallback.** A validated request that encounters\nan explicitly retryable database/infrastructure failure is durably\naccepted with HTTP 202. The response carries a\n`reservation_request_id`; poll\n`GET /api/v1/order-reservations/{id}` for completion. Validation,\nauthorization, catalog, stock, billing, and all unknown/non-retryable\nerrors remain ordinary 4xx/5xx errors and are never queued.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:create"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"redemption-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"listing_market_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUID of the listing to purchase. Take it from `variants[].listing_market_id` of `GET /products` or `GET /products/{id}` (null there means the variant cannot be ordered)."},"quantity":{"type":"integer","minimum":1,"maximum":1000,"description":"Units to purchase. Brand-level cart limit caps the total across items."},"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Customer who receives this line. MUST belong to the calling sub-brand. The customer's address snapshot fills the line's `shipping_address` and `recipient_*` fields."}},"required":["listing_market_id","quantity","customer_id"]},"description":"Line items. At least one; brand-level cart limit applies."},"store_id":{"description":"Store the order is attributed to; must belong to the calling sub-brand (404 otherwise). Pass it whenever the player should use the hosted pages: without a store the order has no `status_url` or `shipping_url`, and `POST /orders/{id}/shipping-link` answers 409 `order_has_no_store`.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"currency":{"description":"Optional ISO-4217 billing-currency echo. Must match the sub-brand's configured billing currency and have a server-configured FX rate (EUR is the base); defaults to that billing currency.","type":"string","minLength":3,"maxLength":3}},"required":["items"]}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderDetail"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"202":{"description":"Accepted for retry after an explicitly recoverable infrastructure failure.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderReservationRequest"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders/{id}":{"get":{"operationId":"getOrder","summary":"Fetch an order + its line items","description":"Returns the order header with its line items. Shipping details are also available via `GET /api/v1/orders/{id}/shipping` if you only need addresses + carrier info.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderDetail"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"cancelOrder","summary":"Cancel an order","description":"Transitions the order to `cancelled`. Only valid while the\norder is in `pending` or `processing` — later states return 409\n`conflict` with `error.field_errors.reason: [\"not_cancellable\"]`\nand `error.field_errors.current_status`. When the order's billing\ncan no longer be changed (e.g. its monthly batch is already\ninvoiced), the 409 carries `error.field_errors.billing_reason`\ninstead.\n\nCancellation atomically releases or refunds the brand's billing\nbalance and restores any storefront points the player paid for the\norder. Concurrent requests cannot apply the compensation twice.\nNo `Idempotency-Key` is needed (it is ignored): cancelling an\nalready-cancelled order is a 409, never a second refund.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:delete"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/health":{"get":{"operationId":"getHealth","summary":"Liveness probe and key sanity check","description":"Verifies the calling key authenticates, has at least the `customers:read` scope, and counts against its rate-limit bucket. Returns the environment and sub-brand id encoded in the key so clients can confirm they are talking to the right tenant/mode.","tags":["System"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:read"],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"environment":{"type":"string","enum":["live","test"]},"sub_brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"api_version":{"type":"string","const":"v1"},"server_time":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["status","environment","sub_brand_id","api_version","server_time"],"additionalProperties":false},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers":{"get":{"operationId":"listCustomers","summary":"List customers","description":"Returns the calling key's sub-brand customers in reverse\nchronological order. Pagination is cursor-based — call again with\n`?cursor=<page.next_cursor>` until `page.has_more` is false.\n\nAll filters combine with AND. Filter by status, segment, country,\ncreation/registration date windows, coin-balance range and\nlifetime order-count range — the same targeting the bulk-coins\nendpoint uses.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:read"],"parameters":[{"in":"query","name":"q","schema":{"description":"Substring match across `first_name`, `last_name`, `email`, `external_id`. Case-insensitive.","type":"string","minLength":1,"maxLength":200},"description":"Substring match across `first_name`, `last_name`, `email`, `external_id`. Case-insensitive."},{"in":"query","name":"status","schema":{"description":"Filter by moderation status.","type":"string","enum":["active","watch","restricted","banned"]},"description":"Filter by moderation status."},{"in":"query","name":"segment_id","schema":{"description":"Exact match on the casino-side segment/cohort tag.","type":"string","minLength":1,"maxLength":36},"description":"Exact match on the casino-side segment/cohort tag."},{"in":"query","name":"country","schema":{"description":"ISO-3166-1 alpha-2 country.","type":"string","minLength":2,"maxLength":2},"description":"ISO-3166-1 alpha-2 country."},{"in":"query","name":"created_after","schema":{"description":"Only customers created at/after this ISO-8601 UTC instant.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Only customers created at/after this ISO-8601 UTC instant."},{"in":"query","name":"created_before","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},{"in":"query","name":"registered_after","schema":{"description":"Only customers whose casino `platform_registered_at` is at/after this instant.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"description":"Only customers whose casino `platform_registered_at` is at/after this instant."},{"in":"query","name":"registered_before","schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},{"in":"query","name":"min_coins","schema":{"description":"Only customers whose coin balance is >= this value (0 default).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Only customers whose coin balance is >= this value (0 default)."},{"in":"query","name":"max_coins","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"in":"query","name":"min_orders","schema":{"description":"Only customers with at least this many lifetime orders.","type":"integer","minimum":0,"maximum":9007199254740991},"description":"Only customers with at least this many lifetime orders."},{"in":"query","name":"max_orders","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"description":"Default 25, max 100.","type":"integer","minimum":1,"maximum":100},"description":"Default 25, max 100."},{"in":"query","name":"cursor","schema":{"description":"Opaque cursor returned by the previous page's `page.next_cursor`. Omit on the first page.","type":"string"},"description":"Opaque cursor returned by the previous page's `page.next_cursor`. Omit on the first page."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCustomer","summary":"Create a customer","description":"Creates a customer in the calling key's sub-brand.\n\nOnly an identity is required: send `first_name` + `last_name`, or\njust `external_id` when you hold no personal data (otherwise 400\nwith `field_errors.external_id`). A customer created with only an\n`external_id` returns `first_name` / `last_name` as `null` until the\nplayer submits the hosted shipping form, which fills the empty\nnames from the recipient name. When the store copies the address\nto the customer (the default), the form also writes the address and\nfills an empty `email` / `phone`; names, email and phone you sent\nare never overwritten.\n\nIf `external_id` is already used by a customer of this sub-brand,\nreturns 409 `conflict`.\n\n**Idempotency-Key is required.** A retry with the same key and\nbody returns the original response with `Idempotent-Replay: true`;\nthe same key with a different body, or while the first request is\nstill running, returns 409 `idempotency_conflict`.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:create"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"signup-player-48213"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"description":"Caller-supplied identifier (typically your platform's player id). Unique per sub-brand — duplicates return 409 conflict. Required when `first_name` or `last_name` is omitted.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"segment_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}]},"first_name":{"description":"Given name. Optional when `external_id` is sent: the hosted shipping form fills it from the recipient name.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"last_name":{"description":"Family name. Optional when `external_id` is sent: the hosted shipping form fills it from the recipient name.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"nickname":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address_line":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"street_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"apartment":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"postal_code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"zone":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"state":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 (`es`, `ES`). Stored and returned lowercase.","anyOf":[{"type":"string","pattern":"^[A-Za-z]{2}$"},{"type":"null"}]},"preferred_lang":{"anyOf":[{"type":"string","enum":["en","es","pt","it","fr"]},{"type":"null"}]},"platform_registered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"status":{"type":"string","enum":["active","watch","restricted","banned"]}}}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{id}":{"get":{"operationId":"getCustomer","summary":"Fetch a customer by id","description":"Returns the customer if it belongs to the calling key's sub-brand.\n\n404 is intentionally returned for both unknown ids and ids in\nother sub-brands — distinguishing them would leak existence.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCustomer","summary":"Partial-update a customer","description":"Updates the fields present in the body. Omitted fields are NOT\nchanged. To unset a nullable field, send it explicitly as `null`\n(this is PATCH semantics, NOT JSON-merge-patch).\n\n`status` transitions stamp `status_changed_at` automatically.\nAny status can be set here; `restricted` / `banned` block orders,\nnot profile updates or coin adjustments (see `Customer.status`).\nAn empty body returns 400.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"segment_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}]},"first_name":{"type":"string","minLength":1,"maxLength":120},"last_name":{"type":"string","minLength":1,"maxLength":120},"nickname":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address_line":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"street_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"apartment":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"postal_code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"zone":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"locality":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"state":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"country":{"description":"ISO 3166-1 alpha-2 (`es`, `ES`). Stored and returned lowercase.","anyOf":[{"type":"string","pattern":"^[A-Za-z]{2}$"},{"type":"null"}]},"preferred_lang":{"anyOf":[{"type":"string","enum":["en","es","pt","it","fr"]},{"type":"null"}]},"platform_registered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"status":{"type":"string","enum":["active","watch","restricted","banned"]},"status_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"minProperties":1}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Customer"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteCustomer","summary":"Delete a customer","description":"Permanently deletes the customer:\n- Their orders remain; order lines lose the link to the customer.\n- Their coin wallet and its movement history are deleted.\n\nReturns `{ id, deleted: true }` on success. A repeated call returns\n404. `Idempotency-Key` is not used by this endpoint.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:delete"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/{id}/coins/movements":{"get":{"operationId":"listCustomerCoinMovements","summary":"List a customer's full coin-movement history","description":"Returns every movement for the customer's wallet in reverse\nchronological order, cursor-paginated. Movements are append-\nonly — corrections appear as NEW rows with their own `delta`\nand `balance_after`, so the running history is reconstructable\nfrom this endpoint alone.\n\n404 if the customer doesn't exist or belongs to a different\nsub-brand.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"query","name":"limit","schema":{"description":"Page size — default 25, max 100. Smaller pages are cheaper; large pages save round-trips when backfilling history.","type":"integer","minimum":1,"maximum":100},"description":"Page size — default 25, max 100. Smaller pages are cheaper; large pages save round-trips when backfilling history."},{"in":"query","name":"cursor","schema":{"description":"Opaque cursor from the previous page's `page.next_cursor`. Omit on the first page.","type":"string"},"description":"Opaque cursor from the previous page's `page.next_cursor`. Omit on the first page."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CoinMovement"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/customers/bulk/coins":{"post":{"operationId":"bulkAdjustCustomerCoins","summary":"Bulk-adjust coins over a customer segment","description":"Credits (positive `delta`) or debits (negative `delta`) the coin\nwallet of every customer matching `filter`, scoped to the calling\nkey's sub-brand.\n\nThe filter targets almost any customer attribute: `status`,\n`segment_id`, `country`, registration/creation date windows\n(`created_after`/`before`, `registered_after`/`before`), coin\nbalance range (`min_coins`/`max_coins`) and lifetime order count\n(`min_orders`/`max_orders`), plus free-text `q`.\n\n**Idempotency-Key is required.** The whole batch is one\ntransaction: it applies completely or not at all, so a retry after\na failure re-applies cleanly, and a retry after a success replays\nthe original response (`Idempotent-Replay: true`) without crediting\ntwice.\n\nConstraints:\n- A non-empty filter is required (no accidental credit-everyone).\n- A match set larger than 1000 is rejected — narrow the filter.\n- Debits that would push a wallet negative are skipped and listed\n  in `skipped`.\n- Send `dry_run: true` to preview `matched_count` + a `sample`\n  before committing.","tags":["Customers"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["customers:coins"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"campaign-2026-10-weekend-credit"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filter":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":120},"status":{"type":"string","enum":["active","watch","restricted","banned"]},"segment_id":{"type":"string","minLength":1,"maxLength":36},"country":{"type":"string","minLength":2,"maxLength":2},"created_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"created_before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"registered_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"registered_before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"min_coins":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_coins":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_orders":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_orders":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reason":{"type":"string","maxLength":500},"dry_run":{"default":false,"type":"boolean"}},"required":["filter","delta"]}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BulkCoinsResult"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores":{"get":{"operationId":"listStores","summary":"List storefronts","description":"Cursor-paginated list of storefronts belonging to the calling key's sub-brand. Filter by status or name/slug substring.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:read"],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":200}},{"in":"query","name":"status","schema":{"type":"string","enum":["draft","active","inactive"]}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Store"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createStore","summary":"Create a draft storefront","description":"Creates a `draft` store (not publicly visible) in the calling key's sub-brand: theme, languages, optional template design and catalog links in one transaction. Edit it with `PATCH /api/v1/stores/{id}/draft`, then publish. Requires `Idempotency-Key`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:create"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"createStore-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"description":"Globally unique. Omit to derive one from the name.","type":"string","minLength":3,"maxLength":50,"pattern":"^[a-z0-9-]+$"},"default_lang":{"type":"string","enum":["en","es","pt","it","fr","de"]},"languages":{"maxItems":13,"type":"array","items":{"type":"string","enum":["en","en-US","es","es-MX","es-CO","es-AR","es-CL","es-PE","pt","pt-BR","it","fr","de"]}},"payment_mode":{"description":"Default `points` (required for arcade games).","type":"string","enum":["card","points","order_only","off_price"]},"points_rate":{"description":"Points per currency unit. Default 10.","type":"integer","minimum":1,"maximum":10000},"template_id":{"type":"string","enum":["clean","luxury","atelier","noir","nocturne","bloom","pulse","streetwear","botanica","vegas","arcade","kickoff","podium","slot","partners-club"]},"catalog_ids":{"description":"Catalogs visible to this sub-brand to attach (see `list_catalogs`).","maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["name","default_lang"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Store"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}":{"get":{"operationId":"getStore","summary":"Fetch a store by id or slug","description":"The `{id}` path parameter accepts either a UUID or the store's slug.\nSlugs are globally unique so disambiguation by shape is safe.\n\nReturns 404 if the store doesn't exist OR belongs to a different sub-brand.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Store"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}/draft":{"get":{"operationId":"getStoreDraft","summary":"Get a storefront's draft design","description":"Theme and sections of the staged draft, or of the published design when no draft exists (`source`). Section `config` keys follow the section registry (see `GET /api/v1/store-capabilities`).","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateStoreDraft","summary":"Edit a storefront's draft design","description":"Applies an optional theme patch and up to 25 section operations (`add_section`, `update_section`, `remove_section`, `move_section`) to the staged draft. Configs are validated against the section registry; nothing is saved if any operation is invalid. The live storefront does not change until publish. Requires `Idempotency-Key`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"updateStoreDraft-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"theme":{"type":"object","properties":{"primary_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"secondary_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accent_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"background_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"text_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"muted_text_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"border_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"card_background_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"price_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"font_family":{"type":"string","minLength":1,"maxLength":80},"heading_font":{"type":"string","minLength":1,"maxLength":80},"border_radius":{"type":"integer","minimum":0,"maximum":32},"card_border_width":{"type":"integer","minimum":0,"maximum":4},"card_shadow":{"type":"string","enum":["none","sm","md","lg","xl"]},"button_style":{"type":"string","enum":["rounded","pill","sharp"]},"content_width":{"type":"string","enum":["boxed","full"]},"logo_url":{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`); empty clears it."}},"additionalProperties":false},"ops":{"maxItems":25,"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","const":"add_section"},"type":{"type":"string","maxLength":60},"page":{"description":"Default `home`.","type":"string","enum":["home","listing","product","cart","checkout","shipping","account","order","confirmation","access","games","broadcast","mystery-box","arcade"]},"position":{"description":"0-based position among the page's sections; default appends before the footer.","type":"integer","minimum":0,"maximum":80},"after_id":{"type":"string","maxLength":120},"visible":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Field values keyed by section registry field key (the store's default-language copy). Optional `i18n`: `{ \"<lang>\": { \"<fieldKey>\": value } }` with copy for other store languages, translatable fields only (see `GET /api/v1/store-capabilities`)."}},"required":["op","type"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"update_section"},"id":{"type":"string","maxLength":120},"visible":{"type":"boolean"},"config":{"description":"Shallow-merged into the existing config. `i18n` merges per language: a language sent replaces its overlay, `{}` removes it, omitted languages are kept.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["op","id"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"remove_section"},"id":{"type":"string","maxLength":120}},"required":["op","id"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","const":"move_section"},"id":{"type":"string","maxLength":120},"position":{"type":"integer","minimum":0,"maximum":80}},"required":["op","id","position"],"additionalProperties":false}],"type":"object"}}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"discardStoreDraft","summary":"Discard a storefront's draft design","description":"Deletes the staged draft and returns the published design. Does not change the live storefront.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}/draft/template":{"post":{"operationId":"applyStoreTemplate","summary":"Apply a template to a storefront's draft","description":"Replaces the draft's theme and sections with a template (ids from `GET /api/v1/store-capabilities`). `keep_theme: true` keeps the current colours, fonts and logo. The store logo is always kept. Requires `Idempotency-Key`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"applyStoreTemplate-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"template_id":{"type":"string","enum":["clean","luxury","atelier","noir","nocturne","bloom","pulse","streetwear","botanica","vegas","arcade","kickoff","podium","slot","partners-club"]},"keep_theme":{"description":"Keep the current colours/fonts/logo and only take the template's sections. Default false.","type":"boolean"}},"required":["template_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}/publish":{"post":{"operationId":"publishStore","summary":"Publish a storefront's draft design","description":"Copies the staged draft (or re-publishes the current design) to the live storefront and clears the draft — the editor's Publish button. `activate: true` also moves a `draft` store to `active`, making it publicly visible. Requires `Idempotency-Key`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"publishStore-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"activate":{"description":"Also move a `draft` store to `active` (publicly visible). Default false.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StorePublishResult"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}/languages":{"put":{"operationId":"setStoreLanguages","summary":"Set a storefront's languages","description":"Sets the languages the storefront offers (applied now) and its base language. Section configs hold the base language's copy and other languages in `config.i18n`; changing the base stages the change in the draft and moves each section's copy, so the live storefront switches on publish and no visitor's text changes. Requires `Idempotency-Key`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"setStoreLanguages-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"default_lang":{"type":"string","enum":["en","es","pt","it","fr","de"],"description":"Base language: section configs hold its copy. A change is staged in the draft (live after publish) and moves each section's copy so no visitor's text changes."},"languages":{"minItems":1,"maxItems":13,"type":"array","items":{"type":"string","enum":["en","en-US","es","es-MX","es-CO","es-AR","es-CL","es-PE","pt","pt-BR","it","fr","de"]},"description":"Every language the storefront offers (the language switcher). Must include `default_lang`; applied immediately."}},"required":["default_lang","languages"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreLanguages"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stores/{id}/codes/resolve":{"post":{"operationId":"resolveStoreCode","summary":"Products a promotional code applies to","description":"Resolves a store's promotional code — a shared coupon (`code`) or a single-use code (`free_code` / `assigned`) — to its public terms, its scope and one page of the store's products in that scope, priced as the storefront shows them. Call it from your backend: the API key is a server secret.\n\n`{id}` accepts the store UUID or slug; the store must belong to the key's sub-brand.\n\n- `code.scope` is always the rule's target (`store` = the whole store), whether or not the store restricts visibility by code (`code.store_filters_by_code`).\n- `code.purchasable` is `false` for a single-use code that was already redeemed (browse only).\n- `price_cents` already includes automatic promotions but NOT this code's discount, which the cart applies (and where `min_order_cents` is checked).\n\nThe code goes in the body and is never written to logs. Read-only: no `Idempotency-Key`.\n\n**Errors.** An unknown, inactive, expired, not-yet-started or disabled code, a store of another sub-brand and a code of another store all return the same `404 not_found`. Failed attempts are limited to 10 per 5 minutes per API key and store; past that every attempt returns `429 rate_limited` with `Retry-After` until the window ends. Successful resolutions do not count.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:read","products:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveStoreCodeRequest"}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreCodeResolution"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/store-capabilities":{"get":{"operationId":"getStoreCapabilities","summary":"List store templates and composable sections","description":"Templates (with their theme), section types an API caller may add (with each field's key, type, options and whether it holds media), pages, languages, payment modes and the limits enforced by `PATCH /api/v1/stores/{id}/draft`.","tags":["Stores"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["stores:read"],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreCapabilities"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/media/uploads":{"post":{"operationId":"prepareStoreMediaUpload","summary":"Prepare an image upload","description":"Signs a 10-minute upload URL bound to this sub-brand (and optional store), the MIME type, size and SHA-256 you declare. PUT the exact bytes to `upload_url` without an Authorization header, then call `POST /api/v1/media/uploads/confirm`. PNG, JPEG or WebP up to 5 MB; stored as WebP.","tags":["Media"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["media:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mime_type":{"type":"string","enum":["image/png","image/jpeg","image/webp"]},"size_bytes":{"type":"integer","minimum":1,"maximum":5242880},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 of the exact bytes you will PUT."},"store_id":{"description":"Store the image belongs to; omit for sub-brand-wide assets.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["mime_type","size_bytes","sha256"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PreparedMediaUpload"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/media/uploads/confirm":{"post":{"operationId":"confirmStoreMediaUpload","summary":"Confirm an image upload","description":"Returns the public URL and dimensions of an image uploaded through `prepareStoreMediaUpload` (same `sha256` and `store_id`). 404 when the bytes were never PUT. Idempotent: re-uploading identical bytes yields the same URL.","tags":["Media"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["media:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["sha256"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MediaAsset"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/games":{"get":{"operationId":"listGames","summary":"List arcade games","description":"Cursor-paginated arcade games of the calling key's sub-brand, newest first. Filter by `store_id`.","tags":["Games"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["games:read"],"parameters":[{"in":"query","name":"store_id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Game"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createGame","summary":"Create a demo arcade game","description":"Creates a `draft` plinko, tower, mines or deal game on a store of this sub-brand from a preset balanced to at most 90 % RTP, with your colours, logos and images. Pass `prizes` (catalogue products from `search_products`) to put physical prizes in the game: they are resolved server-side to a listing the store can award (`invalid_request` with `prizes.N.product_id` otherwise) and the coin side is rebalanced around them; omit `price_cents` to get the lowest stake they allow. Creation writes no orders or coin movements. The type's feature flag must be enabled for the sub-brand (`forbidden` otherwise). Players can stake only on `points` stores; see `warnings`. Requires `Idempotency-Key`.","tags":["Games"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["games:create"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"createGame-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["plinko","tower","mines","deal"]},"name":{"type":"string","minLength":2,"maxLength":200},"slug":{"type":"string","maxLength":80},"subtitle":{"type":"string","maxLength":300},"description":{"type":"string","maxLength":5000},"price_cents":{"description":"Stake per play. Default 200 (mines 500); with `prizes`, omit it to get the lowest stake the prizes allow at 90 % RTP. An explicit stake that cannot carry the prizes is refused with the minimum in the message.","type":"integer","minimum":100,"maximum":100000},"prizes":{"description":"Physical catalogue prizes (1–6; deal max 4), resolved server-side to a listing this store can award; value = customer price. plinko: outermost bins (12 rows, most valuable at the edges); tower: top floors; mines: hidden prize cells; deal: prize cases. Coins/multipliers are rebalanced so the published RTP stays at or below 90 %. Prizes create orders billed to the brand only when a player wins and claims.","minItems":1,"maxItems":6,"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Product (family) id from `search_products`."},"variant_id":{"description":"Specific variant; default: the cheapest available one.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["product_id"],"additionalProperties":false}},"image_url":{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},"banner_url":{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},"cover_url":{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},"branding":{"type":"object","properties":{"colors":{"type":"object","properties":{"brand":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"card_bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"tile":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"shelf":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"ball":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"peg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"bg_image_url":{"description":"Same-origin upload recommended (WebGL).","type":"string","maxLength":2000},"bg_dim":{"type":"number","minimum":0,"maximum":1},"title_logo_url":{"description":"Transparent brand title logo for the in-game header (~3:1).","type":"string","maxLength":2000},"cover_logo_url":{"description":"Square brand icon on tile/case covers (mines, tower, deal).","type":"string","maxLength":2000},"cover_logo_bg":{"description":"Fill of the chip behind the cover icon (default light).","type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false}},"required":["store_id","type","name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Game"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/games/{id}":{"get":{"operationId":"getGame","summary":"Fetch an arcade game","description":"Returns the game when it belongs to the calling key's sub-brand.","tags":["Games"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["games:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Game"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateGame","summary":"Update an arcade game's name, copy, art or branding","description":"Presentation only: `name`, `subtitle`, `description`, `image_url` (card and info-modal art), `banner_url`, `cover_url`, and `branding` (colours, stage background and dim, title/cover logos, CTA colours), merged over the current branding and validated like on create; `null` clears a field. Works on draft, active and paused games (archived games are read-only). The board, stake and prizes are not editable here. Requires `Idempotency-Key`.","tags":["Games"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["games:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"updateGame-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"subtitle":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"image_url":{"description":"Card and info-modal art (branded key art that explains the game).","anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"banner_url":{"anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"cover_url":{"anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"branding":{"description":"Look and feel only — editable even while the game is active.","type":"object","properties":{"colors":{"type":"object","properties":{"brand":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"card_bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"tile":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"shelf":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"ball":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"peg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"bg_image_url":{"description":"Stage background (see the Store Studio game-art guide).","anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"bg_dim":{"description":"plinko and deal only.","type":"number","minimum":0,"maximum":1},"title_logo_url":{"description":"Transparent brand title logo for the in-game header (~3:1).","anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"cover_logo_url":{"description":"Square brand icon on tile/case covers (mines, tower, deal).","anyOf":[{"type":"string","maxLength":2000,"description":"https or root-relative image URL (e.g. from `confirm_store_media_upload`)."},{"type":"null"}]},"cover_logo_bg":{"description":"Fill of the chip behind the cover icon (default light).","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cta_color":{"description":"Primary button gradient start (mines, plinko).","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cta_color_dark":{"description":"Primary button gradient end (mines, plinko).","type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Game"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/games/{id}/publish":{"post":{"operationId":"publishGame","summary":"Publish an arcade game","description":"Runs the same publish gate as the backoffice (RTP within target, prize listings, commit-reveal seed) and makes the game `active`. Already-active games are returned unchanged. No economic override is available through the API. Requires `Idempotency-Key`.","tags":["Games"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["games:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"publishGame-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Game"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/raffles":{"post":{"operationId":"createRaffle","summary":"Create a draft raffle","description":"Creates a `draft` raffle on a store of this sub-brand. Each prize is a catalogue product (`product_id` from `search_products`, optional `variant_id`) resolved server-side to a listing the store can award; prize value is the customer price. Nothing is sold or drawn until `publishRaffle`. Raffles must be enabled for the sub-brand. Requires `Idempotency-Key`.","tags":["Raffles"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["raffles:create"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"createRaffle-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":2,"maxLength":200},"slug":{"type":"string","maxLength":80},"subtitle":{"type":"string","maxLength":300},"description":{"type":"string","maxLength":5000},"ticket_price_cents":{"type":"integer","minimum":0,"maximum":1000000},"total_tickets":{"type":"integer","minimum":1,"maximum":100000},"min_tickets":{"type":"integer","minimum":0,"maximum":100000},"max_tickets_per_customer":{"type":"integer","minimum":0,"maximum":100000},"sales_open_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"sales_close_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"draw_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"image_url":{"type":"string","maxLength":2000},"banner_url":{"type":"string","maxLength":2000},"about_image_url":{"type":"string","maxLength":2000},"legal_terms":{"type":"string","maxLength":20000},"prizes":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Product (family) id from `search_products`."},"variant_id":{"description":"Specific variant; default: the cheapest available one.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string","minLength":1,"maxLength":200},"quantity":{"type":"integer","minimum":1,"maximum":1000}},"required":["product_id"],"additionalProperties":false}}},"required":["store_id","name","ticket_price_cents","total_tickets","sales_close_at","draw_at","prizes"],"additionalProperties":false}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RaffleDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/raffles/{id}":{"patch":{"operationId":"updateRaffle","summary":"Update a raffle's name, copy or art","description":"Presentation only: `name`, `subtitle`, `description`, `image_url`, `banner_url` (landing hero background), `about_image_url`; `null` clears a field. Allowed while the raffle is `draft` or `scheduled`, also after tickets are sold. Ticket price, quantities, dates and prizes are not editable here. Requires `Idempotency-Key`.","tags":["Raffles"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["raffles:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"updateRaffle-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":200},"subtitle":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"banner_url":{"description":"Landing hero background (full-bleed, under a dark overlay).","anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"about_image_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RaffleDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/raffles/{id}/publish":{"post":{"operationId":"publishRaffle","summary":"Publish a draft raffle","description":"Runs the backoffice publish gate (prizes within capacity, every prize awardable by the store, draw after sales close), seals the commit-reveal seed and moves the raffle to `scheduled`. Tickets go on sale and the draw runs automatically at `draw_at`; a claimed prize becomes an order billed to the brand. Already-scheduled raffles are returned unchanged. Requires `Idempotency-Key`.","tags":["Raffles"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["raffles:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"publishRaffle-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RaffleDraft"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/catalogs":{"get":{"operationId":"listCatalogs","summary":"List catalogs visible to the sub-brand","description":"Returns catalogs the calling sub-brand can use:\n1. Catalogs owned exclusively by this sub-brand (`scope: \"sub_brand\"`).\n2. Brand-level catalogs the sub-brand has ACCEPTED (`scope: \"brand\"`).\n\nPending or rejected brand-level catalogs are filtered out — clients\nsee them as if they didn't exist.","tags":["Catalogs"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["catalogs:read"],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Catalog"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/catalogs/{id}":{"get":{"operationId":"getCatalog","summary":"Fetch a catalog by id","description":"Returns the catalog if it is visible to the calling sub-brand (own or accepted brand-level). 404 otherwise — pending/rejected brand-level catalogs return 404 to prevent enumeration.","tags":["Catalogs"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["catalogs:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Catalog"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/categories":{"get":{"operationId":"listCategories","summary":"List product categories","description":"Returns the global canonical category list. The default is `active`; pass `status=inactive` to inspect disabled categories.","tags":["Categories"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["categories:read"],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["active","inactive"]}}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/brands/{brandId}/sub-brands/{subBrandId}":{"get":{"operationId":"getBrandSubBrand","summary":"Get brand and sub-brand metadata","description":"Returns the calling API key's sub-brand together with its parent brand. Both path ids must match the key scope.","tags":["Brands"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["brands:read"],"parameters":[{"in":"path","name":"brandId","schema":{"type":"string","minLength":1,"description":"Path parameter `brandId`."},"required":true,"description":"Path parameter `brandId`."},{"in":"path","name":"subBrandId","schema":{"type":"string","minLength":1,"description":"Path parameter `subBrandId`."},"required":true,"description":"Path parameter `subBrandId`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BrandSubBrand"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products":{"get":{"operationId":"searchProducts","summary":"Search products visible to the sub-brand","description":"Returns product families reachable via any catalog the sub-brand owns\nor has accepted. Product ids are UUIDv7 values (`GET /products/{id}`\nalso accepts the id a product had on the previous TPP platform).\n\nEach product includes `price_cents` / `currency` / `price_country`:\nthe final price (TPP's commission included) resolved from active\nlistings in the sub-brand's markets. The raw provider cost is never\nexposed.\n\nEach product also lists its `variants`; every variant carries the\n`listing_market_id` to send to `POST /orders` and that listing's final price\n(null when the variant cannot be ordered). Products reachable only\nthrough a disabled catalog are not returned.\n\nCustom products follow the same active-family, active-catalog and\nmarket gates. A brand-level custom product is visible to every\nsub-brand of its owning brand; a sub-brand-owned custom product is\nvisible only to that sub-brand. A sibling or foreign sub-brand sees\nnothing, even when it knows the product id. A valid default provider\nnever hides custom products the calling sub-brand owns.\n\nWith `updated_since` the list becomes an incremental sync, ordered by\nchange time, and `page.sync` carries the value for the next sync.","tags":["Products"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["products:read"],"parameters":[{"in":"query","name":"q","schema":{"description":"Substring match across `name` and `slug` (case-insensitive).","type":"string","minLength":1,"maxLength":200},"description":"Substring match across `name` and `slug` (case-insensitive)."},{"in":"query","name":"category_id","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"in":"query","name":"catalog_id","schema":{"description":"Restrict the search to a specific catalog. The catalog must already be visible to the calling sub-brand.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Restrict the search to a specific catalog. The catalog must already be visible to the calling sub-brand."},{"in":"query","name":"updated_since","schema":{"description":"Incremental sync: return only products whose representation may have changed at or after this ISO-8601 instant, oldest change first. Start with a full listing; then pass `page.sync.next_updated_since` from the previous sync (read every page first). A product can be returned again without a visible change. When pricing or catalog settings changed in between, `page.sync.full_sync` is `true` and every visible product is returned. Products that stopped being visible are not reported: reconcile them with `GET /product-ids`. Stock-only changes are not reported yet either (a product selling out, coming back in stock, or switching to another in-stock listing); `GET /product-ids` shows the first two, a full listing all three. Send the same value with each `cursor`.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Incremental sync: return only products whose representation may have changed at or after this ISO-8601 instant, oldest change first. Start with a full listing; then pass `page.sync.next_updated_since` from the previous sync (read every page first). A product can be returned again without a visible change. When pricing or catalog settings changed in between, `page.sync.full_sync` is `true` and every visible product is returned. Products that stopped being visible are not reported: reconcile them with `GET /product-ids`. Stock-only changes are not reported yet either (a product selling out, coming back in stock, or switching to another in-stock listing); `GET /product-ids` shows the first two, a full listing all three. Send the same value with each `cursor`."},{"in":"query","name":"limit","schema":{"description":"Page size, 1–100. Default 25.","type":"integer","minimum":1,"maximum":100},"description":"Page size, 1–100. Default 25."},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{id}":{"get":{"operationId":"getProduct","summary":"Fetch a product family + its variants","description":"Returns the product family with its variants array. The path accepts\neither the UUIDv7 or the id the product had on the previous TPP platform.\n404 when the product is not visible to the calling sub-brand.\n\nThe top-level product fields include the final price\n(`price_cents`, `currency`, `price_country`); the raw provider cost\nis never exposed. Each variant carries `listing_market_id` — the id to\nsend to `POST /orders` — plus that listing's own `price_cents`,\n`currency` and `price_country`; all four are null when the variant\nhas no orderable listing for the calling sub-brand.\n\nOnly `active` products are returned; any other status, or a\nmalformed id, is a 404. Brand-level custom products are visible to\nevery sub-brand of their owning brand; sub-brand-owned custom products\nare visible only to their owner. A sibling or foreign sub-brand gets\nthe same 404 even when it knows the id.","tags":["Products"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["products:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProductDetail"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/product-ids":{"get":{"operationId":"listProductIds","summary":"List the ids of every product visible to the sub-brand","description":"Ids of all products `GET /products` would return, ascending, without\nprices or variants. Like the list, only products you can order now are\nincluded (at least one in-stock listing). An incremental sync\n(`GET /products?updated_since=`) does not report products that stopped\nbeing visible, nor stock-only changes; delete local products whose id is\nmissing from this list, and fetch ids that appear in it but not locally\n(a product back in stock).","tags":["Products"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["products:read"],"parameters":[{"in":"query","name":"catalog_id","schema":{"description":"Restrict to a specific catalog visible to the calling sub-brand.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Restrict to a specific catalog visible to the calling sub-brand."},{"in":"query","name":"limit","schema":{"description":"Page size, 1–1000. Default 500.","type":"integer","minimum":1,"maximum":1000},"description":"Page size, 1–1000. Default 500."},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductId"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders/{id}/shipping":{"get":{"operationId":"getOrderShipping","summary":"Fetch per-item shipping details for an order","description":"Returns one entry per line item with the recipient + carrier\nfields, without the financial / billing fields. Convenient for\nlabel-printing flows and courier polling.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemShipping"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateOrderShipping","summary":"Add or update an order's delivery details","description":"Set the delivery details for an order. Two modes:\n\n**Grouped** — send `shipping_address` (+ optional recipient\nfields) at the top level and the SAME address is written to\nevery line item. The order's `shipping_mode` becomes `grouped`.\n\n```json\n{ \"shipping_address\": \"Calle Mayor 1\\n28013 Madrid\\nES\",\n  \"recipient_name\": \"Ana Pérez\" }\n```\n\n**Split** — send an `items` array, one entry per line item\n(addressed independently by `item_id`). The order's\n`shipping_mode` becomes `split`. Every `item_id` must belong\nto the order.\n\n```json\n{ \"items\": [\n  { \"item_id\": \"01933b1c-2100-7000-8000-000000000061\",\n    \"shipping_address\": \"Calle Mayor 1\\n28013 Madrid\\nES\", \"recipient_name\": \"Ana Pérez\" },\n  { \"item_id\": \"01933b1c-2100-7000-8000-000000000062\",\n    \"shipping_address\": \"Carrer de Balmes 20\\n08007 Barcelona\\nES\", \"recipient_name\": \"Luis García\" }\n] }\n```\n\n**Delivery requirements** — each line carries `fulfillment_type`\nand `delivery_requirements` (see `GET /orders/{id}/shipping` or the\n`POST /orders` response). A `digital` line (gift card, code) is\ncomplete with just `recipient_email`:\n\n```json\n{ \"recipient_email\": \"ana@example.com\" }\n```\n\nStructured fields (`address_line1`, `address_line2`, `city`, `state`,\n`postal_code`, `country`) may replace the free-text\n`shipping_address`; the server builds the block from them.\nWhen the sub-brand has saved delivery requirements, every targeted\nline is validated against its map: a missing `required` field\nreturns **422 `validation_failed`** with the fields in\n`field_errors` (prefixed `items[<index>].` in split mode), and\n`hidden` fields are ignored. Without saved requirements the\nvalidation is unchanged.\n\nOnly recipient, address and notes fields are touched — carrier and\ntracking stay fulfilment-side. Rejected with 409 `conflict` once\nthe order is `completed` or `cancelled`. `Idempotency-Key` is\nignored (the update is a plain overwrite). Returns the full per-item\nshipping projection after the update.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"shipping_address":{"description":"Free-form recipient address block (multiline allowed). Optional when the structured `address_line1`… fields are sent (the server then builds this block itself) or when every targeted line is `digital`. Without a sub-brand delivery config, a `physical` line still needs an address. With a free-text address only `recipient_name`, `recipient_email`, `recipient_phone` and the block being non-empty can be checked against `delivery_requirements`.","type":"string","minLength":1,"maxLength":2000},"recipient_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"recipient_email":{"anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"recipient_phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address_line1":{"description":"Street and number. Sending any structured address field replaces the whole address: absent components are cleared and `shipping_address` is rebuilt from them.","anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"address_line2":{"description":"Flat, floor, unit.","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"city":{"description":"City / town.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"state":{"description":"Province / state / region.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"postal_code":{"description":"Postal code.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"country":{"description":"ISO-3166-1 alpha-2 country code, e.g. `ES`.","anyOf":[{"type":"string","pattern":"^[A-Za-z]{2}$"},{"type":"null"}]},"delivery_notes":{"description":"Delivery notes from the player (max 500 chars).","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Line item this address applies to (must belong to the order)."}},"required":["item_id"]},"description":"One entry per line item — addresses sent independently."}},"required":["items"],"description":"Split — a distinct address per line item."},{"type":"object","properties":{"shipping_address":{"description":"Free-form recipient address block (multiline allowed). Optional when the structured `address_line1`… fields are sent (the server then builds this block itself) or when every targeted line is `digital`. Without a sub-brand delivery config, a `physical` line still needs an address. With a free-text address only `recipient_name`, `recipient_email`, `recipient_phone` and the block being non-empty can be checked against `delivery_requirements`.","type":"string","minLength":1,"maxLength":2000},"recipient_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"recipient_email":{"anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"recipient_phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address_line1":{"description":"Street and number. Sending any structured address field replaces the whole address: absent components are cleared and `shipping_address` is rebuilt from them.","anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"address_line2":{"description":"Flat, floor, unit.","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"city":{"description":"City / town.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"state":{"description":"Province / state / region.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"postal_code":{"description":"Postal code.","anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"country":{"description":"ISO-3166-1 alpha-2 country code, e.g. `ES`.","anyOf":[{"type":"string","pattern":"^[A-Za-z]{2}$"},{"type":"null"}]},"delivery_notes":{"description":"Delivery notes from the player (max 500 chars).","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"description":"Grouped — one address applied to every line item of the order."}]}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemShipping"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders/{id}/shipping-link":{"post":{"operationId":"createOrderShippingLink","summary":"Mint a hosted shipping-address window URL for an order","description":"Returns a signed, expiring URL the brand opens in an **iframe modal**\n(default, `embed=1`) or as a **full store page** (`embed: false`) so the\nplayer can fill in the delivery address. Capturing the address never\nchanges the order `status`; read the derived `address_state` instead.\n\nScope `orders:update`. `Idempotency-Key` is ignored: each call mints a\nfresh token. Re-issuing does not invalidate previous links.\n\nThe window is themed by a store: the order's own (`store_id` on\n`POST /orders`) or the `store_id` you pass here. With neither, the\ncall returns 409 `conflict` with `error.field_errors.reason:\n[\"order_has_no_store\"]`. Other 409 reasons: `order_closed` (order\n`completed` / `cancelled`), `multi_recipient_order` (lines for more\nthan one customer), `store_not_active`.\n\n### What the form collects\n\nThe recipient name and the address (street, postal code, city,\ncountry) are always asked. By default the form also shows **email**\n(required), **phone** (optional), street number, apartment and\nstate/province (optional); an ID **document** field is hidden. Each\nstore sets which fields are shown and required in the store editor\n(shipping page section).\n\nOn submit the address is saved on every line of the order. The\nrecipient name also fills the customer's `first_name` / `last_name`\nwhen they are empty. When the store's \"copy to customer\" option is\non (the default), the address is copied to the customer record and\nan empty customer `email` / `phone` is filled from the form. Values\nalready on the customer other than the address are never overwritten.\n\n### 1. Mint the link\n\n```bash\ncurl -X POST \\\n  -H \"Authorization: Bearer tpp_live_<KEY>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ \"ttl_seconds\": 86400, \"parent_origin\": \"https://www.yourcasino.com\" }' \\\n  https://api.thepowerplugin.com/api/v1/orders/{id}/shipping-link\n```\n\nPass `parent_origin` (your page's https origin): the window then posts\nits `postMessage` events **only** to that origin, and the API rejects\nit up front if the store's `frame_ancestors` would block the embed.\n\n### 2. Embed it in a modal\n\n```html\n<iframe id=\"tpp-shipping\"\n  src=\"{data.url}\"\n  title=\"Delivery address\"\n  style=\"width:100%;max-width:640px;height:560px;border:0;display:block\"\n  referrerpolicy=\"strict-origin-when-cross-origin\"\n></iframe>\n```\n\nThe window is responsive: give the iframe the full width of your modal\n(phones included) and let the height follow `VIEW_SIZE_UPDATE`.\n\n### 3. Listen to the window\n\n```js\nconst frame = document.getElementById(\"tpp-shipping\")\nconst TPP_ORIGIN = new URL(frame.src).origin\n\nwindow.addEventListener(\"message\", (event) => {\n  // Always validate BOTH the origin and the source frame.\n  if (event.origin !== TPP_ORIGIN) return\n  if (event.source !== frame.contentWindow) return\n  const { type, payload } = event.data ?? {}\n  switch (type) {\n    case \"SHIPPING_VIEW_READY\":\n      // payload.mode: \"form\" | \"locked\" | \"expired\" | \"invalid\"\n      if (payload.mode === \"expired\") remintAndReload()\n      break\n    case \"VIEW_SIZE_UPDATE\":\n      frame.style.height = `${payload.height}px`\n      break\n    case \"SHIPPING_ADDRESS_SUBMITTED\":\n      // { orderId, addressState: \"captured\", country } — never the address itself\n      markOrderAddressed(payload.orderId)\n      closeModal()\n      break\n    case \"SHIPPING_CLOSE_REQUESTED\":\n      closeModal()\n      break\n    case \"SHIPPING_VIEW_ERROR\":\n      // payload.code: \"locked\" | \"consumed\" | \"invalid\" | \"validation\"\n      if (payload.code !== \"validation\") closeModal()\n      break\n  }\n})\n```\n\nPayloads carry no PII. The address itself arrives server-side through\nthe `order.shipping_updated` webhook (`data.source: \"shipping_window\"`)\nor `GET /orders/{id}/shipping`.\n\n### 4. Full page instead of a modal\n\nMint with `{ \"embed\": false }` and redirect the player to `data.url`\n(or open it in a new tab): the form renders as a normal store page with\nthe shared header and footer. Works as an email / push deep link too.\n\n### States and re-issuing\n\n| `address_state` / mode | Meaning | What to do |\n|---|---|---|\n| `missing` | at least one line has no address | show the window |\n| `captured` | address saved, order still editable | optional — the window opens prefilled |\n| `locked` | a line shipped, or order completed/cancelled | nothing to capture; the window shows a read-only notice |\n| `expired` (window) | token past `expires_at` | mint a new link — old links are never revoked, they just expire |\n| `consumed` (window) | `single_use` link already used | mint a new link if the player must edit again |\n\nStores with an access mode other than `free` let this window through\ntheir gate **only** with a valid token — nothing else in the store opens.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:update"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ttl_seconds":{"description":"Link lifetime in seconds. Default 604800 (7 days).","type":"integer","minimum":300,"maximum":2592000},"parent_origin":{"description":"https origin of the page that embeds the iframe. Used as postMessage targetOrigin and checked against the store's frame_ancestors.","type":"string","maxLength":255,"format":"uri"},"store_id":{"description":"Store that themes the window. Required only when the order has no store_id. Must belong to the calling sub-brand.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"single_use":{"description":"If true, the link stops working after the first successful submit.","type":"boolean"},"embed":{"description":"If true (default), `url` carries embed=1 (no store chrome).","type":"boolean"}},"example":{"ttl_seconds":86400,"parent_origin":"https://www.yourcasino.com","single_use":false,"embed":true}}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ShippingLink"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders/{id}/buyback":{"get":{"operationId":"getOrderBuyback","summary":"Get the buyback offer for an order","description":"What the paying customer would receive for selling this order back\nfor points, or why they can't. Eligible while the order is `pending`\nor `processing`, no item has shipped, it was paid from a single TPP\nwallet and the brand has buyback on (brand rate, e.g. 9000 bps = 90%).\n\nShow `points_offered` to the customer and collect their acceptance of\nthe buyback terms before calling `POST`.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderBuybackQuote"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"buybackOrder","summary":"Sell an unshipped order back for points","description":"Cancels the order and credits the paying customer's wallet with the\nbrand's buyback share of the points they paid, atomically (the\nbrand's billing balance and the `order.status_changed` webhook\nsettle as for a cancel).\n\nBoth expected_points and expected_rate_bps from the accepted GET quote are required. A changed offer requires fresh customer consent.\n**Idempotency-Key is required.** The same key replays the original\nbody unchanged with `Idempotent-Replay: true`. Calling with a new key\nafter buyback returns `replayed: true`; neither replay moves points.\n\nNot eligible → 409 `conflict` with `error.field_errors.reason[0]` (same values\nas `GET /orders/{id}/buyback`). Scope: `orders:delete`.\nFor stale consent: `{\"error\":{\"code\":\"conflict\",\"message\":\"Order is not eligible for buyback\",\"field_errors\":{\"reason\":[\"offer_changed\"]},\"request_id\":\"req_6f1c2a9e0b7d4c3fa8e5d2b1c0a9f8e7\"}}`.\nA billing settlement conflict puts its code in `error.field_errors.billing_reason[0]`.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:delete"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."},{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"buyback-redemption-7f3c2a91"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_points":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647,"description":"Points offered by the quote the customer accepted; a changed offer returns 409 conflict with error.field_errors.reason: [offer_changed]."},"expected_rate_bps":{"type":"integer","minimum":1,"maximum":10000,"description":"Rate in the accepted quote; a changed rate returns 409 conflict with error.field_errors.reason: [offer_changed]."},"terms_accepted":{"type":"boolean","const":true,"description":"Attests the customer saw the offer and accepted the buyback terms in your UI (the order is cancelled and will not ship; the credit is final)."}},"required":["expected_points","expected_rate_bps","terms_accepted"]}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderBuybackResult"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/order-reservations/{id}":{"get":{"operationId":"getOrderReservationRequest","summary":"Get an asynchronous order reservation","description":"Returns the durable status of a reservation accepted with HTTP 202\nby `POST /api/v1/orders`. The id is scoped to the calling key's\nsub-brand. When status becomes `completed`, use `order_id` with\n`GET /api/v1/orders/{id}`. `failed` is terminal and includes a\nsafe failure code/message.","tags":["Orders"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["orders:read"],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"description":"Path parameter `id`."},"required":true,"description":"Path parameter `id`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OrderReservationRequest"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/store-sessions":{"post":{"operationId":"createStoreSession","summary":"Create a storefront hand-off (SSO)","description":"Mints a short-lived, signed hand-off URL that logs the given CRM\nuser into the storefront. Resolve order: `external_id` then\n`email`, scoped to the calling key's sub-brand. Unknown users are\ncreated just-in-time (names and email are used only then).\n\nRedirect the player to `url` or use it as an iframe `src`. The link\nworks once, until `expires_at` (`ttl_seconds`, 60–900, default\n300): the first open signs the player in for 8 hours; opening it\nagain lands on the store without signing in. Mint a new URL for\nevery hand-off. `Idempotency-Key` is ignored — each call mints a\nfresh token.\n\nReturns 404 when `store_id` does not belong to the sub-brand.","tags":["Store sessions"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["store_sessions:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Storefront to hand the user off to. Must belong to the calling key's sub-brand."},"external_id":{"type":"string","minLength":1,"maxLength":120,"description":"The CRM's identifier for the user, matched against the customer's `external_id` within the sub-brand; the customer is created just-in-time if unknown."},"first_name":{"description":"Used only when JIT-creating the customer.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"last_name":{"description":"Used only when JIT-creating the customer.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"description":"Fallback lookup key + used when JIT-creating.","anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"ttl_seconds":{"description":"Hand-off URL lifetime in seconds, 60–900; default 300. A value outside the range is a 400 (not clamped).","type":"integer","minimum":60,"maximum":900}},"required":["store_id","external_id"]}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StoreSession"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/embed-sessions":{"post":{"operationId":"createEmbedSession","summary":"Create a standalone-games hand-off","description":"Mints a short-lived, single-use hand-off token that logs the given\nplayer into the sub-brand's standalone (embed) games. Resolve order:\n`external_id` then `email`, scoped to the calling key's sub-brand.\nUnknown players are created just-in-time (names and email are used\nonly then).\n\nCall it from your backend, never from the browser. Your page loads\nthe TPP loader (`https://app.thepowerplugin.com/embed/v1/loader.js`,\n`TPPGames.init({ subBrand, getSessionToken })`); `getSessionToken`\nasks your backend for a token and the loader delivers it to the\ngame iframe — there is no URL to open. The token is single use and\nvalid until `expires_at` (`ttl_seconds`, 60–900, default 300); the\nexchange signs the player in to the games for 8 hours. Mint a fresh\ntoken per request. `Idempotency-Key` is ignored.\n\nReturns 404 when embedded games are not enabled for the sub-brand.","tags":["Embed sessions"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["embed_sessions:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":120,"description":"The operator's identifier for the player, matched against the customer's `external_id` within the sub-brand; the customer is created just-in-time if unknown."},"first_name":{"description":"Used only when JIT-creating the customer.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"last_name":{"description":"Used only when JIT-creating the customer.","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"email":{"description":"Fallback lookup key + used when JIT-creating.","anyOf":[{"type":"string","maxLength":255,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"ttl_seconds":{"description":"Hand-off token lifetime in seconds, 60–900; default 300. A value outside the range is a 400 (not clamped).","type":"integer","minimum":60,"maximum":900}},"required":["external_id"]}}}},"responses":{"201":{"description":"Created","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmbedSession"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/engine/events":{"post":{"operationId":"ingestEngineEvent","summary":"Deliver an event to the Engine","description":"Executes the event definition identified by `event_code` for the\nplayer referenced in `data`: the payload key named by the\ndefinition's `player_id_field` (see `GET /engine/definitions`;\ndefault payload key `externalUserId`) is matched against the\ncustomer's `external_id` within your sub-brand.\n`occurred_at` may carry the RFC 3339 business event time; it defaults\nto ingestion time and is accepted only from 24 hours in the past to 5\nminutes in the future. It is used by bounded event-time consumers such\nas leaderboards. It never controls audit ordering, retention, rate\nlimits, billing, or Engine active-window evaluation.\n\nA delivery that passes pre-flight always returns **200 with an\n`EngineEventResult`** — check `status`, don't assume `completed`:\n- `completed` — the points were applied to the wallet.\n- `skipped` — rules declined, nothing applied. `error_code`:\n  `outside_active_window`; `max_daily_reached` (per-player daily\n  cap); `cooldown_active` (per-player minimum interval);\n  `budget_limit_reached` (a budget cap; see `limit_context`);\n  `budget_misconfigured`; `invalid_amount` / `calculated_points_below_minimum`\n  (runtime points calculation from the payload); `invalid_constraints`\n  (the definition's rules are misconfigured — ask TPP).\n- `failed` — recorded but not applied. `error_code`:\n  `player_id_missing`, `player_not_found`, `insufficient_balance`,\n  `balance_overflow`, `invalid_points` (the definition's points are\n  misconfigured), or `internal_error` (transient, see below).\n\n**Idempotency-Key header is REQUIRED** (this endpoint moves money).\nThe same value is also the business idempotency key, so a\nredelivery through the webhook channel with the same id can never\ndouble-credit. A retry with the SAME key and body is normally\nanswered by the HTTP idempotency layer: the original response body\nverbatim (so `replayed` reads `false`) plus the\n`Idempotent-Replay: true` response header — key off the header.\n`replayed: true` in the body marks a business-layer replay (e.g.\nthe same id already arrived via webhook). Same key + a DIFFERENT\nbody, or a retry while the first is still running → 409\n`idempotency_conflict`.\n\nRetry semantics: a `failed` with `error_code: internal_error`\nreturns **500** and IS retryable with the same key; business\n`failed`/`skipped` are terminal and replay their frozen verdict.\n\n`points_override` (a non-zero integer) is accepted only when the\ndefinition's `override_mode` is `external_bounded`, the key holds\nthe `engine:overrides` scope, and the value lies within the\ndefinition's `min_points`/`max_points`. A key with only\n`engine:events` keeps working for events that use default points.\n\nPre-flight rejections (error envelope, nothing executed; the\nreason is in `error.message`):\n- 400 `invalid_request` — `points_override` not allowed (definition\n  forbids it, or the key lacks `engine:overrides`) or out of bounds;\n  payload too large; `occurred_at` outside its accepted window; a\n  wallet-moving event without a stable event id.\n- 403 `forbidden` — the Engine is not enabled for this brand.\n- 404 `not_found` — unknown `event_code`.\n- 409 `conflict` — the definition is not `active`; it is `internal`\n  (cannot be delivered through the API); deliveries are paused by a\n  budget policy; or a delivery with the same key is still being\n  processed (retry shortly).\n\nEvery delivery — completed, skipped, failed, replay, rejection —\nlands in the immutable Engine audit trail.","tags":["Engine"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["engine:events"],"parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","minLength":1,"maxLength":64,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key.","example":"deposit-evt-901244"},"required":true,"description":"Required. Your own opaque id for this operation (printable ASCII, max 64 chars), e.g. the id of the redemption or bonus in your system. A retry with the same key and body within 24h returns the first successful (2xx) response again, with `Idempotent-Replay: true`. The same key with a different body or on another endpoint → 409 `idempotency_conflict`; a duplicate sent while the first is still running → 409 `idempotency_conflict` (retry shortly). Errors are not stored, so a failed call can be retried with the same key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event_code":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,79}$","description":"Code of the event definition to execute (unique per sub-brand)."},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The event payload, stored verbatim on the execution and audit records. The player is resolved from the payload key named by the definition's `player_id_field` (default payload key `externalUserId`), matched against the customer's `external_id`."},"occurred_at":{"description":"Optional RFC 3339 business occurrence time. Defaults to server ingestion time and must be no more than 24 hours old or 5 minutes in the future. Used by event-time consumers such as leaderboards; it never controls audit ordering, retention, rate limits, billing, or the Engine definition's own active-window evaluation.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"points_override":{"description":"Optional per-event points value: a signed non-zero integer, |points| <= 1,000,000, within the definition's `min_points` / `max_points`. Accepted only when the definition's `override_mode` is `external_bounded` AND the API key holds the `engine:overrides` scope; otherwise the delivery is rejected 400 `invalid_request` before anything is executed.","type":["number","null"]},"correlation_id":{"description":"Optional caller tracing id (echoed back). Generated when absent.","anyOf":[{"type":"string","maxLength":64},{"type":"null"}]}},"required":["event_code","data"]}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"idempotent-replay":{"schema":{"type":"string","const":"true"},"description":"Present with value `true` only when the response replays a prior request."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EngineEventResult"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `idempotency_conflict` (key reused with another request, or still in progress) or `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/engine/definitions":{"get":{"operationId":"listEngineDefinitions","summary":"List the sub-brand's Engine event definitions","description":"Read-only catalogue of the event definitions the operator configured\nfor the calling key's sub-brand: the `code` to send as `event_code`,\nwho may deliver it (`kind`), the payload fields carrying the player\n(`player_id_field`) and the idempotency id (`idempotency_key_field`),\nthe points envelope and the per-player constraints.\n\nImport this before wiring emitters — never invent an event code.\nAnswers `403` when the Engine is not enabled for the brand, the same\nsignal a delivery would get. Definitions are authored in the TPP\nbackoffice; ask TPP for a missing one.","tags":["Engine"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["engine:read"],"parameters":[{"in":"query","name":"status","schema":{"description":"Default `active` (the only status that executes). `all` lists draft and disabled too.","type":"string","enum":["active","disabled","draft","all"]},"description":"Default `active` (the only status that executes). `all` lists draft and disabled too."},{"in":"query","name":"kind","schema":{"description":"Filter by who may deliver the event. Integrators usually want `external`.","type":"string","enum":["internal","external"]},"description":"Filter by who may deliver the event. Integrators usually want `external`."}],"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EngineDefinition"}},"page":{"$ref":"#/components/schemas/Page"}},"required":["data","page"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/engine/webhooks/{code}":{"post":{"operationId":"ingestEngineWebhook","summary":"Deliver an event to the Engine via webhook","description":"Webhook-style ingestion: POST the provider payload verbatim; the\nevent definition code travels in the path. Runs the exact same\npipeline as `POST /engine/events` (same ledger, same audit trail,\nsame velocity caps).\n\nRedeliveries dedupe on the payload key named by the definition's\n`idempotency_key_field` (see `GET /engine/definitions`; when null,\nthe payload's `event_id`, then `id`)\n— a stable provider id is strongly recommended. Ids longer than\n64 chars are hashed deterministically, so dedup always holds.\n\n**FAIL-CLOSED anti-replay:** a wallet-moving delivery with NO\nusable id (no matching payload key AND no `Idempotency-Key`\nheader) is **rejected 400 `invalid_request`** rather than executed —\nwithout a key an attacker could replay the same body to farm\npoints. Always send a stable event id.\n\nResponds 200 with an `EngineEventResult` for every delivery that\npasses pre-flight — check `status` (`completed` / `skipped` /\n`failed`, same `error_code` values as `POST /engine/events`), don't\nassume `completed`. `replayed: true` marks a redelivery answered\nwith the FROZEN first result. The same pre-flight rejections as\n`/engine/events` apply (400 / 403 / 404 / 409; 500 for a transient\n`internal_error` — retry with the same id).","tags":["Engine"],"security":[{"BearerApiKey":[]}],"x-required-scopes":["engine:events"],"parameters":[{"in":"path","name":"code","schema":{"type":"string","minLength":1,"description":"Path parameter `code`."},"required":true,"description":"Path parameter `code`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The provider's webhook payload, stored verbatim as the event payload. Redeliveries dedupe on the payload key named by the definition's `idempotency_key_field` (when null: `event_id`, then `id`); over-long ids are hashed. A wallet-moving delivery that carries NO usable id and no `Idempotency-Key` header is rejected 400 `invalid_request` (fail-closed anti-replay) — always include a stable event id."}}}},"responses":{"200":{"description":"OK","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EngineEventResult"},"page":{"$ref":"#/components/schemas/Page"}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid request body or parameters","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, malformed, or revoked API key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key lacks the required scope or allowlist gate","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found or not visible to this key","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict — `conflict` (state or uniqueness; see `field_errors`)","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."},"x-ratelimit-limit":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Per-minute request cap for this key's tier."},"x-ratelimit-remaining":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Remaining requests in the current 60-second window."},"x-ratelimit-reset":{"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix timestamp (seconds) when the current window resets."},"retry-after":{"schema":{"type":"string","pattern":"^[1-9][0-9]*$"},"description":"Seconds until the current rate-limit window resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error — check `request_id` and contact support","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Echo of the per-request id (`req_<32 hex>`)."},"x-tpp-api-version":{"schema":{"type":"string","const":"v1"},"description":"Public API major version for this response."},"cache-control":{"schema":{"type":"string","const":"no-store"},"description":"Prevents intermediaries from caching tenant-specific API responses."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ResolveStoreCodeRequest":{"type":"object","properties":{"code":{"type":"string","minLength":3,"maxLength":32,"pattern":"^[A-Za-z0-9_-]+$","description":"The promotional code exactly as the customer received it: a shared coupon (`SUMMER20`) or a single-use code (`7K3M-9QXP-R4TW`). Trimmed and upper-cased before lookup."},"cursor":{"description":"`page.next_cursor` of the previous response, verbatim. Omit for the first page.","type":"string","minLength":1,"maxLength":512},"limit":{"description":"Products per page, 1–100. Default 50.","type":"integer","minimum":1,"maximum":100},"lang":{"description":"Language for product descriptions (`es`, `es-CO`). A language the store does not offer falls back like the storefront does (regional → base → store default).","type":"string","pattern":"^[a-z]{2}(-[A-Z]{2})?$"}},"required":["code"],"example":{"code":"SUMMER20","limit":50}},"CoinWallet":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"balance":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Current balance. `0` is returned when the wallet row has never been touched (no movements ever)."},"recent_movements":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/CoinMovement"},"description":"Up to the 10 most recent movements, newest first."}},"required":["customer_id","balance","recent_movements"],"additionalProperties":false,"example":{"customer_id":"01933b1c-1f00-7000-8000-000000000001","balance":500,"recent_movements":[{"id":"01933b1c-2300-7000-8000-000000000090","delta":500,"balance_after":500,"reason":"Signup bonus","created_at":"2026-05-27T18:00:00.000Z"}]}},"CoinMovement":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Movement id — the same value as `movement_id` in the adjustment response."},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed adjustment that was applied. Positive = credit, negative = debit."},"balance_after":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Snapshot of the balance immediately after this movement landed."},"reason":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","delta","balance_after","created_at"],"additionalProperties":false,"example":{"id":"01933b1c-2300-7000-8000-000000000090","delta":500,"balance_after":500,"reason":"Signup bonus","created_at":"2026-05-27T18:00:00.000Z"}},"Page":{"type":"object","properties":{"next_cursor":{"description":"Opaque cursor for the next page, or `null` when on the last page.","type":["string","null"]},"has_more":{"type":"boolean","description":"Whether there is at least one more page."},"total":{"description":"Total row count — only present on endpoints that opt into the extra query.","type":"integer","minimum":0,"maximum":9007199254740991},"sync":{"description":"Only on `GET /products?updated_since=`.","type":"object","properties":{"next_updated_since":{"type":"string","description":"Pass as `updated_since` on the next sync, once every page of this one is read. Slightly behind the server clock on purpose."},"full_sync":{"type":"boolean","description":"`true` when settings that affect many products (pricing rules, markets, catalog access) changed since `updated_since`: this sync returns every visible product."}},"required":["next_updated_since","full_sync"],"additionalProperties":false}},"required":["next_cursor","has_more"],"additionalProperties":false,"description":"Pagination envelope. `next_cursor` is `null` on the last page; clients can use it as the sentinel."},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthenticated","wrong_environment","forbidden","not_found","invalid_request","idempotency_conflict","conflict","rate_limited","internal_error","validation_failed"],"description":"Canonical error code — part of the public contract."},"message":{"type":"string","description":"Human-readable description of the error."},"field_errors":{"description":"Per-field messages keyed by dotted path. On `invalid_request` they are validation messages; on `conflict` they carry machine-readable refusal codes — `reason` (e.g. `insufficient_balance`, `order_has_no_store`, `multi_recipient_order`, `store_not_active`, `not_cancellable`), `current_status`, `billing_reason` — documented per operation.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"request_id":{"type":"string","description":"Per-request id (also echoed in the `X-Request-Id` response header)."}},"required":["code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Returned for any non-2xx response."},"CoinAdjustment":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Customer whose wallet was adjusted."},"movement_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique id of the movement row created by this adjustment. Useful for cross-referencing in audit / support flows."},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed adjustment that was applied. Positive = credit (`+`), negative = debit (`-`). Always non-zero."},"balance_before":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Wallet balance BEFORE the adjustment landed. `0` for the very first adjustment on a new customer."},"balance_after":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Wallet balance AFTER the adjustment landed — the balance subsequent `GET /customers/{id}/coins` reads return."},"reason":{"description":"Free-text reason (max 500 chars) supplied by the caller. Shown verbatim in the customer's movement history in the backoffice.","type":["string","null"]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the movement was persisted."}},"required":["customer_id","movement_id","delta","balance_before","balance_after","created_at"],"additionalProperties":false,"description":"Result of a single coin adjustment. A replay with the same Idempotency-Key returns THIS exact response (the balance from the original execution), NOT a fresh read.","example":{"customer_id":"01933b1c-1f00-7000-8000-000000000001","movement_id":"01933b1c-2300-7000-8000-000000000090","delta":500,"balance_before":0,"balance_after":500,"reason":"Signup bonus","created_at":"2026-05-27T18:00:00.000Z"}},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique order identifier (UUIDv7, time-sortable)."},"store_id":{"description":"Store the order was attributed to. May be null for orders created outside any store (e.g. operator-initiated).","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","shipped","completed","failed","cancelled"],"description":"Fulfilment lifecycle. `pending` (just created) → `processing` (operator picked up) → `shipped` (in transit) → `completed` (delivered + closed). Terminal failure states: `failed`, `cancelled`. Cancellation is only valid while `pending` or `processing`."},"total_amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total cost to the brand, in minor units of `currency`. e.g. 1500 + currency 'EUR' = €15.00. Includes margins and discount snapshots from creation time — historical totals never move when config changes."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO-4217 code snapshotted at order creation. The order's `total_amount_cents` is denominated in this currency."},"shipping_mode":{"type":"string","enum":["grouped","split"],"description":"`grouped` = single shipping address applies to the whole order; items can have quantity > 1. `split` = each unit ships independently (items with quantity > 1 are expanded into N rows of qty 1, each addressable separately)."},"payment_status":{"type":"string","enum":["not_required","pending_payment","paid","failed","refunded","cancelled"],"description":"Per-order payment state. `not_required` for prepaid_balance and monthly_billing models; `pending_payment` → `paid` (or `failed`/`refunded`) for pay_per_order brands. Fulfilment is gated until `not_required` or `paid`."},"billing_status":{"type":"string","enum":["unbilled","in_batch","invoiced","paid","not_applicable","blocked_balance"],"description":"Lifecycle from the billing layer's POV. Orthogonal to `status`. `blocked_balance` = prepaid order created but balance was insufficient — operator must top up before fulfilment can proceed. `not_applicable` = the order's billing model doesn't track this field."},"paid_at":{"description":"ISO-8601 UTC timestamp when the order was marked paid. Null until payment lands (pay-per-order) or when the billing model doesn't track payment per-order.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the order was reserved."},"status_url":{"description":"Absolute, ready-to-use link to the customer-facing order-status page, already carrying the signed `status_token`. Send it to the shopper (email / CRM) — it opens WITHOUT a session and reveals only this order. Orders with a store link `/s/<store_slug>/order/<id>`; orders without a store link the store-less page `/o/<id>` (same page, tenant branding). Null when the order references a store that no longer resolves, or when the platform cannot build the absolute link (then build it yourself from `status_token`).","anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"status_token":{"description":"Signed, permanent (no expiry) per-order access token. Append it as `?t=<token>` to the order-status path — `/s/<store_slug>/order/<id>`, or `/o/<id>` for an order without a store — to build a link that opens without a session. Prefer `status_url` when present. Null when the platform cannot sign it, or when the order references a store that no longer resolves.","type":["string","null"]},"shipping_url":{"description":"Absolute link to the hosted shipping window (the delivery-address form, `embed=1` so it can be opened in an iframe/modal), already carrying its own signed token. **Returned only by `POST /orders`**; order reads omit the field rather than minting a token per row. Null when the order has no store (pass `store_id` on `POST /orders`) or the platform cannot sign the link — never a fallback to `status_url`, which is a different (read-only) page. To obtain a link later, or one that is full-page, single-use or with a custom TTL, call `POST /orders/{id}/shipping-link`, which also describes the fields the form collects.","anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"address_state":{"description":"Derived shipping-address state. `missing` = at least one line lacks recipient + address; `captured` = every line has an address and the order is still editable; `locked` = a line is shipped/delivered or the order is completed/cancelled. Capturing an address never changes `status`.","type":"string","enum":["missing","captured","locked"]}},"required":["id","status","total_amount_cents","currency","shipping_mode","payment_status","billing_status","created_at"],"additionalProperties":false,"example":{"id":"01933b1c-2000-7000-8000-000000000050","store_id":"01933b1c-1f00-7000-8000-000000000010","status":"pending","total_amount_cents":14999,"currency":"EUR","shipping_mode":"grouped","payment_status":"not_required","billing_status":"in_batch","paid_at":null,"created_at":"2026-05-27T18:00:00.000Z","status_url":"https://app.thepowerplugin.com/s/acme/order/01933b1c-2000-7000-8000-000000000050?t=eyJ2IjoxfQ.SIGNATURE","status_token":"eyJ2IjoxfQ.SIGNATURE","shipping_url":"https://app.thepowerplugin.com/s/acme/order/01933b1c-2000-7000-8000-000000000050/shipping?t=eyJ2IjoyfQ.SIGNATURE&embed=1"}},"OrderDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique order identifier (UUIDv7, time-sortable)."},"store_id":{"description":"Store the order was attributed to. May be null for orders created outside any store (e.g. operator-initiated).","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","shipped","completed","failed","cancelled"],"description":"Fulfilment lifecycle. `pending` (just created) → `processing` (operator picked up) → `shipped` (in transit) → `completed` (delivered + closed). Terminal failure states: `failed`, `cancelled`. Cancellation is only valid while `pending` or `processing`."},"total_amount_cents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total cost to the brand, in minor units of `currency`. e.g. 1500 + currency 'EUR' = €15.00. Includes margins and discount snapshots from creation time — historical totals never move when config changes."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"ISO-4217 code snapshotted at order creation. The order's `total_amount_cents` is denominated in this currency."},"shipping_mode":{"type":"string","enum":["grouped","split"],"description":"`grouped` = single shipping address applies to the whole order; items can have quantity > 1. `split` = each unit ships independently (items with quantity > 1 are expanded into N rows of qty 1, each addressable separately)."},"payment_status":{"type":"string","enum":["not_required","pending_payment","paid","failed","refunded","cancelled"],"description":"Per-order payment state. `not_required` for prepaid_balance and monthly_billing models; `pending_payment` → `paid` (or `failed`/`refunded`) for pay_per_order brands. Fulfilment is gated until `not_required` or `paid`."},"billing_status":{"type":"string","enum":["unbilled","in_batch","invoiced","paid","not_applicable","blocked_balance"],"description":"Lifecycle from the billing layer's POV. Orthogonal to `status`. `blocked_balance` = prepaid order created but balance was insufficient — operator must top up before fulfilment can proceed. `not_applicable` = the order's billing model doesn't track this field."},"paid_at":{"description":"ISO-8601 UTC timestamp when the order was marked paid. Null until payment lands (pay-per-order) or when the billing model doesn't track payment per-order.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the order was reserved."},"status_url":{"description":"Absolute, ready-to-use link to the customer-facing order-status page, already carrying the signed `status_token`. Send it to the shopper (email / CRM) — it opens WITHOUT a session and reveals only this order. Orders with a store link `/s/<store_slug>/order/<id>`; orders without a store link the store-less page `/o/<id>` (same page, tenant branding). Null when the order references a store that no longer resolves, or when the platform cannot build the absolute link (then build it yourself from `status_token`).","anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"status_token":{"description":"Signed, permanent (no expiry) per-order access token. Append it as `?t=<token>` to the order-status path — `/s/<store_slug>/order/<id>`, or `/o/<id>` for an order without a store — to build a link that opens without a session. Prefer `status_url` when present. Null when the platform cannot sign it, or when the order references a store that no longer resolves.","type":["string","null"]},"shipping_url":{"description":"Absolute link to the hosted shipping window (the delivery-address form, `embed=1` so it can be opened in an iframe/modal), already carrying its own signed token. **Returned only by `POST /orders`**; order reads omit the field rather than minting a token per row. Null when the order has no store (pass `store_id` on `POST /orders`) or the platform cannot sign the link — never a fallback to `status_url`, which is a different (read-only) page. To obtain a link later, or one that is full-page, single-use or with a custom TTL, call `POST /orders/{id}/shipping-link`, which also describes the fields the form collects.","anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"address_state":{"description":"Derived shipping-address state. `missing` = at least one line lacks recipient + address; `captured` = every line has an address and the order is still editable; `locked` = a line is shipped/delivered or the order is completed/cancelled. Capturing an address never changes `status`.","type":"string","enum":["missing","captured","locked"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}}},"required":["id","status","total_amount_cents","currency","shipping_mode","payment_status","billing_status","created_at","items"],"additionalProperties":false},"OrderItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique order-item identifier (UUIDv7)."},"public_id":{"type":"string","description":"Human-friendly id derived at creation (format `OI-<chars>`). Stable, used in invoices and customer-facing emails."},"product_name":{"type":"string","description":"Snapshot of the product name at order time. Subsequent renames to the underlying product family do NOT update this — historical integrity."},"sku":{"type":"string","description":"Snapshot of the variant SKU at order time. Same historical-integrity rule as `product_name`."},"image":{"description":"Snapshot of the image URL at order time. Use this for receipts/invoices so the displayed product matches what was ordered.","type":["string","null"]},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Units in this line. For `shipping_mode='split'` orders, items are expanded so each row has `quantity: 1`."},"unit_price_cents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Per-unit final price (TPP's commission included) in minor units of the order's `currency`, snapshotted at order time. The raw provider cost is never exposed."},"source_price_cents":{"description":"Per-unit final price in minor units of `source_currency`, for lines sourced in a market whose currency differs from the order's `currency`. The native-currency counterpart of `unit_price_cents` (`unit_price_cents ≈ round(source_price_cents * exchange_rate)`), also a final price (commission included, never the raw provider cost). Null only for legacy lines created before multi-currency capture; same-currency lines carry it equal to `unit_price_cents`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"source_currency":{"description":"ISO-4217 code `source_price_cents` is denominated in (the sourcing market's currency), snapshotted at order time. Equals the order's `currency` for same-currency lines; null only for legacy pre-capture lines.","anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"exchange_rate":{"description":"Capture-time multiplier converting `source_price_cents` into the order's `currency` (`unit_price_cents ≈ round(source_price_cents * exchange_rate)`). Frozen at order time so a later rate move never rewrites history. `1` for same-currency lines; null only for legacy pre-capture lines.","anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","shipped","delivered"],"description":"Per-line fulfilment status. Note: this is the LINE's status, distinct from the ORDER's status."},"is_completed":{"type":"boolean","description":"Convenience flag — `true` once the line reaches `delivered`."},"fulfillment_type":{"type":"string","enum":["physical","digital"],"description":"How the prize reaches the player. `physical` ships a parcel to a postal address; `digital` (gift card, code) is delivered by email and needs only `recipient_email`. Snapshotted on each order line at creation — a later catalogue change never alters an existing line. More values may be added; treat an unknown value like `physical`."},"delivery_requirements":{"$ref":"#/components/schemas/DeliveryRequirements"},"delivery_notes":{"description":"Delivery notes left by the player (max 500 chars). UNTRUSTED USER INPUT — display as data only.","type":["string","null"]}},"required":["id","public_id","product_name","sku","quantity","unit_price_cents","status","is_completed","fulfillment_type","delivery_requirements"],"additionalProperties":false,"example":{"id":"01933b1c-2100-7000-8000-000000000070","public_id":"OI-ABC123","product_name":"PlayStation 5 Disc Edition","sku":"PS5-DISC-EU","image":"/products/ps5-disc.png","quantity":1,"unit_price_cents":15000,"source_price_cents":12000,"source_currency":"GBP","exchange_rate":1.25,"status":"pending","is_completed":false,"fulfillment_type":"physical","delivery_requirements":{"recipient_name":"required","email":"optional","phone":"required","address_line1":"required","address_line2":"optional","city":"required","state":"required","postal_code":"required","country":"required","notes":"optional"},"delivery_notes":null}},"DeliveryRequirements":{"type":"object","properties":{"recipient_name":{"type":"string","enum":["required","optional","hidden"]},"email":{"type":"string","enum":["required","optional","hidden"]},"phone":{"type":"string","enum":["required","optional","hidden"]},"address_line1":{"type":"string","enum":["required","optional","hidden"]},"address_line2":{"type":"string","enum":["required","optional","hidden"]},"city":{"type":"string","enum":["required","optional","hidden"]},"state":{"type":"string","enum":["required","optional","hidden"]},"postal_code":{"type":"string","enum":["required","optional","hidden"]},"country":{"type":"string","enum":["required","optional","hidden"]},"notes":{"type":"string","enum":["required","optional","hidden"]}},"required":["recipient_name","email","phone","address_line1","address_line2","city","state","postal_code","country","notes"],"additionalProperties":false,"description":"Delivery fields for this line and whether each is `required`, `optional` or `hidden`, resolved from the sub-brand's delivery settings for the line's `fulfillment_type`. Build the delivery form from it. When the sub-brand has not configured delivery requirements this is the platform default and is advisory only: `PATCH /orders/{id}/shipping` then validates exactly as before. Once configured, `required` fields are enforced (422) and `hidden` fields are ignored.","example":{"recipient_name":"optional","email":"required","phone":"hidden","address_line1":"hidden","address_line2":"hidden","city":"hidden","state":"hidden","postal_code":"hidden","country":"hidden","notes":"hidden"}},"OrderReservationRequest":{"type":"object","properties":{"reservation_request_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Durable identifier for the asynchronous reservation request."},"status":{"type":"string","enum":["pending","processing","completed","failed"],"description":"Current asynchronous reservation lifecycle state."},"order_id":{"description":"Created order id. Null until the reservation completes.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Creation attempts already started, including the synchronous attempt."},"next_attempt_at":{"description":"Next scheduled retry time. Null outside the pending state.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"failure":{"description":"Terminal failure after processing. Null while retrying or completed.","anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field_errors":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["reservation_request_id","status","attempts","created_at","updated_at"],"additionalProperties":false,"example":{"reservation_request_id":"01933b1c-2000-7000-8000-000000000099","status":"pending","order_id":null,"attempts":1,"next_attempt_at":"2026-07-27T14:00:01.000Z","failure":null,"created_at":"2026-07-27T14:00:00.000Z","updated_at":"2026-07-27T14:00:00.000Z"}},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7 — stable, time-sortable identifier."},"external_id":{"description":"Caller-supplied identifier (typically the casino platform's user id). Unique per sub-brand.","type":["string","null"]},"segment_id":{"description":"Free-text segmentation tag (max 36 chars). Set by the brand operator for analytics.","type":["string","null"]},"first_name":{"description":"Given name, max 120 chars. Null when the customer was created with only an `external_id`; filled from the recipient name the first time the player submits the hosted shipping form.","type":["string","null"]},"last_name":{"description":"Family name, max 120 chars. Null when the customer was created with only an `external_id`; filled from the recipient name the first time the player submits the hosted shipping form.","type":["string","null"]},"nickname":{"description":"Public alias / handle on the casino platform. Not unique.","type":["string","null"]},"email":{"description":"Customer email. Optional and NOT unique within a sub-brand (use `external_id` as the stable handle).","anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"description":"Free-form phone string. Optional, max 40 chars.","type":["string","null"]},"address_line":{"description":"Street name. The most granular component of the hierarchical address. Pair with `street_number`; historical rows may carry the number inline here instead.","type":["string","null"]},"street_number":{"description":"House / building number, kept separate from `address_line` so it can be validated and required independently — several fulfilment providers reject an address without one.","type":["string","null"]},"apartment":{"description":"Flat, unit or suite. A position WITHIN a building, which is why it is not part of `zone` — that is a geographic subdivision.","type":["string","null"]},"postal_code":{"description":"ZIP / CP. Optional, max 40 chars.","type":["string","null"]},"zone":{"description":"Neighbourhood / district — the most granular subdivision.","type":["string","null"]},"locality":{"description":"Town / village. Sits between zone and city.","type":["string","null"]},"city":{"description":"Municipality or principal city.","type":["string","null"]},"state":{"description":"State, province or first-level administrative area.","type":["string","null"]},"country":{"description":"ISO 3166-1 alpha-2, lowercase (`es`). Input is accepted in either case.","anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"preferred_lang":{"description":"Preferred transactional-email language.","anyOf":[{"type":"string","enum":["en","es","pt","it","fr"]},{"type":"null"}]},"status":{"type":"string","enum":["active","watch","restricted","banned"],"description":"Moderation status. `active` is the default; `watch` only flags the customer for review. `restricted` and `banned` block purchases: `POST /orders` with such a customer returns 403 `forbidden`, and they cannot buy in the storefront; `banned` also cannot sign in to a password-protected storefront. Neither blocks coin adjustments, profile updates (`PATCH`) or store / embed sessions."},"status_note":{"description":"Free-text rationale attached to the current moderation status. Visible to operators in the backoffice — surface it to your support team but NOT directly to end consumers.","type":["string","null"]},"status_changed_at":{"description":"ISO-8601 UTC timestamp of the last status change. Null when the customer has been in their initial status since creation.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"platform_registered_at":{"description":"When the end-consumer registered on the casino platform — NOT when the TPP row was created. Null when the CRM doesn't supply it.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the customer row was created in TPP. NOT the casino-platform registration date (see `platform_registered_at`)."},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp of the most recent profile / status change."}},"required":["id","first_name","last_name","status","created_at","updated_at"],"additionalProperties":false,"description":"An end-consumer of a sub-brand's storefront. The same person can exist as separate Customer rows under different sub-brands (they're independent tenants).","example":{"id":"01933b1c-1f00-7000-8000-000000000001","external_id":"casino-user-42","segment_id":"vip","first_name":"Ana","last_name":"Pérez","nickname":"anita_p","email":"ana.perez@example.com","phone":"+34600111222","address_line":"Calle Mayor","postal_code":"28013","street_number":"12","apartment":"3º A","zone":"Centro","locality":"Madrid","city":"Madrid","state":"Madrid","country":"es","preferred_lang":"es","status":"active","status_note":null,"status_changed_at":null,"platform_registered_at":"2026-01-15T10:00:00.000Z","created_at":"2026-05-01T09:30:00.000Z","updated_at":"2026-05-20T11:45:00.000Z"}},"BulkCoinsResult":{"type":"object","properties":{"dry_run":{"type":"boolean","description":"True when this was a preview — no balances were changed."},"matched_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Customers matched by the filter, scoped to the sub-brand."},"affected_count":{"description":"Customers actually credited/debited. Null/absent on a dry run.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"skipped":{"type":"array","items":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","description":"Why this customer was skipped, e.g. `insufficient_balance`."},"balance_before":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["customer_id","reason","balance_before"],"additionalProperties":false},"description":"Customers skipped without applying the delta (e.g. a debit that would go negative). Empty for credits."},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed adjustment applied to each matched customer."},"reason":{"type":["string","null"]},"sample":{"description":"On a dry run, up to 10 matched customers as a preview.","anyOf":[{"maxItems":10,"type":"array","items":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":["string","null"]}},"required":["customer_id"],"additionalProperties":false}},{"type":"null"}]}},"required":["dry_run","matched_count","skipped","delta"],"additionalProperties":false,"description":"Outcome of a bulk coin adjustment over a customer filter. Idempotent: a replay with the same Idempotency-Key returns this exact response.","example":{"dry_run":false,"matched_count":214,"affected_count":214,"skipped":[],"delta":1000,"reason":"Loyalty campaign — registered before June 2026"}},"Store":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique store identifier (UUIDv7, time-sortable)."},"name":{"type":"string","description":"Display name shown in the backoffice and as the storefront's header."},"slug":{"type":"string","description":"URL slug — **globally unique** across all stores (not just within this sub-brand). The public storefront lives at `/s/<slug>`."},"status":{"type":"string","enum":["draft","active","inactive"],"description":"Lifecycle. Only `active` stores are visible to public storefront visitors."},"default_lang":{"type":"string","minLength":2,"maxLength":10,"description":"Default storefront language: ISO 639-1 (`es`) or language-region (`es-CO`, `pt-BR`). Regional codes since 1.x; treat unknown regions as their base language."},"payment_mode":{"type":"string","enum":["card","points","order_only","off_price"],"description":"How customers pay through this store. `card` = checkout via card, `points` = redeem points only, `order_only` = manual / off-platform fulfilment, `off_price` = simplified storefront with hidden prices and no payment step (behaves like `order_only` for fulfilment)."},"points_rate":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Points per one unit of the store's currency (e.g. €1). The storefront shows a price as `round(price_cents / 100 × points_rate)` points, and a points checkout debits `ceil(total_cents / 100 × points_rate)` (at least 1 for a priced order). Example: `points_rate: 10`, a 14.99 € order → `ceil(1499 / 100 × 10)` = 150 points."},"integration_type":{"type":"string","enum":["marketplace","api","captainup","smartico"],"description":"Which backend powers the store. `marketplace` is the built-in TPP storefront."},"allow_testing_providers":{"type":"boolean","description":"When true, this store ALSO surfaces products from providers in `testing` lifecycle (not just `live`). Useful for QA sub-brands; defaults to `false` in production stores."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the store was created."},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp of the most recent change."}},"required":["id","name","slug","status","default_lang","payment_mode","points_rate","integration_type","allow_testing_providers","created_at","updated_at"],"additionalProperties":false,"description":"A storefront under a sub-brand. Stores are not creatable via API in v1 (no write scope yet).","example":{"id":"01933b1c-1f00-7000-8000-000000000010","name":"Acme Rewards ES","slug":"acme-rewards-es","status":"active","default_lang":"es","payment_mode":"card","points_rate":10,"integration_type":"marketplace","allow_testing_providers":false,"created_at":"2026-04-01T10:00:00.000Z","updated_at":"2026-05-15T11:30:00.000Z"}},"StoreDraft":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"source":{"type":"string","enum":["draft","live"],"description":"`draft` when a staged design exists, else the published one."},"updated_at":{"description":"When the draft was last saved; null for `live`.","type":["string","null"]},"name":{"type":"string"},"default_lang":{"type":"string"},"theme":{"$ref":"#/components/schemas/StoreTheme"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/StoreSection"}}},"required":["store_id","source","updated_at","name","default_lang","theme","sections"],"additionalProperties":false},"StoreTheme":{"type":"object","properties":{"primary_color":{"type":"string"},"secondary_color":{"type":"string"},"accent_color":{"type":"string"},"background_color":{"type":"string"},"text_color":{"type":"string"},"muted_text_color":{"type":"string"},"border_color":{"type":"string"},"card_background_color":{"type":"string"},"price_color":{"type":"string"},"font_family":{"type":"string","description":"Google Fonts family for body text."},"heading_font":{"type":"string","description":"Google Fonts family for headings."},"border_radius":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"card_border_width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"card_shadow":{"type":"string","enum":["none","sm","md","lg","xl"]},"button_style":{"type":"string","enum":["rounded","pill","sharp"]},"content_width":{"type":"string","enum":["boxed","full"]},"logo_url":{"type":"string"},"template_id":{"type":"string"}},"required":["primary_color","secondary_color","accent_color","background_color","text_color","muted_text_color","border_color","card_background_color","price_color","font_family","heading_font","border_radius","card_border_width","card_shadow","button_style","content_width","logo_url","template_id"],"additionalProperties":false},"StoreSection":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"page":{"type":"string"},"visible":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Section registry field values (keys verbatim), in the store's default language; `i18n` holds the per-language overlays."}},"required":["id","type","page","visible","config"],"additionalProperties":false},"StorePublishResult":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","inactive"]},"storefront_path":{"type":"string"}},"required":["store_id","slug","status","storefront_path"],"additionalProperties":false},"StoreLanguages":{"type":"object","properties":{"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"default_lang":{"type":"string","description":"Base language of the draft (the live one after `publish_store`)."},"live_default_lang":{"type":"string","description":"Base language the live storefront uses right now."},"languages":{"type":"array","items":{"type":"string"}},"sections_moved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sections whose copy moved to the new base language."}},"required":["store_id","default_lang","live_default_lang","languages","sections_moved"],"additionalProperties":false},"StoreCodeResolution":{"type":"object","properties":{"code":{"type":"object","properties":{"rule":{"type":"object","properties":{"name":{"type":"string","description":"Promotion rule display name."},"mode":{"type":"string","enum":["code","free_code","assigned"],"description":"`code` = shared coupon (reusable); `free_code` = single-use code that makes the matching items free; `assigned` = single-use code bound to one customer with a configurable discount."},"discount_type":{"type":"string","enum":["percent","fixed_amount","fixed_price"],"description":"How `discount_value` applies to each matching item."},"discount_value":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`percent`: basis points (2000 = 20 %). `fixed_amount`: minor units of the store currency subtracted. `fixed_price`: target price in minor units of the store currency (0 = free). In a `points` store, currency amounts convert to points with the store's `points_rate`, like `price_cents`."},"min_order_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Minimum cart subtotal for the code to apply. Validated at checkout, not here."},"starts_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Rule start (ISO-8601 UTC), or null."},"ends_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"Rule end (ISO-8601 UTC), or null."}},"required":["name","mode","discount_type","discount_value","min_order_cents","starts_at","ends_at"],"additionalProperties":false},"scope":{"type":"object","properties":{"type":{"type":"string","enum":["store","catalog","category","family","variant"]},"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["type","id"],"additionalProperties":false,"description":"What the code applies to: the rule's target. `store` (id null) = the whole store (order-wide rule). Always the rule's target, whether or not the store restricts visibility by code."},"store_filters_by_code":{"type":"boolean","description":"True when the storefront shows a visitor who entered with this code only the products in `scope` (store setting \"Show only the products this code unlocks\")."},"purchasable":{"type":"boolean","description":"False when a single-use code was already redeemed: it still opens the store (browse) but cannot drive another order."}},"required":["rule","scope","store_filters_by_code","purchasable"],"additionalProperties":false},"products":{"type":"array","items":{"$ref":"#/components/schemas/StoreCodeProduct"},"description":"One page of the store's products inside `scope` — what the code applies to — as an anonymous visitor sees them: active store catalogs, the store's market, and its visibility rules."}},"required":["code","products"],"additionalProperties":false,"example":{"code":{"rule":{"name":"Summer 20%","mode":"code","discount_type":"percent","discount_value":2000,"min_order_cents":null,"starts_at":null,"ends_at":"2026-09-01T00:00:00.000Z"},"scope":{"type":"catalog","id":"01933b1c-1f00-7000-8000-000000000040"},"store_filters_by_code":true,"purchasable":true},"products":[{"id":"01933b1c-1f00-7000-8000-000000000050","name":"Wireless Earbuds","description":null,"image":"https://cdn.example.com/earbuds.png","image_clean":null,"category_id":"01933b1c-1f00-7000-8000-000000000060","category_name":"Audio","catalog_ids":["01933b1c-1f00-7000-8000-000000000040"],"variant_count":2,"price_cents":4999,"currency":"EUR","original_price_cents":null,"discount_percent":null}]}},"StoreCodeProduct":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Product (family) id — the same id `GET /products/{id}` takes."},"name":{"type":"string","description":"Product display name."},"description":{"description":"Description in the resolved language (fallback chain applied), or null.","type":["string","null"]},"image":{"description":"Primary product image URL.","type":["string","null"]},"image_clean":{"description":"Background-removed image URL, when processed.","type":["string","null"]},"category_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Owning category id."},"category_name":{"type":"string","description":"Owning category name."},"catalog_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Store catalogs (active ones only) that contain this product."},"variant_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of variants available in the store."},"price_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Storefront customer price in minor units of `currency`, already including any AUTOMATIC promotion. Always a currency amount, also in a `points` store: the storefront displays it as `round(price_cents / 100 × points_rate)` points, with `points_rate` from `GET /stores/{id}`. The code's own discount is NOT applied here (see `code.rule`); it is applied in the cart/checkout, which also checks `min_order_cents`. Null when the store is `off_price` (prices hidden)."},"currency":{"description":"ISO-4217 currency of `price_cents`. Null when `price_cents` is null.","type":["string","null"]},"original_price_cents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Price before an automatic promotion, when one is active; otherwise null."},"discount_percent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Whole-number percentage of the active automatic promotion, or null."}},"required":["id","name","description","image","image_clean","category_id","category_name","catalog_ids","variant_count","price_cents","currency","original_price_cents","discount_percent"],"additionalProperties":false},"StoreCapabilities":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"theme":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"home_sections":{"type":"array","items":{"type":"string"}}},"required":["id","name","category","description","theme","home_sections"],"additionalProperties":false}},"section_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"media":{"type":"boolean"},"group":{"type":"string"},"translatable":{"description":"True when the field may also be set per language under `config.i18n.<lang>` (see `section_translations`).","type":"boolean"},"item_example":{"description":"One default item for item-array fields (features, faqItems, slides…): copy its keys.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","type"],"additionalProperties":false}}},"required":["type","label","category","description","fields"],"additionalProperties":false}},"pages":{"type":"array","items":{"type":"string"}},"default_languages":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"payment_modes":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"max_ops":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_sections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_string":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_array_items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_body_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_draft_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Serialized size cap of the whole draft; a PATCH or template that would exceed it is rejected with invalid_request."}},"required":["max_ops","max_sections","max_string","max_array_items","max_body_bytes","max_draft_bytes"],"additionalProperties":false},"section_translations":{"type":"object","properties":{"config_key":{"type":"string","const":"i18n","description":"Reserved section config key holding per-language copy."},"note":{"type":"string"}},"required":["config_key","note"],"additionalProperties":false,"description":"Per-language section copy (added in 1.23.0)."},"fonts":{"type":"object","properties":{"source":{"type":"string","const":"google_fonts"},"note":{"type":"string"}},"required":["source","note"],"additionalProperties":false}},"required":["templates","section_types","pages","default_languages","languages","payment_modes","limits","section_translations","fonts"],"additionalProperties":false},"PreparedMediaUpload":{"type":"object","properties":{"upload_url":{"type":"string","description":"PUT the raw bytes here (no Authorization header). Do not persist: it is a short-lived credential."},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","properties":{"content-type":{"type":"string"}},"required":["content-type"],"additionalProperties":false},"expires_at":{"type":"string"},"max_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["upload_url","method","headers","expires_at","max_bytes"],"additionalProperties":false},"MediaAsset":{"type":"object","properties":{"url":{"type":"string","description":"Public URL to use in themes, sections, games and raffles."},"sha256":{"type":"string"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"content_type":{"type":"string","const":"image/webp"}},"required":["url","sha256","width","height","bytes","content_type"],"additionalProperties":false},"Game":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"store_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"type":{"type":"string","enum":["plinko","tower","mines","deal"]},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"price_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Stake per play in cents; debited as coins on `points` stores."},"currency":{"type":"string"},"target_rtp_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"image_url":{"type":["string","null"]},"banner_url":{"type":["string","null"]},"cover_url":{"type":["string","null"]},"storefront_path":{"description":"Public landing path when the game belongs to a store.","type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"},"description":"Non-blocking notes, e.g. a store whose payment mode cannot take coin stakes."},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","store_id","type","name","slug","status","price_cents","currency","target_rtp_bps","image_url","banner_url","cover_url","storefront_path","warnings","created_at","updated_at"],"additionalProperties":false},"RaffleDraft":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sales_closed","drawing","drawn","cancelled","archived"]},"ticket_price_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_tickets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sales_close_at":{"type":"string"},"draw_at":{"type":"string"},"image_url":{"type":["string","null"]},"banner_url":{"type":["string","null"]},"about_image_url":{"type":["string","null"]},"prizes":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"product_name":{"type":["string","null"]},"image_url":{"type":["string","null"]},"value_cents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["position","title","quantity","product_name","image_url","value_cents"],"additionalProperties":false}},"storefront_path":{"type":"string"}},"required":["id","store_id","name","slug","status","ticket_price_cents","total_tickets","min_tickets","sales_close_at","draw_at","image_url","banner_url","about_image_url","prizes","storefront_path"],"additionalProperties":false},"Catalog":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique catalog identifier (UUIDv7, time-sortable)."},"name":{"type":"string","description":"Operator-set display name."},"description":{"description":"Free-text description. Surfaced in the backoffice catalog picker; may be null for legacy rows.","type":["string","null"]},"scope":{"type":"string","enum":["brand","sub_brand"],"description":"`brand` = catalog owned by the brand and accepted by this sub-brand (visible because the sub-brand accepted it). `sub_brand` = catalog owned exclusively by this sub-brand (no acceptance flow needed)."},"brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Brand that owns the catalog. For sub-brand-scoped catalogs this is the parent brand of the calling sub-brand."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"ISO-8601 UTC timestamp when the catalog was created."}},"required":["id","name","scope","brand_id","created_at"],"additionalProperties":false,"example":{"id":"01933b1c-1f00-7000-8000-000000000020","name":"Premium Q2 2026","description":"VIP rewards curated quarterly","scope":"sub_brand","brand_id":"01933b1c-1f00-7000-8000-000000000900","created_at":"2026-04-01T10:00:00.000Z"}},"Category":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Canonical category UUIDv7."},"name":{"type":"string","description":"Canonical category display name."},"slug":{"type":"string","description":"Stable URL-safe category slug."},"icon":{"description":"Optional Lucide icon name configured by an operator.","type":["string","null"]},"status":{"type":"string","enum":["active","inactive"],"description":"Whether products in this category may be surfaced."}},"required":["id","name","slug","icon","status"],"additionalProperties":false,"example":{"id":"01933b1c-1f00-7000-8000-000000000030","name":"Technology & Electronics","slug":"technology-electronics","icon":"laptop","status":"active"}},"BrandSubBrand":{"type":"object","properties":{"brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_name":{"type":"string"},"sub_brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sub_brand_name":{"type":"string"},"slug":{"type":"string"},"country":{"type":"string","minLength":2,"maxLength":2},"logo":{"type":["string","null"]},"default_currency":{"type":"string","minLength":3,"maxLength":3},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["brand_id","brand_name","sub_brand_id","sub_brand_name","slug","country","default_currency","created_at"],"additionalProperties":false},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique product family identifier (UUIDv7, time-sortable)."},"name":{"type":"string","description":"Display name for the product family."},"slug":{"type":"string","description":"URL-safe slug for the product family. Unique within the TPP catalog."},"category_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Category the family belongs to. Use `/products?category_id=` to list other products in the same category."},"image":{"description":"URL of the raw product image (PNG/JPG). May be null when no image has been uploaded yet.","type":["string","null"]},"image_clean":{"description":"URL of the background-removed PNG produced by the cron worker. Null until the cron processes the original. Prefer this over `image` for product galleries — it composites cleanly on any background.","type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"],"description":"Publication status. Only `active` products are sellable. `draft` = pending validation; `paused` = temporarily hidden; `archived` = discontinued."},"is_custom":{"type":"boolean","description":"`true` for brand-created products (not sourced from the TPP shared catalogue). A brand-level custom product is visible to every sub-brand of its owning brand; a sub-brand-owned custom product is visible only to that sub-brand, never to a sibling or another brand. These products have no provider reservation integration, so TPP Operations coordinates fulfilment manually today while the long-term owner/process is agreed with TPP."},"fulfillment_type":{"type":"string","enum":["physical","digital"],"description":"How the product reaches the player: `physical` (parcel to a postal address) or `digital` (gift card / code, delivered by email — only `recipient_email` is needed). Each order line snapshots it as `fulfillment_type`. More values may be added; treat an unknown value like `physical`."},"price_cents":{"description":"Final price in minor units (TPP's commission and rounding included); the raw provider cost is never exposed. Resolved from in-stock listings only. `GET /products` returns only products with one, so there it is null only for rare legacy data; `GET /products/{id}` also returns visible products that are out of stock, with this null and `available: false`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"description":"ISO-4217 currency code for `price_cents`. Null when `price_cents` is null.","anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"price_country":{"description":"Lowercase ISO-3166 market country used to resolve `price_cents`. The sub-brand primary market is preferred; secondary markets are used only when no primary-market listing is available.","anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"available":{"description":"`true` when at least one variant is `available` (has an in-stock listing you can order now). `GET /products` only lists available products; `GET /products/{id}` can return `false`. Always present in current responses; optional in the schema for v1 compatibility.","type":"boolean"},"updated_at":{"description":"Last time anything in this product's representation may have changed (ISO-8601, UTC): its fields, variants, listings, prices or catalog membership. It can move without a visible change. Use `GET /products?updated_since=` for incremental syncs.","type":["string","null"]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"},"description":"Every variant of the product family. Each carries the `listing_market_id` to order it with (`POST /api/v1/orders`) and that listing's final price; all four are null (and `available` is false) for a variant you cannot order now."}},"required":["id","name","slug","category_id","status","is_custom","fulfillment_type","updated_at","variants"],"additionalProperties":false,"description":"A product family visible to the calling sub-brand via an accepted/owned catalog. Obsolete pre-v7 product UUIDs are resolved server-side but are not exposed as the canonical identifier.","example":{"id":"01933b1c-1f00-7000-8000-000000000030","name":"PlayStation 5","slug":"playstation-5","category_id":"01933b1c-1f00-7000-8000-000000000080","image":"/products/ps5.jpg","image_clean":"/products/ps5-clean.png","status":"active","is_custom":false,"fulfillment_type":"physical","price_cents":54999,"currency":"EUR","price_country":"es","available":true,"updated_at":"2026-10-29T12:00:00.000Z","variants":[{"id":"01933b1c-1f00-7000-8000-000000000040","name":"PlayStation 5 Disc Edition","variant_label":"Disc","sku":"PS5-DISC-EU","image":null,"image_clean":null,"listing_market_id":"01933b1c-1f00-7000-8000-000000000050","price_cents":54999,"currency":"EUR","price_country":"es","available":true}]}},"ProductVariant":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique variant identifier (UUIDv7, time-sortable)."},"name":{"type":"string","description":"Variant display name (e.g. `PS5 Disc Edition`)."},"variant_label":{"type":"string","description":"Short marketing label shown in pickers (e.g. `Disc`, `Digital`, `256GB`)."},"sku":{"type":"string","description":"Stock-keeping unit. Set by the operator at variant creation; not guaranteed unique across families."},"image":{"description":"Variant-specific image, falls back to the family image when null.","type":["string","null"]},"image_clean":{"description":"Background-removed variant image. Falls back to the family image when null.","type":["string","null"]},"fulfillment_type":{"type":"string","enum":["physical","digital"],"description":"Resolved for this variant: its own override, else the family's `fulfillment_type` (e.g. a `Digital` edition of a game)."},"listing_market_id":{"description":"Identifier to send as `items[].listing_market_id` in `POST /api/v1/orders` to buy this variant. It is the variant's active listing in the sub-brand's primary market (secondary markets only when the primary has none), cheapest first. Only in-stock listings (unlimited, or stock of at least one unit) are selected, by the same rule `POST /api/v1/orders` applies; null when the variant has no orderable in-stock listing for your sub-brand (`available: false`). Stock can still change before you order; a short listing is a `409 conflict` at order time.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"price_cents":{"description":"Final price in minor units for `listing_market_id` (TPP's commission and rounding included) — the same price rule as the product-level `price_cents`. Null when `listing_market_id` is null.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"description":"ISO-4217 currency code for the variant `price_cents`. Null when `listing_market_id` is null.","anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"price_country":{"description":"Lowercase ISO-3166 market country of `listing_market_id`. Null when `listing_market_id` is null.","anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"available":{"description":"`true` when this variant can be ordered now: it has an in-stock `listing_market_id`. `false` means all four listing fields are null. Always present in current responses; optional in the schema for v1 compatibility.","type":"boolean"}},"required":["id","name","variant_label","sku","fulfillment_type"],"additionalProperties":false,"example":{"id":"01933b1c-1f00-7000-8000-000000000040","name":"PlayStation 5 Disc Edition","variant_label":"Disc","sku":"PS5-DISC-EU","image":null,"image_clean":null,"fulfillment_type":"physical","listing_market_id":"01933b1c-1f00-7000-8000-000000000050","price_cents":54999,"currency":"EUR","price_country":"es","available":true}},"ProductDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique product family identifier (UUIDv7, time-sortable)."},"name":{"type":"string","description":"Display name for the product family."},"slug":{"type":"string","description":"URL-safe slug for the product family. Unique within the TPP catalog."},"category_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Category the family belongs to. Use `/products?category_id=` to list other products in the same category."},"image":{"description":"URL of the raw product image (PNG/JPG). May be null when no image has been uploaded yet.","type":["string","null"]},"image_clean":{"description":"URL of the background-removed PNG produced by the cron worker. Null until the cron processes the original. Prefer this over `image` for product galleries — it composites cleanly on any background.","type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"],"description":"Publication status. Only `active` products are sellable. `draft` = pending validation; `paused` = temporarily hidden; `archived` = discontinued."},"is_custom":{"type":"boolean","description":"`true` for brand-created products (not sourced from the TPP shared catalogue). A brand-level custom product is visible to every sub-brand of its owning brand; a sub-brand-owned custom product is visible only to that sub-brand, never to a sibling or another brand. These products have no provider reservation integration, so TPP Operations coordinates fulfilment manually today while the long-term owner/process is agreed with TPP."},"fulfillment_type":{"type":"string","enum":["physical","digital"],"description":"How the product reaches the player: `physical` (parcel to a postal address) or `digital` (gift card / code, delivered by email — only `recipient_email` is needed). Each order line snapshots it as `fulfillment_type`. More values may be added; treat an unknown value like `physical`."},"price_cents":{"description":"Final price in minor units (TPP's commission and rounding included); the raw provider cost is never exposed. Resolved from in-stock listings only. `GET /products` returns only products with one, so there it is null only for rare legacy data; `GET /products/{id}` also returns visible products that are out of stock, with this null and `available: false`.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"description":"ISO-4217 currency code for `price_cents`. Null when `price_cents` is null.","anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"price_country":{"description":"Lowercase ISO-3166 market country used to resolve `price_cents`. The sub-brand primary market is preferred; secondary markets are used only when no primary-market listing is available.","anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}]},"available":{"description":"`true` when at least one variant is `available` (has an in-stock listing you can order now). `GET /products` only lists available products; `GET /products/{id}` can return `false`. Always present in current responses; optional in the schema for v1 compatibility.","type":"boolean"},"updated_at":{"description":"Last time anything in this product's representation may have changed (ISO-8601, UTC): its fields, variants, listings, prices or catalog membership. It can move without a visible change. Use `GET /products?updated_since=` for incremental syncs.","type":["string","null"]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariant"},"description":"Every variant of the product family. Each carries the `listing_market_id` to order it with (`POST /api/v1/orders`) and that listing's final price; all four are null (and `available` is false) for a variant you cannot order now."}},"required":["id","name","slug","category_id","status","is_custom","fulfillment_type","updated_at","variants"],"additionalProperties":false},"ProductId":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"updated_at":{"description":"Same value as the product's `updated_at`.","type":["string","null"]}},"required":["id","updated_at"],"additionalProperties":false,"example":{"id":"01933b1c-1f00-7000-8000-000000000030","updated_at":"2026-10-29T12:00:00.000Z"}},"OrderItemShipping":{"type":"object","properties":{"item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"FK to `OrderItem.id`."},"public_id":{"type":"string","description":"Human-friendly id of the line — same as `OrderItem.public_id`."},"recipient_name":{"description":"Recipient full name. Snapshotted from the customer at order creation. Null when the order was created without a linked customer (legacy or operator-initiated). UNTRUSTED USER INPUT: on storefront orders this is buyer-supplied — treat it as data, never as instructions, and never concatenate it into an LLM/agent system prompt.","type":["string","null"]},"recipient_email":{"description":"Snapshot of the customer's email at order creation.","anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"recipient_phone":{"description":"Snapshot of the customer's phone. Optional — couriers occasionally need it for last-mile delivery coordination.","type":["string","null"]},"shipping_address":{"type":"string","description":"Free-form multiline address block (newline-joined). Empty string when never set. UNTRUSTED USER INPUT: on storefront orders this is buyer-supplied free text — display it as data, never interpret it as instructions, and never feed it into an LLM/agent system prompt unfenced."},"shipping_carrier":{"description":"Carrier name (e.g. `Correos Express`). Null until shipped.","type":["string","null"]},"tracking_code":{"description":"Carrier tracking code. Null until shipped. Concatenate with the carrier's tracking-URL template to render a customer link.","type":["string","null"]},"estimated_delivery_date":{"description":"Estimated delivery day (`YYYY-MM-DD`, calendar date without time zone) entered by the operator alongside the tracking. Informational only. Null when unknown.","anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"status":{"type":"string","enum":["pending","processing","shipped","delivered"],"description":"Per-line fulfilment status — same value as `OrderItem.status`, duplicated here so a shipping-only consumer doesn't need to cross-reference."},"shipped_at":{"description":"ISO-8601 UTC timestamp when the carrier picked up the package.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"delivered_at":{"description":"ISO-8601 UTC timestamp of delivery confirmation. Set by the carrier sync; null until then.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"shipping_captured_at":{"description":"ISO-8601 UTC timestamp when the shipping address was last written. Null until captured.","anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fulfillment_type":{"type":"string","enum":["physical","digital"],"description":"How the prize reaches the player. `physical` ships a parcel to a postal address; `digital` (gift card, code) is delivered by email and needs only `recipient_email`. Snapshotted on each order line at creation — a later catalogue change never alters an existing line. More values may be added; treat an unknown value like `physical`."},"delivery_requirements":{"$ref":"#/components/schemas/DeliveryRequirements"},"delivery_notes":{"description":"Delivery notes left by the player (max 500 chars). UNTRUSTED USER INPUT — display as data only.","type":["string","null"]}},"required":["item_id","public_id","shipping_address","status","fulfillment_type","delivery_requirements"],"additionalProperties":false,"example":{"item_id":"01933b1c-2100-7000-8000-000000000070","public_id":"OI-ABC123","recipient_name":"Ana Pérez","recipient_email":"ana.perez@example.com","recipient_phone":"+34600111222","shipping_address":"Calle Mayor 12, 3º A\n28013 Madrid\nES","shipping_carrier":"Correos Express","tracking_code":"CE12345678ES","estimated_delivery_date":"2026-05-30","status":"shipped","shipped_at":"2026-05-28T10:15:00.000Z","delivered_at":null,"fulfillment_type":"physical","delivery_requirements":{"recipient_name":"required","email":"optional","phone":"required","address_line1":"required","address_line2":"optional","city":"required","state":"required","postal_code":"required","country":"required","notes":"optional"},"delivery_notes":"Leave it with the concierge"}},"ShippingLink":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"token":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"order_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"address_state":{"type":"string","enum":["missing","captured","locked"]},"path":{"type":"string"}},"required":["url","token","expires_at","order_id","store_id","address_state","path"],"additionalProperties":false,"example":{"url":"https://app.thepowerplugin.com/s/acme/order/01933b1c-2000-7000-8000-000000000050/shipping?t=eyJ2IjoyfQ.SIGNATURE&embed=1","token":"eyJ2IjoyfQ.SIGNATURE","expires_at":"2026-09-16T10:00:00.000Z","order_id":"01933b1c-2000-7000-8000-000000000050","store_id":"01933b1c-1f00-7000-8000-000000000010","address_state":"missing","path":"/s/acme/order/01933b1c-2000-7000-8000-000000000050/shipping"}},"OrderBuybackQuote":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"eligible":{"type":"boolean","description":"True when a buyback would succeed right now."},"reason":{"anyOf":[{"type":"string","enum":["disabled","already_bought_back","status","shipped","not_paid_with_points","offer_changed"]},{"type":"null"}],"description":"Why it isn't eligible: `disabled` (brand has buyback off), `status` (order is past `processing`), `shipped` (an item already shipped), `not_paid_with_points` (no single wallet paid for it), `already_bought_back`, `offer_changed` (the accepted quote changed before execution). Null when eligible. May receive future values — treat unknown values as not eligible."},"customer_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"The wallet that paid and would be credited."},"points_paid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Points debited for this order."},"rate_bps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Share of `points_paid` returned, in basis points (9000 = 90%)."},"points_offered":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"What the customer would receive. Show this to them before they accept."},"bought_back":{"anyOf":[{"type":"object","properties":{"points_credited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bought_back_at":{"type":"string"}},"required":["points_credited","rate_bps","bought_back_at"],"additionalProperties":false},{"type":"null"}]}},"required":["order_id","eligible","reason","customer_id","points_paid","rate_bps","points_offered","bought_back"],"additionalProperties":false},"OrderBuybackResult":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"order_status":{"type":"string","const":"cancelled"},"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"points_paid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"points_credited":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_bps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bought_back_at":{"type":"string"},"balance_after":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Wallet balance right after the credit. Null when this call replays a buyback that already happened."},"replayed":{"type":"boolean","description":"True when the order had already been bought back; no points moved on this call."}},"required":["order_id","order_status","customer_id","points_paid","points_credited","rate_bps","bought_back_at","balance_after","replayed"],"additionalProperties":false},"StoreSession":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"token":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"store_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["url","token","expires_at","customer_id","store_id"],"additionalProperties":false},"EmbedSession":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"customer_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sub_brand_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["token","expires_at","customer_id","sub_brand_id"],"additionalProperties":false},"EngineEventResult":{"type":"object","properties":{"event_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Unique id of this execution (time-ordered). THE key for support and audit lookups."},"status":{"type":"string","enum":["completed","skipped","failed","pending"],"description":"Business outcome. `completed` applied the points. `skipped` = business rules declined (active window or a per-player velocity cap). `failed` = the execution ran and was recorded but did not apply. Business `failed` and `skipped` are terminal (a same-key retry replays the frozen verdict); only a `failed` with `error_code: internal_error` is retryable. `pending` = the delivery was ACCEPTED AND QUEUED, not executed: `points_applied` and `balance_after` are null because they do not exist yet; the outcome is recorded under `event_id` in the Engine audit trail. Only definitions TPP explicitly switches to asynchronous delivery ever return it, so an integration never sees this value unless its own definition is switched."},"replayed":{"type":"boolean","description":"True when the BUSINESS layer answered with the FROZEN result of a previous delivery with the same idempotency key (nothing was re-executed). Note: on `/engine/events` a same-key retry is usually short-circuited by the HTTP idempotency layer, which returns the ORIGINAL body verbatim (`replayed: false`) plus the `idempotent-replay: true` response header — detect replays via the header there."},"correlation_id":{"type":"string","description":"Tracing id tying together execution, audit trail and request log."},"customer_id":{"description":"Resolved player. Null when resolution failed.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"points_requested":{"description":"Points value the pipeline decided to apply (override or default).","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"points_applied":{"description":"Points actually written to the ledger. Null unless `completed`.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"balance_before":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"balance_after":{"description":"Wallet balance after the movement — from the ORIGINAL execution on replays, never a fresh read.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error_code":{"description":"Machine-readable reason, present on `skipped`/`failed`. `skipped`: `outside_active_window`, `max_daily_reached` (per-player daily cap), `cooldown_active` (per-player min interval), `budget_limit_reached` (see `limit_context`), `budget_misconfigured`, `invalid_amount` / `calculated_points_below_minimum` (runtime points calculation), `invalid_constraints` (misconfigured definition). `failed`: `player_id_missing`, `player_not_found`, `insufficient_balance`, `balance_overflow`, `invalid_points` (misconfigured definition points), `internal_error` (transient — retryable with the same key).","type":["string","null"]},"error_message":{"type":["string","null"]},"limit_context":{"description":"Present only on `status: skipped` with `error_code: budget_limit_reached` — the blocking budget policy's scope/metric/period and how much was requested vs remaining.","anyOf":[{"type":"object","properties":{"scope":{"type":"string"},"metric":{"type":"string"},"period":{"type":"string"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"consumed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"requested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":["string","null"]}},"required":["scope","metric","period","limit","consumed","requested","remaining"],"additionalProperties":false},{"type":"null"}]}},"required":["event_id","status","replayed","correlation_id"],"additionalProperties":false,"description":"Result of one Engine event delivery. Deliveries that pass pre-flight always return 200 with this shape — check `status`, don't assume `completed`.","example":{"event_id":"01933b1c-2300-7000-8000-0000000000aa","status":"completed","replayed":false,"correlation_id":"corr_3f2a6d1e9c084b7fa1d2e3f4a5b6c7d8","customer_id":"01933b1c-1f00-7000-8000-000000000001","points_requested":25,"points_applied":25,"balance_before":100,"balance_after":125,"error_code":null,"error_message":null}},"EngineDefinition":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"code":{"type":"string","description":"Send this as `event_code` on POST /engine/events (normalised: lowercase, `_`)."},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","disabled"],"description":"Only `active` definitions execute; `draft` / `disabled` answer 409 on delivery."},"kind":{"type":"string","enum":["internal","external"],"description":"`external` may be delivered through the API / webhook; `internal` only by the platform (an API delivery answers 409)."},"player_id_field":{"type":"string","description":"Name of the key in YOUR event payload (`data`) that carries the player's `external_id` (default payload key `externalUserId`)."},"idempotency_key_field":{"description":"Name of the key in your webhook payload that carries your stable event id (deduplication); null = the payload's `event_id`, then `id`.","type":["string","null"]},"points":{"type":"object","properties":{"default_points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Signed points applied when no calc / override."},"override_mode":{"type":"string","enum":["disabled","internal_only","external_bounded"],"description":"`external_bounded` accepts `points_override` inside [min, max] with the `engine:overrides` scope."},"min_points":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_points":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"has_calc":{"type":"boolean","description":"True when points are computed at runtime from the payload (grants only)."}},"required":["default_points","override_mode","min_points","max_points","has_calc"],"additionalProperties":false},"constraints":{"type":"object","properties":{"starts_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"max_daily_per_player":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cooldown_seconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["starts_at","ends_at","max_daily_per_player","cooldown_seconds"],"additionalProperties":false},"webhook_path":{"type":"string","description":"Path of the inbound-webhook twin for this code (`POST /api/v1/engine/webhooks/{code}`)."},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","code","name","description","status","kind","player_id_field","idempotency_key_field","points","constraints","webhook_path","updated_at"],"additionalProperties":false,"example":{"id":"01933b1c-5000-7000-8000-000000000090","code":"deposit_completed","name":"Deposit completed","description":"Award points when a deposit settles.","status":"active","kind":"external","player_id_field":"externalUserId","idempotency_key_field":"deposit_id","points":{"default_points":100,"override_mode":"external_bounded","min_points":10,"max_points":500,"has_calc":false},"constraints":{"starts_at":null,"ends_at":null,"max_daily_per_player":3,"cooldown_seconds":600},"webhook_path":"/api/v1/engine/webhooks/deposit_completed","updated_at":"2026-09-09T10:00:00.000Z"}}},"securitySchemes":{"BearerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"tpp_<env>_<32 hex>","description":"Sub-brand-scoped bearer token. Format: `tpp_<env>_<32 hex chars>` where `<env>` is `live` or `test`. Each token declares a set of atomic scopes (`customers:read`, `orders:create`, ...) listed in each operation's `x-required-scopes` extension."}}}}