{
  "openapi": "3.1.0",
  "info": {
    "title": "HippoLink API",
    "version": "0.1.0",
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    },
    "description": "# HippoLink Public API\n\nRead your HippoLink stores' inventory, locations, orders, repricing, reports and audit\nhistory with an API key. Only the operations listed here are served by\n`https://public-api.hippolink.app`; any other path answers a gateway 404.\n\n## Authentication\n\n1. Create an API key (`hlak_...`) in your HippoLink account settings and give it access\n   to the stores and areas it needs.\n2. Exchange it at `POST /v1/auth/token` with `Authorization: Bearer hlak_...`. The answer is\n   `{\"access_token\": \"...\", \"token_type\": \"Bearer\", \"expires_in\": 3600}`.\n3. Call every other operation with `Authorization: Bearer <access_token>`. Tokens are\n   signed by `https://auth.hippolink.app` and last one hour; exchange again when one\n   expires, or once after a gateway 401.\n\nEach key has an exchange allowance of 10 that refills at 10 a minute, so a key can exchange\nup to about 20 times in its first minute and 10 a minute after that. Reuse a token until it\nexpires.\n\n## Scopes\n\nA key holds a grant per store, each naming an access level (`read` or `write`) per area.\nEvery operation lists the **Scope required** to call it, as `area:access`; `write` covers\n`read`. Operations marked \"any key with a store grant\" need no particular area, only a key\nwith access to at least one store you are still a member of. The key can never do more\nthan you can: each operation also lists **who can call it**, and your role on the store\nstill applies.\n\n## Rate limits\n\nOne request budget per account, shared by all of its keys and tokens: a bucket of 25\ntokens that refills at 5 a second unless HippoLink has set a different limit for you. Most\noperations cost one token; an operation that costs more lists its **Cost**. Every response\nthat reached the rate limiter carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and\n`X-RateLimit-Reset`. Over the limit, the answer is 429 `api_rate_limited` with\n`Retry-After` in seconds.\n\n## Errors\n\nHippoLink answers with an `ErrorResponse`: a stable `error` code to branch on, a\n`detail` written for people, and a `request_id` to quote to support.\n\nThe API gateway answers some requests itself, before HippoLink's code runs. Those\nbodies are `{\"message\": \"...\"}`, with no `request_id` and no rate-limit headers:\n\n| Gateway response | When |\n|---|---|\n| 401 `{\"message\":\"Unauthorized\"}` | Missing, malformed, expired or wrongly signed token |\n| 404 `{\"message\":\"Not Found\"}` | The path or method is not served by the public API |\n| 429 `{\"message\":\"Too Many Requests\"}` | The gateway's own throttle, separate from your key's budget |\n| 500 `{\"message\":\"Internal Server Error\"}` | The request failed before HippoLink could answer it |\n\nWhat to do:\n\n- Gateway 401: the token expired or is bad. Exchange the key again once and retry.\n- 401 `api_key_revoked`, `api_key_expired` or `api_key_user_disabled`:\n  do not retry or exchange again. The key itself is no longer usable and the exchange refuses it too.\n- 403 `api_key_ip_not_allowed`: the key is limited to a list of IP addresses and the call\n  came from another one (`params.source_ip`). Retrying won't help: add that address to the\n  key's list, or call from an address already on it.\n- 403 `api_key_ip_restriction_required`: the store (`params.store_uuid`) requires every key\n  to be limited to a list of IP addresses and this key has none. Retrying won't help: add\n  your addresses to the key's list. The key keeps working on your other stores.\n- Either kind of 429: back off, honoring `Retry-After` when present.\n- Gateway 500: there is no `request_id`, and a write may or may not have happened. Retry a\n  write with the same `Idempotency-Key`, so it can't run twice; retry a read as it was.\n\nThe codes specific to API keys, with the message each one carries in `detail`:\n\n| Status | Code | Message |\n|---|---|---|\n| 401 | `api_key_invalid` | This isn't a valid HippoLink API key. Check that you copied the whole key. |\n| 401 | `api_key_revoked` | This API key has been revoked or no longer exists. Create a new key. |\n| 401 | `api_key_expired` | This API key has expired. Create a new key or extend this one. |\n| 401 | `api_key_user_disabled` | The account this API key belongs to is no longer active. |\n| 401 | `api_token_invalid` | This token isn't valid for the HippoLink API. Exchange your API key for a new token. |\n| 403 | `api_key_ip_not_allowed` | This API key can't be used from this IP address. Add the address in params.source_ip to the key's allowed IP addresses in your HippoLink account settings, or call from an address already on its list. |\n| 403 | `api_key_store_denied` | This API key can't act on this store: it has no access to it, or you're no longer a member there. Check the key's store access in your HippoLink account settings. |\n| 403 | `api_key_store_denied` | This API key has no access to any store where you're still a member with API access turned on. Give it access to such a store in your HippoLink account settings, or ask that store's owner to turn on your API access. |\n| 403 | `api_access_not_enabled` | The store owner hasn't turned on API access for you on this store. |\n| 403 | `api_key_ip_restriction_required` | This store requires every API key to be limited to a list of IP addresses, and this key has none. Add the addresses your software runs from to the key's allowed IP addresses in your HippoLink account settings. |\n| 403 | `api_key_scope_insufficient` | This API key's access on this store doesn't cover this action. Raise the key's access for this area in your HippoLink account settings. |\n| 403 | `api_key_route_not_exposed` | This endpoint isn't available through the public API. |\n| 403 | `api_key_price_list_not_shared` | This key doesn't share the buylist. |\n| 429 | `api_key_exchange_rate_limited` | This API key has exchanged for too many tokens in the last minute. Wait and try again; one token lasts an hour, so reuse it until it expires. |\n| 429 | `api_rate_limited` | Too many requests for this API key's limit. Wait for the Retry-After seconds, then try again; the X-RateLimit headers on each response show what is left. |\n| 503 | `api_key_identity_unavailable` | We couldn't confirm the account this API key belongs to right now. Please try again in a moment. |\n| 503 | `api_token_signing_unavailable` | We couldn't issue a token right now. Please try again in a moment. |\n| 503 | `api_rate_limit_unavailable` | We couldn't check this API key's limit right now. Please try again in a moment. |\n| 503 | `api_key_enforcement_unavailable` | This endpoint can't check API keys right now, so it refused the request. Please contact support and quote the request ID. |\n\n## Idempotency and retries\n\nSend an `Idempotency-Key` header on every write `POST`. It is optional on most and required on\nthe few that already required it (the operation says which). `PUT`, `PATCH` and `DELETE` don't\nuse it because repeating them has the same effect. Use a new UUIDv4 for each logical operation\nand the same one when you retry it. The key is 1 to 255 printable ASCII characters, scoped to\nthe store, and lasts 24 hours.\n\n- A request that finished answers a retry with the stored status and body, `Content-Type`,\n  `ETag` and `Location`, plus `Idempotent-Replayed: true`. The replay has a new `X-Request-Id`\n  and fresh rate-limit headers. It costs one rate-limit token and still needs a live key.\n- A request still running answers 409 `idempotency_key_in_progress` with `Retry-After`. Wait\n  and retry with the same key.\n- The same key with a different body, a different resource or a different user answers 422\n  `idempotency_key_conflict`. Use a new key.\n- Server errors (5xx), 429, 401, 403 and 412 are not stored, and neither are responses that\n  aren't JSON (the batch order documents PDF). A retry with the same key runs again.\n- A response over 256 KB is replayed as `{\"idempotent_replay\": true, \"body_omitted\": true}`\n  plus its `status` and `*_uuid` / `*_id` fields. Read the resource again by its id. A replayed\n  body can hold presigned URLs that have expired; read the resource again, or send a new key.\n- A request still pending after 90 seconds can be taken over by a retry. That carries a small\n  risk the action runs twice if the first attempt was only slow.\n\n| Status | Code | Message |\n|---|---|---|\n| 400 | `idempotency_key_invalid` | The Idempotency-Key header must be 1 to 255 printable ASCII characters. Send a new UUID for each action, and the same one when you retry it. |\n| 409 | `idempotency_key_in_progress` | This request is still being processed. Wait a moment, then retry it, with the same Idempotency-Key if you sent one. |\n| 422 | `idempotency_key_conflict` | This Idempotency-Key was already used for a different request. Send a new Idempotency-Key with each new request, and reuse a key only to retry the exact same request. |\n| 409 | `carrier_void_unconfirmed` | The carrier didn't confirm whether this label was voided. Wait a moment, then try again. |\n\n`carrier_void_unconfirmed` (with `Retry-After: 5`) means the carrier did not confirm the\nvoid. It was not refused: try again."
  },
  "servers": [
    {
      "url": "https://public-api.hippolink.app",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "API Tokens",
      "description": "Exchange an API key for a one-hour access token."
    },
    {
      "name": "Users",
      "description": "User accounts backed by Supabase Auth"
    },
    {
      "name": "Stores",
      "description": "Manage stores and their settings"
    },
    {
      "name": "Audit",
      "description": "Audit log of all activities"
    },
    {
      "name": "Inventory",
      "description": "Browse, create, and update product inventory. Includes async CSV import and export jobs for bulk operations.\n"
    },
    {
      "name": "Locations",
      "description": "Manage physical locations within a store and their product inventory"
    },
    {
      "name": "Labels",
      "description": "SKU label generation (printable barcodes for inventory items)."
    },
    {
      "name": "Kiosk Storefront Config",
      "description": "Operator CRUD for a store's public kiosk storefront config, plus the operational actions on the bins that config designates — currently the canceled-order bin's contents and the return of its stock to the bins it was pulled from.\n"
    },
    {
      "name": "Rules",
      "description": "Create, update, reorder, and validate repricing rules"
    },
    {
      "name": "Reprice",
      "description": "Preview, execute, and roll back reprice runs"
    },
    {
      "name": "DSL",
      "description": "Stateless DSL utilities -- parse rule strings into ASTs, validate them, and enumerate supported variables. No store context required.\n"
    },
    {
      "name": "Buylist Rules",
      "description": "Create, update, reorder, and validate buylist rules"
    },
    {
      "name": "Buylist Purchases",
      "description": "Create and manage customer buylist purchase transactions"
    },
    {
      "name": "Buylist Import",
      "description": "Presigned-upload CSV import flow for creating draft buylist purchases"
    },
    {
      "name": "Buylist Scan & Identify",
      "description": "Start TCGplayer Scan & Identify scans, list batches and Sifters, and import a batch for review"
    },
    {
      "name": "Buylist DSL",
      "description": "Stateless buylist DSL utilities -- parse rule strings into ASTs, validate them, and enumerate supported variables. No store context required.\n"
    },
    {
      "name": "Orders",
      "description": "View and manage orders from all connected marketplaces (TCGPlayer, Manapool, Shopify, CardTrader). Orders are ingested by a separate service and surfaced here for unified fulfillment workflows.\n"
    },
    {
      "name": "TCGplayer Direct",
      "description": "TCGplayer Direct Reimbursement Invoices (RIs) — the pull sheets a Direct seller must pull, pack, and ship within 24 hours. Detected from the seller portal and surfaced here for the store's notifications tab.\n"
    },
    {
      "name": "CardTrader Zero",
      "description": "CardTrader Zero, which delivers a seller two different things over the same marketplace. Individual Zero sales arrive held and informational — the buyer checked out through CardTrader's hub, so the seller never picks or ships them one by one. Once a week CardTrader closes those and issues one consolidated invoice carrying all their items: that is the pull sheet the store actually works, and the only thing here with actions.\n"
    },
    {
      "name": "Fulfillment",
      "description": "Session-based order fulfillment. Managers create fulfillment sessions (batches of cards from one or more orders); employees claim sessions, pick cards location-by-location, and all devices stay in sync via polling.\n"
    },
    {
      "name": "Pull Alerts",
      "description": "Double-sell guard. When a card sells online that is physically present in a customer-browsable display case (a location flagged `notify_on_online_sale`), a pull alert fires so staff can pull the copy before a walk-in double-sells it.\n"
    },
    {
      "name": "Shipping",
      "description": "Rate-shop carriers, purchase and void shipping labels, and track shipments via EasyPost integration.\n"
    },
    {
      "name": "Shipping Rules",
      "description": "Create, update, and delete per-store shipping rules"
    },
    {
      "name": "Early Ship Rules",
      "description": "Per-store, per-game, per-category (singles/sealed) configuration of how many days before a catalog release date a presale order may ship.\n"
    },
    {
      "name": "Marketplace Fees",
      "description": "Per-(store, marketplace) fee configuration (CC + platform commission) used to break out HL/CC/platform fees in COGS and profit reporting.\n"
    },
    {
      "name": "Order Documents",
      "description": "Generate an order's packing slip PDF: the one order document, carrying the line items with their prices and the order's totals (it absorbed the separate sales invoice). Distinct from TCGplayer Direct Reimbursement Invoices, which live under the TCGplayer Direct tag.\n"
    },
    {
      "name": "Envelope Labels",
      "description": "Generate 4x6 envelope address label PDFs for orders — store return address, customer delivery address, and a stamp area.\n"
    },
    {
      "name": "Order Sync",
      "description": "Inventory synchronization between marketplaces. Orders detected on one marketplace trigger automatic inventory decrements on all others. Managed per-store; credentials and status are surfaced here.\n"
    },
    {
      "name": "Integrations",
      "description": "Store-level links to partner systems that are neither marketplaces nor shipping carriers, e.g. CardChaos (bin planning and pull runs).\n"
    },
    {
      "name": "TCG Messages",
      "description": "TCGPlayer seller-portal customer messages ingested per store. Surfaces unread/unanswered counts and threads on the home dashboard.\n"
    },
    {
      "name": "Reports",
      "description": "Aggregated sales and performance reports. Free-tier stores are limited to 30-day date ranges.\n"
    }
  ],
  "paths": {
    "/v1/auth/token": {
      "post": {
        "tags": [
          "API Tokens"
        ],
        "summary": "Exchange an API key for an access token",
        "operationId": "exchangeApiKey",
        "description": "Send the API key as `Authorization: Bearer hlak_...` with no body. The answer is a one-hour access token for every other operation.\n\nEach key has an allowance of 10 exchanges that refills at 10 a minute, so up to about 20 in the first minute and 10 a minute after that. A refused exchange still spends one, so reuse a token until it expires. A 401 here means the key itself can't be used: do not retry it.\n\nUnder a burst of concurrent exchanges the gateway can answer 503 `{\"message\":\"Service Unavailable\"}` with no `Retry-After`; wait a few seconds and try again.\n\n**Who can call this:** Anyone presenting an API key.",
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A new access token.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "The key can't be used; do not retry it. `api_key_invalid`: This isn't a valid HippoLink API key. Check that you copied the whole key. `api_key_revoked`: This API key has been revoked or no longer exists. Create a new key. `api_key_expired`: This API key has expired. Create a new key or extend this one. `api_key_user_disabled`: The account this API key belongs to is no longer active.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is limited to a list of IP addresses and this request didn't come from one of them. `params.source_ip` is the address it came from. No exchange was spent; retrying from the same address won't help. `api_key_ip_not_allowed`: This API key can't be used from this IP address. Add the address in params.source_ip to the key's allowed IP addresses in your HippoLink account settings, or call from an address already on its list.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "`api_key_exchange_rate_limited`: This API key has exchanged for too many tokens in the last minute. Wait and try again; one token lasts an hour, so reuse it until it expires. Wait for `Retry-After`. The gateway's own throttle answers `{\"message\":\"Too Many Requests\"}` with no `Retry-After`.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Retry-After": {
                "description": "Seconds to wait before trying again.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayMessage"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "`unexpected_error`: Something unexpected went wrong on our side. Please try again; if it keeps happening, contact support and quote the request ID.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "No token was issued, and the attempt spent an exchange; retry after `Retry-After`. `api_key_identity_unavailable`: We couldn't confirm the account this API key belongs to right now. Please try again in a moment. `api_token_signing_unavailable`: We couldn't issue a token right now. Please try again in a moment. `service_unavailable`: HippoLink is briefly unavailable. Please try again in a moment.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`: token responses, refusals included, must not be cached.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Retry-After": {
                "description": "Seconds to wait before trying again.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/me": {
      "get": {
        "operationId": "getCurrentUser",
        "tags": [
          "Users"
        ],
        "summary": "Get the authenticated user's profile",
        "description": "Returns the authenticated user's profile together with their store memberships and any pending staff invitations. Identity comes from the JWT; returns 401 if the token is missing or invalid and 404 if no user record exists. On a web session the profile's email is first updated to the JWT's `email` claim when they differ (an address changed through Supabase's confirm-email flow), unless another account holds that address; pending invitations are accepted and listed by the claim, and a token without one accepts and lists none (#4653).\n\n**Who can call this:** Any signed-in user.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "The signed-in user has no profile yet (`user_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Current user details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores": {
      "get": {
        "operationId": "listStores",
        "tags": [
          "Stores"
        ],
        "summary": "List stores the authenticated account has access to",
        "description": "Returns the stores the authenticated account can access, paginated via limit and offset.\n\n**Who can call this:** Any signed-in user.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum (250) or `offset` was negative (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated list of stores",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStoreList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getStore",
        "tags": [
          "Stores"
        ],
        "summary": "Get store details",
        "description": "Returns store details including rolled-up inventory and order counts. Returns 404 if the store does not exist.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `store_settings:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Store details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fx-rates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getStoreFxRates",
        "tags": [
          "Stores"
        ],
        "summary": "Get the store's exchange-rate settings",
        "description": "One row for each FX currency other than the store's own. Every rate reads in the direction that gives a number of at least 1 (`1 USD = 1.389 CAD` for a CAD store, `1 EUR = 1.515 CAD`): `display_base` is the stronger currency (EUR, USD, CAD, MXN in that order). `mode` is `managed` (follow HippoLink's rate) or `fixed` (the seller's own `fixed_rate`, up to 6 decimals). `applied_rate` is the rate pricing uses now; it moves only on a reprice run or when these settings are saved. Rates are decimal strings.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `store_settings:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's exchange-rate settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreFxRates"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/referral": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getStoreReferral",
        "tags": [
          "Stores"
        ],
        "summary": "Get the referral partner the store signed up through",
        "description": "`referral` is null when the store has none. `locked` is true when the caller can no longer change it: once the store has had a paid (Stripe) subscription, for everyone but a administrator.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `store_settings:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's referral",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreReferralState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listJobs",
        "tags": [
          "Stores"
        ],
        "summary": "List all async jobs for a store",
        "description": "Returns a store's import and export jobs, including reverts of imports. Relocation jobs and dry-run previews are not listed. Reprice and rollback jobs live in the repricing service and are not listed here either. Use query parameters to filter by job type and/or status.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `store_settings:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Filter by job type. Only import and export jobs can be filtered; any other value is a 400.",
            "schema": {
              "type": "string",
              "enum": [
                "import",
                "export"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by job status",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum (250), or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated list of jobs",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedJobList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/audit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "searchAuditLog",
        "tags": [
          "Audit"
        ],
        "summary": "Search the audit log for a store",
        "description": "Returns a cursor-paginated stream of audit events, newest first. Use query parameters to narrow results by date range, event type, service name (regex), actor email, or an exact SKU. Page forward with the opaque `after` cursor: omit it for the first page, then pass the previous response's `next_cursor` until `has_more` is false. The cursor is scoped to the exact filter set that produced it, so reset to the first page whenever any filter changes. `total` is returned only when `count=true`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `audit:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_after",
            "in": "query",
            "required": true,
            "description": "Start of date range (inclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "date_before",
            "in": "query",
            "required": true,
            "description": "End of date range (exclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Event type filter (regex, e.g. \"rule_.*\", \"reprice_execute\")",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "service",
            "in": "query",
            "description": "Service name filter (regex)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "description": "Actor email filter (regex)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sku",
            "in": "query",
            "description": "Filter by exact tcgplayer_sku_id",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/Count"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated audit events",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAuditEventList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "head": {
        "operationId": "countInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Count distinct products matching filters",
        "parameters": [
          {
            "$ref": "#/components/parameters/Condition"
          },
          {
            "$ref": "#/components/parameters/InventoryLanguage"
          },
          {
            "$ref": "#/components/parameters/InventoryFinish"
          },
          {
            "$ref": "#/components/parameters/PriceMin"
          },
          {
            "$ref": "#/components/parameters/PriceMax"
          },
          {
            "$ref": "#/components/parameters/Search"
          },
          {
            "$ref": "#/components/parameters/QuantityMin"
          },
          {
            "$ref": "#/components/parameters/QuantityMax"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMin"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMax"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/InventoryRarity"
          },
          {
            "$ref": "#/components/parameters/InventoryColor"
          },
          {
            "$ref": "#/components/parameters/InventorySetName"
          },
          {
            "$ref": "#/components/parameters/InventoryProductNumber"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMin"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMax"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldAfter"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldBefore"
          },
          {
            "$ref": "#/components/parameters/NeverSold"
          },
          {
            "$ref": "#/components/parameters/InventoryTags"
          }
        ],
        "description": "Returns no response body. The total count of matching distinct TCGPlayer products is returned in the `X-Total-Count` response header (not the SKU count); the sum of `total_quantity` across that same filtered set is returned in `X-Total-Quantity`, and what that stock is worth at the store's own retail prices in `X-Total-Value`, and the number of stocked SKUs behind it in `X-Total-Stocked-Skus`. Filters are applied with the same product-aggregated semantics as `listInventory`. Error status codes are signalled via HTTP status only — HEAD responses carry no body.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Count returned in headers",
            "headers": {
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Number of distinct TCGPlayer products matching the filters."
              },
              "X-Total-Quantity": {
                "schema": {
                  "type": "integer"
                },
                "description": "Sum of `total_quantity` (physical copies) across every product matching the filters — the same filtered set as `X-Total-Count`, ignoring pagination.\n"
              },
              "X-Total-Value": {
                "schema": {
                  "type": "number",
                  "format": "double"
                },
                "description": "Retail value (USD) of the stock behind `X-Total-Quantity` — the same filtered set, same semantics as the `total_value` field on `listInventory`'s body.\n"
              },
              "X-Total-Stocked-Skus": {
                "schema": {
                  "type": "integer"
                },
                "description": "Distinct SKUs holding at least one copy across the products matching the filters — same semantics as the `total_stocked_skus` field on `listInventory`'s body.\n"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "operationId": "listInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "List inventory aggregated by TCGPlayer product",
        "description": "Returns one row per TCGPlayer product the store owns, with totals rolled up across every SKU variant (condition/language/finish).\n- Range filters (`quantity_min/max`, `quantity_visible_min/max`,\n  `price_min/max`) apply to the aggregated values: total quantity\n  and the product's price range respectively.\n- Set-membership filters (`condition`, etc.) match products that\n  have at least one SKU satisfying the predicate.\n- `location_uuid` filters to products with at least one SKU stored\n  at that location; aggregated totals still reflect all locations\n  for the matching products.\n- `last_copy_sold_after` / `last_copy_sold_before` filter on the\n  product-level `last_copy_sold_at` (most recent non-canceled,\n  non-refunded sale of any variant); `never_sold=true` selects\n  products that have never sold. The same value is sortable via\n  `sort_by=last_copy_sold_at`.\n\nDrill into a product via `GET /v1/stores/{store_uuid}/products/{tcgplayer_product_id}/inventory` to get the per-SKU breakdown.\n\nTo sync a copy of the list, send `sync=true` (no other parameter but `limit`) before reading the full list: it returns no rows and a `next_cursor`. Then read the full list with offset paging, and from then on poll with `after` set to the last `next_cursor`. Each poll returns the products whose list row may have changed since, oldest change first, in `inventory`, and in `removed` the changed products that are not stocked now; follow `next_cursor` while `has_more` is true, and keep the last one for the next poll. A poll takes only `after` and `limit`. A product can come back more than once in a walk; keep the latest. A poll only returns changes that finished saving, so a change can arrive late while a long write (an import) is still running, and is never skipped. What advances a sync: a change to a product's stock (an add, a quantity or listed quantity change, a move, a removal), to a stocked SKU's price or price lock, or to the price lock of a bin that holds it. Nothing else does: buylist prices, tags, COGS, last sold, grading, catalog details and `last_inventoried_at` alone are not tracked, so re-read the full list now and then if you keep any of them. A position older than 6 days is refused with `cursor_expired`; start again with `sync=true` and a full read. The plain list is unchanged when neither `sync` nor `after` is sent.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/InventorySync"
          },
          {
            "$ref": "#/components/parameters/InventorySyncCursor"
          },
          {
            "$ref": "#/components/parameters/Condition"
          },
          {
            "$ref": "#/components/parameters/InventoryLanguage"
          },
          {
            "$ref": "#/components/parameters/InventoryFinish"
          },
          {
            "$ref": "#/components/parameters/PriceMin"
          },
          {
            "$ref": "#/components/parameters/PriceMax"
          },
          {
            "$ref": "#/components/parameters/Search"
          },
          {
            "$ref": "#/components/parameters/QuantityMin"
          },
          {
            "$ref": "#/components/parameters/QuantityMax"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMin"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMax"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/InventoryRarity"
          },
          {
            "$ref": "#/components/parameters/InventoryColor"
          },
          {
            "$ref": "#/components/parameters/InventorySetName"
          },
          {
            "$ref": "#/components/parameters/InventoryProductNumber"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMin"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMax"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldAfter"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldBefore"
          },
          {
            "$ref": "#/components/parameters/NeverSold"
          },
          {
            "$ref": "#/components/parameters/InventoryTags"
          },
          {
            "name": "location_uuid",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Include only products that have at least one SKU stored at this location **or anywhere beneath it**. A container holds no stock of its own, so passing one selects everything in its bins (and in nested containers' bins), not nothing. Aggregated totals on the response still reflect every location for the matching products.\n"
          },
          {
            "name": "game",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Filter to a single game family. Omit to return inventory across all games.\n"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/SortBy"
          },
          {
            "$ref": "#/components/parameters/SortDir"
          }
        ],
        "responses": {
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated product-aggregated inventory",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedInventoryList"
                }
              }
            }
          },
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter). `cursor_invalid`: the `after` sync position is not one this list issued. `cursor_expired`: the `after` sync position is older than the 6 days of changes the list keeps; start again with `sync=true` and a full read.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`). `cursor_param_conflict`: a sync request (`sync=true` or `after`) also sent a filter, a sort or `offset`, or `sync=false` with `after`; `validation_errors` names the parameter.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Create a single inventory item",
        "description": "Creates one inventory item by cascade-matching `product_name` + `set_name` to a TCGPlayer product, then resolving the `condition`/`language`/`finish` variant to a `tcgplayer_sku_id`. The item is created at the store's default intake location, and `quantity_visible` is forced to 0 at non-listable locations. Returns the full `InventoryDetail`. Use `PATCH /v1/stores/{store_uuid}/inventory` for bulk upserts.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "product_name",
                  "set_name",
                  "condition",
                  "language",
                  "finish",
                  "quantity"
                ],
                "properties": {
                  "game": {
                    "type": "string",
                    "default": "magic",
                    "description": "Game family the product belongs to (magic, pokemon, lorcana, onepiece, riftbound, unionarena, pokemonjp, gundam, starwars, yugioh, cyberpunk, palworld, digimon, fleshblood, cookierun, sleeves, sorcery, wow, deckboxes, playmats, binders, colstorage, counters, vanguard, dbsmasters, dbsfusion, weiss). Determines which catalog partition the product_name/set_name match runs against. Defaults to magic when omitted.\n"
                  },
                  "product_name": {
                    "type": "string",
                    "description": "Exact product name to match in the catalog."
                  },
                  "set_name": {
                    "type": "string",
                    "description": "Exact set name, to disambiguate the product."
                  },
                  "condition": {
                    "$ref": "#/components/schemas/CardConditionInput"
                  },
                  "language": {
                    "type": "string",
                    "description": "Card language (e.g. English)."
                  },
                  "finish": {
                    "type": "string",
                    "description": "Card finish (e.g. normal, foil, etched)."
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Total quantity on hand."
                  },
                  "quantity_visible": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Quantity exposed to marketplaces. Defaults to `quantity`; forced to 0 at non-listable locations; must not exceed `quantity`.\n"
                  },
                  "listed_target": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
                  },
                  "reserved_for_store": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Per-SKU quantity held back from online marketplaces for in-store use (e.g. walk-in customers), independent of `listed_target`. There is no store-wide default; null means no reserve, and `0` is accepted as a synonym for null (it is stored as null, so reads never return 0). Setting or raising the reserve pulls the listing down and pushes the change to marketplaces; lowering or clearing it applies on the next write only (no automatic relist).\n"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Free-text operator note for this SKU (distinct from the removal-ledger `note` field on other endpoints). Capped at 2000 characters. Null or omitted leaves it unset.\n"
                  },
                  "price": {
                    "type": "number",
                    "format": "double",
                    "description": "Listing price in USD. Requires the `inventory.set_sell_price` permission (store_manager and above by default); a caller without it is refused 403. Omit it and repricing sets the listing price on its next run. Null counts as omitted.\n"
                  },
                  "purchase_price": {
                    "type": "number",
                    "format": "double",
                    "description": "Per-unit acquisition cost (COGS)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the search box used an operator it can't read (`search_query_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Inventory item created",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Entity tag for optimistic concurrency on later updates."
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "patch": {
        "operationId": "bulkUpsertInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Bulk upsert inventory (max 250)",
        "description": "Upsert up to 250 inventory rows in a single request. Rows are matched on `(tcgplayer_product_id, tcgplayer_sku_id)` for the store: existing rows are updated, missing rows are inserted. Card-detail fields (`product_name`, `condition`, etc.) are resolved from the catalog using the SKU ID. Returns the resulting inventory summaries. On validation error, per-item errors use the `index` field in the error envelope.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "minItems": 1,
                "maxItems": 250,
                "items": {
                  "type": "object",
                  "required": [
                    "tcgplayer_product_id",
                    "tcgplayer_sku_id"
                  ],
                  "minProperties": 3,
                  "properties": {
                    "tcgplayer_product_id": {
                      "type": "integer",
                      "description": "Parent TCGPlayer product ID for the SKU being updated."
                    },
                    "tcgplayer_sku_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "price": {
                      "type": "number",
                      "format": "double",
                      "description": "New price in USD. Requires the `inventory.set_sell_price` permission (store_manager and above by default); a caller without it is refused 403 for the whole batch, naming the first priced item. Null is ignored here, as it is on create.\n"
                    },
                    "purchase_price": {
                      "type": "number",
                      "format": "double",
                      "description": "Per-unit acquisition cost (COGS), only applied to newly added quantity.\n"
                    },
                    "quantity": {
                      "type": "integer",
                      "description": "New quantity"
                    },
                    "quantity_visible": {
                      "type": "integer",
                      "description": "New visible quantity"
                    },
                    "slot": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "The position (storage row) a `quantity` / `quantity_visible` write targets, from the `slot` the read returned. Omit it when the SKU has one stocked row in its location; a quantity write without it on a SKU stocked at several positions in one location is a 422 naming the slots.\n"
                    },
                    "expected_last_inventoried_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "**Required on any item that changes `quantity` or `quantity_visible`** (428 without it, naming the SKU IDs, before anything is written); exempt on price-, reserve-, listed-target- and notes-only items (those carry `expected_pricing_updated_at` instead). Send the `last_inventoried_at` this SKU's own read returned (the per-SKU detail or summary value, not a product-level aggregate across sibling SKUs, which would reject whenever a sibling changed). Send it back verbatim: it is compared exactly, at microsecond precision, so re-formatting it (for example through a millisecond-only date type) makes every save a 412. If the SKU's stock row has changed since (another session, an order, a pick), the whole batch is rejected with 412 naming the stale SKU IDs and nothing is written. Must be a UTC-offset ISO 8601 timestamp (400 otherwise).\n"
                    },
                    "expected_pricing_updated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "**Required on any item that changes `price`, `listed_target` or `reserved_for_store`** (428 without it, naming the SKU IDs, before anything is written; a `price` of null is ignored and does not count). Send the `pricing_updated_at` this SKU's own read returned, or null if that read returned null (the SKU had no pricing row). Send it back verbatim: it is compared exactly, at microsecond precision. It advances on every write to the SKU's pricing row, including a repricing run, so a price edit made over a repricer change is rejected with 412 naming the stale SKU IDs, and nothing in the batch is written. Must be a UTC-offset ISO 8601 timestamp (400 otherwise).\n"
                    },
                    "listed_target": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1,
                      "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
                    },
                    "reserved_for_store": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0,
                      "description": "Per-SKU quantity held back from online marketplaces for in-store use (e.g. walk-in customers), independent of `listed_target`. There is no store-wide default; null means no reserve, and `0` is accepted as a synonym for null (it is stored as null, so reads never return 0). Setting or raising the reserve pulls the listing down and pushes the change to marketplaces; lowering or clearing it applies on the next write only (no automatic relist).\n"
                    },
                    "notes": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "maxLength": 2000,
                      "description": "Replaces this SKU's note. Capped at 2000 characters. An explicit `null` (or empty string) clears the note; omitting the field leaves the existing note unchanged.\n"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Inventory upserted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "inventory"
                  ],
                  "properties": {
                    "inventory": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventorySummary"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Warning"
                      },
                      "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`); the listings catch up within about 30 minutes.\n"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A conflicting change, named by its code. `lot_cost_locked`: copies a quantity decrease takes out of stock are being updated (a cost batch they are in is being finished, or they kept changing). Try again in a minute.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/transfers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listInventoryTransfers",
        "tags": [
          "Inventory"
        ],
        "summary": "List this store's transfers, inbound and/or outbound.",
        "description": "Newest first. `direction` is the parameter that matters: a store is the SOURCE of some transfers and the DESTINATION of others, and those are different worklists — \"what I have sent\" versus \"what I need to receive\". Both are visible to a participating store; a store that is neither end never sees the transfer at all.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "outbound",
                "inbound"
              ],
              "default": "all"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/InventoryTransferStatus"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated transfers.",
            "headers": {
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total number of matching transfers (same value as the `total` field in the response body)."
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedInventoryTransferList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Create a draft same-owner transfer of stock to another of your stores.",
        "description": "Creates a `draft` transfer moving stock from the store in the path (the SOURCE) to `dest_store_uuid` (the DESTINATION). Nothing is decremented and no stock is reserved -- a draft is a plan; the units leave the source only on dispatch, which is also where stock sufficiency is checked. A draft naming more than the source currently holds is therefore accepted here on purpose, so an operator can build one up over several sittings.\n\n**Authorization is two-sided.** The path store is gated by this operation's own roles as usual; the caller must *additionally* be a member of the destination store, else `403`. That second check is membership, not a role level -- a transfer's whole premise is one human holding both stores.\n\n**Both stores must share a currency.** The destination lot carries the source lot's `unit_cost` verbatim (same books, no markup), so a transfer across currencies would silently reinterpret the number; it is refused `422` rather than guessing an FX rate.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInventoryTransferRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The created draft transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Get one transfer with its lines.",
        "description": "Readable by **either** participating store — unlike the mutating routes, which are source-only, because the destination needs to see what is inbound. A store that is neither end gets `404`, not `403`: confirming the transfer exists would leak that two other stores are moving stock.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "cancelInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Cancel (delete) a draft transfer.",
        "description": "Deletes a `draft` transfer and its lines. A draft never took any stock, so there is nothing to record -- it is an abandoned plan, not an event, and it leaves no trace.\n\nOnly the SOURCE store may cancel, and only while the transfer is still `draft`: once dispatched, the stock has physically left, and the shortfall has to be acknowledged rather than deleted (`409`). The `canceled` status is reserved for that after-dispatch case.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Draft deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is no longer a draft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}/receive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "receiveInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Confirm what arrived and settle the transfer at the destination.",
        "description": "**The path store is the DESTINATION here** — the only transfer route where that is true; create, cancel and dispatch are all source-side. The operator confirms the quantity that physically arrived per line and picks the bin it goes into.\n\nDestination lots are created carrying each source lot's **cost and acquisition date verbatim** — same books, no markup, no re-aging — so the destination's COGS and slow-mover reports stay truthful. A short receipt fills from the oldest source lot down.\n\nA full receipt on every line settles the transfer `received`. **Any short line parks it in `discrepancy_pending` instead**: the destination's count alone never writes off the source's books, so the shortfall waits for the source to acknowledge it. Nothing is shrunk here.\n\n**Idempotent** — a transfer already settled is returned unchanged. A repeat would create the destination lots twice, so one physical card would exist twice in the destination's books and be listed twice on its marketplaces.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "receipts"
                ],
                "properties": {
                  "receipts": {
                    "type": "array",
                    "minItems": 1,
                    "description": "One entry per line on the transfer — every line must be named, so a silent omission cannot be mistaken for a zero.\n",
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_sku_id",
                        "quantity_received"
                      ],
                      "properties": {
                        "tcgplayer_sku_id": {
                          "type": "integer",
                          "format": "int64"
                        },
                        "quantity_received": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The **cumulative** quantity confirmed for this line, not the quantity arriving in this request — the two differ only on a supplementary receive after a reopened write-off, where the operator enters what they now hold in total.\n\nMay not exceed `quantity_sent`: more than was sent is a miscount, not a receipt, and accepting it would invent stock the source never gave up. May not be below what was already received either — losing stock already on the destination's shelves is a shrinkage there, not an edit to this transfer.\n"
                        },
                        "location_uuid": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Destination bin. Required when `quantity_received` is non-zero; must belong to the destination store.\n"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The settled transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is not in transit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}/acknowledge-discrepancy": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "acknowledgeInventoryTransferDiscrepancy",
        "tags": [
          "Inventory"
        ],
        "summary": "Accept a short receipt and book the missing copies as shrinkage.",
        "description": "**Source store only, and that is the point.** A short receive parks the transfer in `discrepancy_pending` without shrinking anything, because the destination's count alone must never write off the source's books. This is the source operator saying the missing copies really are gone.\n\nBooks one `shrinkage_lost` ledger row per source lot behind the shortfall, so the shrinkage report shows the real cost basis rather than a blended average, and settles the transfer `received`.\n\nNothing is published to the marketplaces: those copies left the source's shelves at dispatch, so this moves the books, not a shelf quantity.\n\nIdempotent — an already-settled transfer is returned unchanged.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryTransferWriteOffRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The settled transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is not awaiting discrepancy acknowledgment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}/cancel-in-transit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "cancelInTransitInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Abandon a dispatched transfer that will never arrive.",
        "description": "The box left the source and is not coming back. Writes off the full outstanding quantity as shrinkage — the same acknowledgment-gated shape as accepting a short receipt — and moves the transfer to `canceled`.\n\nDistinct from `DELETE /v1/stores/{store_uuid}/transfers/{transfer_uuid}`, which cancels a **draft** by deleting it: a draft took no stock and left no trace to close out, while this one moved real cards and ends in a real loss.\n\nOnly from `in_transit`. Once the destination has counted anything, the transfer is a discrepancy to acknowledge rather than a shipment to abandon — cancelling would orphan stock already on the destination's shelves.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryTransferWriteOffRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The canceled transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is not in transit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}/reopen": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "reopenInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "The missing box turned up — reverse the write-off.",
        "description": "Reverses a shortfall write-off by compensating entry (never by deleting rows) and puts the transfer back to `in_transit`, so the destination settles it through the ordinary receive route. That keeps one settle implementation instead of a second one for late arrivals, and keeps a single conserved chain: source lot consumed → in transit → destination lot created.\n\nThe alternative — a supplementary receive without reversing — would book a loss at the source and a gain at the destination for copies that were never lost, and leave the destination lot with no cost basis to carry.\n\nSource store only, like the write-off it reverses. Requires an outstanding shortfall: a settled transfer that arrived in full has nothing to reverse and is refused.\n\nIdempotent — a transfer already back `in_transit` is returned unchanged. That covers a retry of a genuine reopen and, indistinguishably, a reopen of a transfer that was never written off; both leave the state and the books exactly as they were.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryTransferWriteOffRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The reopened transfer, back in transit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is not written off, or has no outstanding shortfall to reverse.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/transfers/{transfer_uuid}/dispatch": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "transfer_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "dispatchInventoryTransfer",
        "tags": [
          "Inventory"
        ],
        "summary": "Send a draft transfer — decrement the source and mark it in transit.",
        "description": "Moves a `draft` to `in_transit`: decrements the source's stock, consumes its cost lots FIFO, writes `transfer_out` ledger rows, and pushes the source's marketplace listings **down** (those copies are physically in a box). Source store only.\n\n**Idempotent.** A transfer already `in_transit` is returned unchanged — a retry or a double-click is a no-op, never a second decrement.\n\n**A line may only take stock that is genuinely free.** Two exclusions, both `422` with a `conflicts` array naming the lines and the reason: copies already sold but not yet picked off the shelf (`insufficient_available_stock`, since shipping those would sell them twice), and any SKU a picker is actively working in a run that is picking or ready to pack (`active_fulfillment_run`).\n\nA shortfall on **any** line fails the whole dispatch rather than sending a partial box — the operator needs to know before it ships, not at the far end.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The dispatched transfer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The transfer is not a draft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "One or more lines are not backed by available stock.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "conflicts": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/InventoryTransferConflict"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getInventorySettings",
        "tags": [
          "Inventory"
        ],
        "summary": "Get the store's default drip-listing target and printed-label config.",
        "description": "Returns `default_listed_target`, the store-wide fallback used for any SKU that has no per-SKU `listed_target`, and `label_config`, the store's printed-label format and (for the compact format) field pick-list. `label_config` reflects the store's saved `store_label_config` row when one exists, else the defaults (`standard` format, the pictured-model field set) -- see `label_config` on `InventorySettings`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Store's inventory settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettings"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "put": {
        "operationId": "putInventorySettings",
        "tags": [
          "Inventory"
        ],
        "summary": "Set the store's default drip-listing target and/or printed-label config.",
        "description": "`default_listed_target` and `label_config` are independent body keys: each updates only when its own key is present, leaving the other's stored value unchanged, so a body with only one key is a partial update, not a full replace. At least one of the two keys is required; a body with neither is a 422.\n\n`default_listed_target` is the store-wide fallback used when a SKU has no per-SKU `listed_target`. A per-SKU `listed_target` always overrides this default; the effective target per SKU is COALESCE(per-SKU listed_target, this value). This endpoint is lazy: it does not sweep existing inventory. Each SKU picks up the new default the next time that SKU is written. An explicit `null` still clears the store-wide default.\n\nSend `expected_default_listed_target` alongside it (the value the form loaded, `null` when it had none) to refuse the write with a 412 when another manager changed the default since. A 412 writes nothing, `label_config` included.\n\n`label_config`, when present, must be an object and is itself a partial update within its own two sub-fields -- see `label_config` on `InventorySettingsUpdate`.\n\nThe response mirrors GET: the resulting settings, including `label_config`, whether or not this request touched it.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventorySettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inventory settings updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySettings"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/config": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getKioskConfig",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Get the kiosk storefront config",
        "description": "Returns the store's in-store-pickup kiosk storefront configuration: publish state, browse default sort, and checkout options (phone requirement, pickup instructions, terms link, minimum order total, per-line quantity cap). Returns defaults (unpublished row) if the store hasn't configured its kiosk yet.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `kiosk:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The kiosk config.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskConfig"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "patchKioskConfig",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Update the kiosk storefront config",
        "description": "Partially updates the store's kiosk storefront config. Only the fields present in the request body are modified. Setting `is_published: true` makes the kiosk publicly visible at the store's public slug (edited via updateStore, not here) — refused with 422 `kiosk_publish_no_contact_email` if the store has no `poc_email` set, since order emails would have no one to reply to. A kiosk with nothing priced and in stock may be published; it fills in as stock arrives. A `root_location_uuid` that is a holding location or a non-listable bin or container is refused with 422 `kiosk_root_location_not_sellable`, since the kiosk could never show stock from it.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchKioskConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated kiosk config.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "Validation failed, including `kiosk_publish_no_contact_email` and `kiosk_root_location_not_sellable`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/bundles": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listKioskBundles",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "List the store's kiosk bundles",
        "description": "Every kiosk quantity bundle the store has, active or paused, earliest first. A bundle discounts kiosk cart lines in one game or carrying one tag once the cart holds at least `min_quantity` copies of them; the best price wins per line and bundles never stack. `tag_exists` is false for a tag bundle whose tag was deleted (it matches nothing) and null for a game bundle.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `kiosk:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's bundles.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "bundles"
                  ],
                  "properties": {
                    "bundles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KioskBundle"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createKioskBundle",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Create a kiosk bundle",
        "description": "Creates a kiosk quantity bundle. 422 for an unknown game, an invalid or automatic tag slug, `min_quantity` below 2, a percent outside (0, 100) or a negative fixed price; 409 `kiosk_bundle_limit_reached` once the store has 50 bundles.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKioskBundleRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created bundle.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskBundle"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/kiosk/bundles/{bundle_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "bundle_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "patch": {
        "operationId": "updateKioskBundle",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Update a kiosk bundle",
        "description": "Partially updates a bundle. Fields are validated against the resulting bundle, so `discount_value` alone is checked against the stored `discount_kind`, and `target_value` against the stored `target_kind`. 404 for a bundle that isn't this store's.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKioskBundleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated bundle.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskBundle"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteKioskBundle",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Delete a kiosk bundle",
        "description": "Deletes a bundle. Orders it already priced keep their own snapshot, so nothing about a placed order changes. 404 for a bundle that isn't this store's.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/canceled-bin": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getKioskCanceledBinContents",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "What is sitting in the kiosk canceled-order bin",
        "description": "Per-SKU contents of the bin named by `canceled_order_bin_location_uuid`, alongside how much of it is still owed back to a known origin bin. `total_quantity` is what a person will find on the shelf; `returnable_quantity` is what `returnKioskCanceledBinToOrigins` would move back; `unreturnable_quantity` is what it would write off instead, because the bin those copies came from no longer exists. The three are independent: stock can sit in the bin with no pending claim (put there by any other door), and a claim can outlive the stock it was written for (the copy sold out of the bin first), so a SKU appears if either side names it. Returns an empty `items` list with a null bin for a store that has designated none.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `kiosk:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The canceled-order bin's contents.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskCanceledBinContents"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/canceled-bin/return-to-original-bins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "returnKioskCanceledBinToOrigins",
        "tags": [
          "Kiosk Storefront Config"
        ],
        "summary": "Return the canceled-order bin's stock to the bins it came from",
        "description": "Moves each SKU in the canceled-order bin back to whichever bin the picker originally pulled it from, oldest cancellation first, capped by what the bin physically holds right now. Copies whose origin bin no longer exists cannot be returned; once a SKU's stock in the bin reaches zero, its still-open claims are written off in the same pass, since nothing can ever resolve them. Idempotent in the sense that matters to an operator: pressing it twice, or with an empty bin, or for a store that designated no bin, is a clean no-op returning empty lists.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "What moved and what was written off.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KioskCanceledBinReturnResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/intake": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "Idempotency-Key",
          "in": "header",
          "required": true,
          "description": "One key per user intent (not per click), reused across retries. Items without their own `idempotency_key` get one derived from this header and their position, so a duplicate request replays instead of adding the stock twice. A retry must resend the same items in the same order. Missing or blank returns 400 missing_idempotency_key. A key already used for a different SKU or quantity returns 422 idempotency_key_conflict and writes nothing. Two concurrent requests with the same key write once; the second replays the first.\n",
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "bulkIntakeInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Bulk intake new or additional inventory at caller-specified locations with cost capture.",
        "description": "Adds inventory at a caller-supplied location with unit cost. Creates the costed\nInventoryLot and the in-direction InventoryTransaction in one atomic write per item.\nPer-item idempotency: re-using a prior `idempotency_key` returns the prior result\nwithout writing again.\n\nEach item names either a `location_uuid` or an `absolute_chaos` container (never both). An\n`absolute_chaos` item needs `locations.manage` (403), may not carry `insert_position` (422), and\nis filed into new bins as each fills; 409 `absolute_chaos_container_busy` while an import is\nfiling into the same container, 409 `holding_move_refused` for a holding container, 404 for a\ncontainer that is missing or deleted. With `absolute_chaos.bin_uuid`, every copy goes at the back\nof that bin, and a request that does not fit is refused 422 `absolute_chaos_bin_full`, writing nothing.\n\n`retail_price` is narrower than the route: it needs the\n`inventory.set_sell_price` permission (store_manager and above unless the store\nhas configured otherwise), and a caller without it is refused 403 rather than\nhaving the price silently dropped. Cost (`unit_cost`) carries no such\nrestriction -- it is a fact about the purchase, known by whoever took the cards\nin. Omit `retail_price` and repricing sets the listing price on its next run.\n\n`lock_price` locks the price an item sets as part of the same write, and needs\nthe `inventory.manage_price_locks` permission that `createPriceLock` does.\n\n`reserve_quantity` holds some of the item's own units back for in-store use, in\nthe same transaction, so those copies are never listed. It adds to whatever the\nSKU already reserves. Up to the item's `quantity` it carries no role\nrestriction: which copies stay behind the counter is a decision for whoever is\nstanding at it. Above it the reserve also holds back copies the SKU already\nhad, which needs the `inventory.reserve_beyond_intake` permission\n(store_manager and above unless the store has configured otherwise); a caller\nwithout it is refused 403.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/IntakeItem"
                },
                "minItems": 1,
                "maxItems": 250
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Intake accepted; at least one item was a fresh write.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntakeResult"
                  }
                }
              }
            }
          },
          "200": {
            "description": "All items were idempotent replays of prior intakes.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/IntakeResult"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/products/{tcgplayer_product_id}/inventory": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "getProductInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "List the store's inventory for one TCGPlayer product",
        "description": "Lists the SKU variants the store owns for the given `tcgplayer_product_id`, with per-location quantities. With no filter params it lists every SKU at every location; with them, only the copies the matching grid row counts: the location filters (`location_uuid`, `bin:`, `container:`) drop the locations outside them, the per-SKU filters (condition, language, finish and their negations, and price) drop SKUs, and a SKU left with no location is not listed. Returns an empty list if the store owns nothing (or nothing matches).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The grid's `search`, so the expanded row lists the copies its grid row counts (#2591): `cond:` / `lang:` / `finish:` / `is:foil|nonfoil|etched` (and their negations) and the price operators (`usd:`, `selling_usd:`, `buylist_usd:`) narrow the SKUs, and `bin:` / `container:` narrow the locations listed. Price matches per SKU unless `is:whole_card` is present. `tag:` and product operators do not narrow it. Omit to list every SKU.\n"
          },
          {
            "in": "query",
            "name": "condition",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list, as on listInventory; narrows the SKUs listed."
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list, as on listInventory; narrows the SKUs listed."
          },
          {
            "in": "query",
            "name": "finish",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list, as on listInventory; narrows the SKUs listed."
          },
          {
            "in": "query",
            "name": "price_min",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Per SKU: lists only copies priced at or above this."
          },
          {
            "in": "query",
            "name": "price_max",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Per SKU: lists only copies priced at or below this."
          },
          {
            "in": "query",
            "name": "location_uuid",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "As on listInventory (this location or anywhere beneath it); lists only the locations inside it, and only SKUs held there."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "A path id doesn't match anything (`inventory_item_not_found`, `product_not_found`, `sku_not_found`, `lot_not_found`, `label_template_not_found`, `delete_job_not_found`, `label_export_job_not_found`, `resync_job_not_found`, `transfer_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "List of owned SKU variants for the product",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductInventoryVariant"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/products/{tcgplayer_product_id}/inventory/history-skus": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "listProductHistorySkus",
        "tags": [
          "Inventory"
        ],
        "summary": "List the product's SKU variants with inventory history at the store",
        "description": "The product's SKU variants that have at least one inventory transaction at this store, in or out of stock, sorted by SKU id. Feeds the card detail page's history selectors, so a sold-out variant's history stays reachable. The ledger is the record of \"ever stocked\": a sold-out storage row is often removed, and a zero row can exist for a variant that never held a copy. Stock older than the ledger has no transaction, so callers list this alongside the in-stock variants (getProductInventory). An unknown product, or one with no history at the store, returns an empty list.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKU variants with inventory history",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SkuVariant"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/catalog/sku-lookup": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "lookupCatalogSkus",
        "tags": [
          "Inventory"
        ],
        "summary": "Look up the SKUs of a card, to add one the store has never stocked",
        "description": "Finds the `tcgplayer_sku_id` values for a card, one row per SKU (one condition, language and finish of one printing), so a card the store has never stocked can be added with `createInventory` or `bulkUpsertInventory`. Look a card up by `tcgplayer_product_id`, or by `game` and `name`; at least one of the two is required. The other filters only narrow. This is not a catalog browse: there is no search across games and no partial match inside a name, and a lookup that matches more than 500 catalog products is refused (`sku_lookup_too_broad`) rather than paged. Rows are sorted by product name, set name, collector number, product id and SKU id. A store's own graded slabs are not listed; they are store items.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "parameters": [
          {
            "name": "tcgplayer_product_id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "The TCGplayer product id. Matches a base printing and its etched and alternative-foil products alike. Required unless `game` and `name` are sent.\n"
          },
          {
            "name": "game",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The game, case-insensitive. Required with `name` when there is no `tcgplayer_product_id`. One of magic, pokemon, lorcana, onepiece, riftbound, unionarena, pokemonjp, gundam, starwars, yugioh, cyberpunk, palworld, digimon, fleshblood, cookierun, sleeves, sorcery, wow, deckboxes, playmats, binders, colstorage, counters, vanguard, dbsmasters, dbsfusion, weiss.\n"
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 200
            },
            "description": "The card name, matched from its start (`name_match=prefix`, the default) or in full (`name_match=exact`), case-insensitively and ignoring accents, against the product name or the card name (the name without the printing qualifiers TCGplayer adds outside Magic). At least 3 characters, with a letter or number. `%` and `_` match themselves. Required with `game` when there is no `tcgplayer_product_id`.\n"
          },
          {
            "name": "name_match",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "prefix",
                "exact"
              ],
              "default": "prefix"
            },
            "description": "How `name` matches: `prefix` finds every card whose name starts with it (`Lightning` finds Lightning Bolt and Lightning Helix), `exact` only the card with that whole name.\n"
          },
          {
            "name": "set_code",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 20
            },
            "description": "The set code (e.g. MKM, DSK), case-insensitive and exact."
          },
          {
            "name": "collector_number",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 50
            },
            "description": "The collector number, case-insensitive, ignoring leading zeros and a printed set total: `74` matches `074/198`.\n"
          },
          {
            "name": "condition",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One condition, case-insensitive: Near Mint, Lightly Played, Moderately Played, Heavily Played, Damaged, Unopened.\n"
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One language, case-insensitive: English, Chinese (S), Chinese (T), French, German, Italian, Japanese, Korean, Portuguese, Portuguese (Brazil), Russian, Spanish.\n"
          },
          {
            "name": "finish",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One finish, case-insensitive: normal, foil, etched, alternative_foil, holofoil, reverse_holofoil, 1st_edition, 1st_edition_holofoil, unlimited, unlimited_holofoil, cold_foil, limited, rainbow_foil, 1st_edition_cold_foil, 1st_edition_rainbow_foil, unlimited_rainbow_foil.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 25
            },
            "description": "SKUs per page, 1 to 50. Over 50 is refused (422 `query_param_invalid`)."
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The matching SKUs, one page",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSkuLookupPage"
                }
              }
            }
          },
          "400": {
            "description": "A query parameter was malformed or not one of its allowed values (`query_param_invalid`, with `validation_errors` naming the parameter): a product id that is not a whole number, or a game, condition, language, finish or name match outside its list.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "`validation_error` when neither a product id nor a game and name was sent (the field named is the one missing), or when the name is shorter than 3 characters, has no letter or number, or a text filter is too long. `query_param_invalid` when the limit is over 50 or the offset is negative. `sku_lookup_too_broad` when more than 500 catalog products match; add a set code or collector number, or a longer name.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the lookup and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "getSkuInventoryHistorySummary",
        "tags": [
          "Inventory"
        ],
        "summary": "Current-state and audit summary for one SKU's inventory",
        "description": "Reconstructs \"what happened to this SKU's stock\" without a manual SQL query: the store-level aggregate (what marketplaces see) versus the per-location breakdown, flagged when they disagree; recent manual quantity/quantity_visible edits reconstructed from the audit log (the only record of a quantity_visible-only edit, which never reaches the transaction ledger); and marketplace-sync-rejection / pull-alert context. For the full paginated quantity changelog, see GET .../history/changelog. The SKU's `tcgplayer_product_id` is resolved server-side from the catalog; a SKU the catalog doesn't know is a 404 (`sku_not_found`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKU inventory history summary",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkuInventoryHistorySummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/history/changelog": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "getSkuInventoryChangelog",
        "tags": [
          "Inventory"
        ],
        "summary": "Cursor-paginated quantity changelog for one SKU",
        "description": "Every inventory_transactions row for this SKU, newest first. order_sale rows are enriched with the linked order/order_item and an oversell_detected flag (the transaction floors at available stock, so a real oversell shows order_item_quantity > abs(quantity_delta)). A SKU the catalog doesn't know is a 404 (`sku_not_found`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "reason_code",
            "in": "query",
            "description": "Narrow to a single inventory_transactions reason_code.",
            "schema": {
              "$ref": "#/components/schemas/InventoryTransactionReasonCode"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/Count"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated transaction changelog",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedInventoryTransactionList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/history/moves": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "listSkuLocationMoves",
        "tags": [
          "Inventory"
        ],
        "summary": "Cursor-paginated bin-to-bin moves for one SKU",
        "description": "Every time copies of this SKU moved from one bin to another, newest first: a transfer, a bulk move, a merge, a CSV relocation or a move undo. A move changes where copies sit, not what the store owns, so it writes no changelog row; this is the other half of a card's history. Same `limit` / `after` / `count` contract and `(created_at, id)` order as getSkuInventoryChangelog, so a client can merge the two by `created_at`. Paths are the bins' names when the move was made. Moves made before this was recorded are not listed. A SKU the catalog doesn't know is a 404 (`sku_not_found`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/Count"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated moves",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedLocationMoveList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "getInventoryBySku",
        "tags": [
          "Inventory"
        ],
        "summary": "Get a single inventory item by SKU",
        "description": "Returns full inventory detail for one SKU — price, per-location quantities, and any marketplace price overrides — with an ETag for optimistic concurrency. Returns 404 if the store does not stock the SKU.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateInventoryBySku",
        "tags": [
          "Inventory"
        ],
        "summary": "Update an inventory item's price or quantity by SKU",
        "description": "Partially updates one SKU's quantity, visible quantity, or price in a single transaction and returns the updated detail with a new ETag. Honors the If-Match ETag (412 on mismatch); If-Match is required (428 without it) when the body changes `quantity` or `quantity_visible`; a body that changes `price`, `listed_target` or `reserved_for_store` must carry `expected_pricing_updated_at` (428 without it, 412 if the SKU's pricing row has changed since); returns 404 if the SKU is not stocked and 422 if visible quantity exceeds quantity or the price is invalid. A quantity decrease is a removal and requires `reason` (one of RemovalReason); supplying `reason` on a non-decrease is rejected with 422. A quantity write on a SKU stocked at several positions of one location needs `slot` (422 without it).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "price": {
                    "type": "number",
                    "format": "double",
                    "description": "New price in USD. Requires the `inventory.set_sell_price` permission (store_manager and above by default). Unlike the create and bulk paths, an explicit null here CLEARS the price and unlists the card, so it needs the same permission.\n"
                  },
                  "purchase_price": {
                    "type": "number",
                    "format": "double",
                    "description": "Per-unit acquisition cost (COGS), only applied to newly added quantity.\n"
                  },
                  "quantity": {
                    "type": "integer",
                    "description": "New quantity"
                  },
                  "quantity_visible": {
                    "type": "integer",
                    "description": "New visible quantity"
                  },
                  "slot": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The position (storage row) a `quantity` / `quantity_visible` write targets, from the `slot` the read returned. Omit it when the SKU has one stocked row in its location; a quantity write without it on a SKU stocked at several positions in one location is a 422 naming the slots.\n"
                  },
                  "expected_pricing_updated_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "**Required when the body changes `price`, `listed_target` or `reserved_for_store`** (428 without it). Send the `pricing_updated_at` this SKU's own read returned, or null if it returned null. If the SKU's pricing row has changed since (another editor, a repricing run), the request is rejected with 412 and nothing is written. Must be a UTC-offset ISO 8601 timestamp.\n"
                  },
                  "listed_target": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
                  },
                  "reserved_for_store": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Per-SKU quantity held back from online marketplaces for in-store use (e.g. walk-in customers), independent of `listed_target`. There is no store-wide default; null means no reserve, and `0` is accepted as a synonym for null (it is stored as null, so reads never return 0). Setting or raising the reserve pulls the listing down and pushes the change to marketplaces; lowering or clearing it applies on the next write only (no automatic relist).\n"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Replaces this SKU's note. Capped at 2000 characters. An explicit `null` (or empty string) clears the note; omitting the field leaves the existing note unchanged.\n"
                  },
                  "reason": {
                    "$ref": "#/components/schemas/RemovalReason"
                  },
                  "note": {
                    "type": "string",
                    "description": "Optional operator note stored on the ledger movement. Only meaningful on a quantity decrease.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Inventory updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "409": {
            "description": "`lot_cost_locked`: copies this removal takes out of stock are being updated (a cost batch they are in is being finished, or they kept changing). Try again in a minute.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete a single inventory item by SKU",
        "description": "Permanently removes a SKU's inventory row and its pricing data from the store. A delete is a removal, so it requires a `reason` (one of RemovalReason) passed as a query parameter, plus an optional `note`; before the rows are dropped the removal is recorded in the inventory ledger. Returns 204 on success, 404 if the SKU is not stocked, and 422 if the reason is missing or invalid.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "reason",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/RemovalReason"
            },
            "description": "Why the stock is being removed."
          },
          {
            "name": "note",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional operator note stored on the ledger movement."
          }
        ],
        "responses": {
          "204": {
            "description": "Inventory deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Done, but the marketplace sync event could not be queued (`marketplace_sync_not_queued`). Answered instead of 204; the listings catch up within about 30 minutes.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarningsOnlyResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`lot_cost_locked`: copies this removal takes out of stock are being updated (a cost batch they are in is being finished, or they kept changing). Try again in a minute.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/cogs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "patch": {
        "operationId": "updateInventoryCogs",
        "tags": [
          "Inventory"
        ],
        "summary": "Correct a SKU's cost basis (COGS)",
        "description": "Corrects the unit cost of a SKU's stock already on hand — for fixing a wrong cost entered on intake, import, or manual add. Rewrites the cost basis on every FIFO lot still in stock to the given value; a SKU stocked before cost tracking existed gets one lot created for its current quantity. Only affects the cost of *future* sales/removals — orders already fulfilled keep the margin they were costed at when sold, since that is frozen at fulfillment time. Returns 404 if the SKU is not stocked and 422 if `unit_cost` is missing or negative.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "unit_cost"
                ],
                "properties": {
                  "unit_cost": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "description": "Corrected per-unit cost (COGS), in the store's currency."
                  },
                  "note": {
                    "type": "string",
                    "description": "Optional operator note explaining the correction. Logged to telemetry; not stored on the inventory ledger (a cost-only correction has no quantity movement to attach a ledger row to).\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Inventory detail after the correction.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A lot this would rewrite is in a cost batch that is not finished; its cost is set when the batch is finished.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/lots": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "listInventoryLots",
        "tags": [
          "Inventory"
        ],
        "summary": "List a SKU's open cost lots",
        "description": "Lists the SKU's open FIFO lots (`remaining_quantity > 0`), oldest first — the same order they are consumed in on a sale. A store stocking the same card at different times/prices ends up with several lots, each carrying the cost of that batch; this is what lets a correction target one batch instead of the whole SKU (see `PATCH .../lots/{lot_id}/cogs`). Returns an empty list if the SKU is not stocked or has no lots (e.g. it predates lot tracking and was never corrected via the whole-SKU cogs endpoint, which would have backfilled one). Each lot names its cost batch and says whether it is `editable`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "A path id doesn't match anything (`inventory_item_not_found`, `product_not_found`, `sku_not_found`, `lot_not_found`, `label_template_not_found`, `delete_job_not_found`, `label_export_job_not_found`, `resync_job_not_found`, `transfer_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Open lots for the SKU, oldest first.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lots"
                  ],
                  "properties": {
                    "lots": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryLotSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/lots/{lot_id}/cogs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        },
        {
          "$ref": "#/components/parameters/LotId"
        }
      ],
      "patch": {
        "operationId": "updateInventoryLotCogs",
        "tags": [
          "Inventory"
        ],
        "summary": "Correct one lot's cost basis (COGS)",
        "description": "Corrects the unit cost of exactly one open FIFO lot, for a store that received the same SKU at different prices and only wants to fix one batch — the sibling whole-SKU `PATCH .../cogs` rewrites every open lot, which is only right when the whole SKU's cost was wrong across the board. Only affects the cost of *future* sales/removals from this lot — orders already fulfilled keep the margin they were costed at, frozen at fulfillment time. Returns 404 if the lot doesn't exist, doesn't belong to this store/SKU, or is exhausted (`remaining_quantity == 0`), and 422 if `unit_cost` is missing or negative.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "unit_cost"
                ],
                "properties": {
                  "unit_cost": {
                    "type": "number",
                    "format": "double",
                    "minimum": 0,
                    "description": "Corrected per-unit cost (COGS), in the store's currency."
                  },
                  "note": {
                    "type": "string",
                    "description": "Optional operator note explaining the correction. Logged to telemetry; not stored on the inventory ledger (a cost-only correction has no quantity movement to attach a ledger row to).\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Inventory detail after the correction.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A lot this would rewrite is in a cost batch that is not finished; its cost is set when the batch is finished.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/bulk-reserve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "bulkReserveInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Set or clear reserved_for_store for many inventory items at once",
        "description": "Batch-writes reserved_for_store across a set of SKUs, resolved either from an explicit tcgplayer_sku_ids list or from filters (the same listing-filter vocabulary the move-cards endpoint accepts — no color or language key). Exactly one of the two selection modes must be supplied; a filters object matching no in-stock SKUs, or an unsupported filter key, is a 422. reserved_for_store is required; null or 0 clears the reserve. Runs through the same batch-upsert path as PATCH /inventory, so pull-down and marketplace-sync semantics are identical to a manual bulk PATCH.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkReserveInventoryRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Updated inventory summaries for every resolved SKU.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkReserveInventoryResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/bulk-delete": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "bulkDeleteInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete many inventory items by SKU or product",
        "description": "Best-effort bulk delete. Accepts tcgplayer_sku_ids and/or tcgplayer_product_ids (at least one non-empty). Every requested SKU that exists in the store is removed entirely (all locations + pricing); supplying product ids removes every in-store SKU of those products. Ids not present are returned in not_found / not_found_product_ids. 200 on any well-formed request.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteInventoryRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Per-SKU delete result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteInventoryResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`lot_cost_locked`: copies this removal takes out of stock are being updated (a cost batch they are in is being finished, or they kept changing). Try again in a minute.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/last-sold": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "importLastSoldDates",
        "tags": [
          "Inventory"
        ],
        "summary": "Upload last sold dates for SKUs",
        "description": "Records when each SKU last sold, for sales history from before HippoLink. A date only replaces the stored one when it is later. Pricing rules, the inventory list and Generate Bulk read the later of this date and the store's order history. At most 5,000 rows per call. A call with any bad row is refused whole (`last_sold_rows_invalid`, `params.rows` names each bad row by index) and writes nothing.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportLastSoldDatesRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Rows written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportLastSoldDatesResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "A row has a missing or unreadable SKU id or date, or a date more than a day in the future, or the call has no rows or too many (`last_sold_rows_invalid`). Nothing was saved.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/delete-jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createInventoryDeleteJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete every in-stock product matching a filter (async, Gmail-style \"select all\")",
        "description": "Kicks off an async job that resolves `filters` server-side (the same listing-filter shape and resolver `GET /inventory` uses) and deletes every matching product's in-store SKUs in chunks, keyset-paginated so it scales to a whole store. Additive alongside the synchronous `POST .../inventory/bulk-delete`, which stays for page-level / explicit-id selections; this endpoint is for \"select all N matching\" after a `HEAD /inventory?<filters>` preview. Returns 202 with the job to poll for status.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryDeleteJobRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Delete job accepted (or replayed via Idempotency-Key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDeleteJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "The job queue is unavailable (`job_queue_unavailable`); nothing was started. Retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "operationId": "listInventoryDeleteJobs",
        "tags": [
          "Inventory"
        ],
        "summary": "List a store's inventory delete-all jobs",
        "description": "Lists the store's delete-all jobs, newest first. Defaults to the still-in-flight jobs (pending or running) -- at most one, per the one-in-flight concurrency lock -- so the frontend can show progress or refuse a second \"select all\" while one is running; pass `status=all` to include finished jobs.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "all"
              ],
              "default": "active"
            },
            "description": "active (default) returns only pending/running jobs; all returns every delete job for the store, newest first.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The store's delete-all jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDeleteJobList"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/delete-jobs/{job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "get": {
        "operationId": "getInventoryDeleteJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Get the status of an inventory delete-all job",
        "description": "Returns the status of an async delete-all job, including how many products have been deleted so far and the total once known. Returns 404 if no such job exists for the store.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete job status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDeleteJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/delete-jobs/{job_uuid}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "post": {
        "operationId": "cancelInventoryDeleteJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Cancel an in-flight inventory delete-all job",
        "description": "Cooperatively cancels a pending/running delete-all job: the worker checks status between chunks and stops early. Already-deleted products stay deleted -- cancel stops future chunks, it does not undo completed ones. Also clears the one-in-flight lock, so a fresh delete-all can start immediately after.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled delete job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryDeleteJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/label-jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createInventoryLabelExportJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Print labels for a filter or a whole location (async)",
        "description": "Kicks off an async job that prints labels for either every product matching `filters` (the same listing-filter shape and resolver `GET /inventory` uses, Gmail-style \"select all\") or everything stocked in one `location_uuid` (a bin, or a container's whole subtree). Send exactly one of the two. The job expands the match to its SKUs and renders the labels. Up to 500 labels come back as one PDF; a larger print is split into PDFs of up to 500 labels each and delivered as one ZIP. Additive alongside the synchronous `POST .../inventory/labels`, which stays for page-level / explicit-id selections and prints at most 250 labels; a bin or location over 250 labels uses this route instead. Returns 202 with the job to poll for status; unlike delete-jobs there is no list or cancel route -- a label export is one-shot, so create + a single poll by id covers the whole lifecycle. Only one label job runs per store at a time: a second create answers 409 `label_export_job_in_progress` with the running job's id in `params.job_uuid`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryLabelExportJobRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Label export job accepted (or replayed via Idempotency-Key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLabelExportJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "The job queue is unavailable (`job_queue_unavailable`); nothing was started. Retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The location_uuid names no live location in this store (`location_not_found`): it doesn't exist, was deleted, or belongs to another store.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "A label job is already pending or running for this store (`label_export_job_in_progress`); `params.job_uuid` names it. A running job that has gone ten minutes without progress is closed as `label_export_stalled` and stops blocking.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/label-jobs/{job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "get": {
        "operationId": "getInventoryLabelExportJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Get the status of an inventory label-export job",
        "description": "Returns the status of an async label-export job. Once `status` is `completed`, `download_url` is a presigned S3 URL for the result: a PDF when `file_count` is 1, a ZIP of `file_count` PDFs otherwise. The URL is presigned afresh on every read, so re-read the job for a new link. A running job that has gone ten minutes without progress is failed with `error_code` `label_export_stalled` by this read. Returns 404 if no such job exists for the store. A finished job whose download link can't be made answers 503 `label_download_unavailable`; read again in a moment.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Label export job status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryLabelExportJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The job finished but its download link couldn't be made (`label_download_unavailable`). Read again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/resync-jobs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listMarketplaceResyncJobs",
        "tags": [
          "Inventory"
        ],
        "summary": "List a store's marketplace resync jobs",
        "description": "Lists the store's marketplace force-resync jobs across every marketplace, newest first. Defaults to the still-in-flight jobs (pending or running) so an admin can see what is resyncing right now and cancel any that are misbehaving; pass status=all to include finished jobs.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "all"
              ],
              "default": "active"
            },
            "description": "active (default) returns only pending/running jobs; all returns every resync job for the store, newest first.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The store's resync jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResyncJobList"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/listing-drift": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "CARDMARKET",
              "CARD_NEXUS",
              "CARD_TRADER",
              "EBAY",
              "LIGHTSPEED",
              "MANA_POOL",
              "MISPRINT",
              "SHOPIFY",
              "SNAPCASTER",
              "SQUARE",
              "TCGPLAYER"
            ]
          },
          "description": "Marketplace whose live audit findings to list."
        }
      ],
      "get": {
        "operationId": "listMarketplaceListingDrift",
        "tags": [
          "Inventory"
        ],
        "summary": "List the cards a marketplace disagrees with HippoLink about",
        "description": "The per-card findings of the latest completed live audit of this marketplace: cards for sale there that HippoLink is not offering (`extra`), cards listed on both sides at a different quantity (`quantity`) or price (`price`), and cards HippoLink would list that the marketplace does not have (`missing`). This is what the `<MARKETPLACE>_LISTING_DRIFT` store alert counts. `audited_at` is null when the marketplace has never been audited for this store.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "extra",
                "quantity",
                "price",
                "missing"
              ]
            },
            "description": "Only findings in this direction. Omit for every direction."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "kept"
              ],
              "default": "open"
            },
            "description": "open: findings still waiting on the store. kept: cards the store marked as listed on purpose.\n"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of findings, with per-direction counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingDrift"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/listing-drift/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "CARDMARKET",
              "CARD_NEXUS",
              "CARD_TRADER",
              "EBAY",
              "MANA_POOL",
              "MISPRINT",
              "SHOPIFY",
              "SNAPCASTER",
              "SQUARE",
              "TCGPLAYER"
            ]
          },
          "description": "Marketplace the cards are listed on."
        }
      ],
      "post": {
        "operationId": "removeMarketplaceListingDrift",
        "tags": [
          "Inventory"
        ],
        "summary": "Take down listings the store confirms it does not hold",
        "description": "For cards in the `extra` direction of the latest live audit, sets their quantity on the marketplace to 0 through the ordinary push. Use it for a listing HippoLink is not offering that the store does not hold, such as a card sold out here but still for sale there.\n\nOn TCGPLAYER and MANA_POOL this is the only way HippoLink takes down a listing it is not offering: nothing marks a listing there as HippoLink's, so it cannot tell one the store listed by hand from one it lost track of, and never removes one on its own. The caller is confirming, card by card, that the listing should go.\n\nEach card is checked against the latest audit when the request arrives, and the push reads the card's stock again when it runs, so a card restocked since the audit is pushed at its real quantity instead of removed. The listing leaves the findings at the next audit that no longer sees it; until then its `removal_requested_at` is set. Removing a kept card ends the keep. Cards that cannot be removed are returned in `skipped` with a reason; the request itself still succeeds.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceListingDriftActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cards queued for removal, and the ones skipped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingDriftActionResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/listing-drift/keep": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "CARDMARKET",
              "CARD_NEXUS",
              "CARD_TRADER",
              "EBAY",
              "MANA_POOL",
              "MISPRINT",
              "SHOPIFY",
              "SNAPCASTER",
              "SQUARE",
              "TCGPLAYER"
            ]
          },
          "description": "Marketplace the cards are listed on."
        }
      ],
      "post": {
        "operationId": "keepMarketplaceListingDrift",
        "tags": [
          "Inventory"
        ],
        "summary": "Mark listings as ones the store keeps on purpose",
        "description": "For cards in the `extra` direction of the latest live audit, records that the store lists them itself. A kept card leaves the open findings, the per-direction counts and the `<MARKETPLACE>_LISTING_DRIFT` alert, and lists under `state=kept`. The keep lasts until an audit sees a different quantity listed, since the store's answer may not hold for the new one. Keeping a kept card is accepted and changes nothing.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceListingDriftActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cards kept, and the ones skipped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingDriftActionResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/listing-drift/unkeep": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "CARDMARKET",
              "CARD_NEXUS",
              "CARD_TRADER",
              "EBAY",
              "MANA_POOL",
              "MISPRINT",
              "SHOPIFY",
              "SNAPCASTER",
              "SQUARE",
              "TCGPLAYER"
            ]
          },
          "description": "Marketplace the cards are listed on."
        }
      ],
      "post": {
        "operationId": "unkeepMarketplaceListingDrift",
        "tags": [
          "Inventory"
        ],
        "summary": "Return kept listings to the open findings",
        "description": "Undoes `keepMarketplaceListingDrift`: the cards list as open findings again and count toward the `<MARKETPLACE>_LISTING_DRIFT` alert from the next audit.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceListingDriftActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cards no longer kept, and the ones skipped.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceListingDriftActionResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/resync": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "EBAY",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER",
              "LIGHTSPEED",
              "WHATNOT"
            ]
          },
          "description": "Target marketplace to force-resync."
        }
      ],
      "post": {
        "operationId": "forceResyncMarketplace",
        "tags": [
          "Inventory"
        ],
        "summary": "Force-resync a store's inventory on a marketplace",
        "description": "Kicks off an async job that brings the store's listings on the given marketplace back into step with HippoLink. Both scopes enumerate the marketplace itself rather than HippoLink's inventory, and they differ in what they then do with it.\n\ndelete \"tracked\" is a **reconcile**: it compares the marketplace's live listings against what HippoLink says should be listed and writes only the difference — delisting what is live but not sellable here, and pushing what is missing or listed at the wrong quantity or price. A marketplace already in step costs one enumeration and no writes. Available to store owners and managers on every marketplace.\n\ndelete \"all\" is a **teardown**: it wipes every listing on the marketplace and re-pushes the store's entire inventory. Restricted to sys-admins (enforced server-side). Use it when a reconcile cannot reach the problem — duplicate listings, or listings HippoLink can no longer attribute. One exception: on EBAY, delete \"all\" with repopulate false (delist before disconnecting) is available to store owners and managers, because eBay's teardown only removes listings with a HippoLink SKU.\n\nWhat a reconcile will not delist: on TCGPLAYER and MANA_POOL nothing marks a listing as HippoLink's, so an extra listing there cannot be told apart from one the store hand-listed. Those are reported in the job's \"diff\" and left alone; drift is repaired by pushing only.\n\nReturns the job to poll for status.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceResyncRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Resync job accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResyncJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/resync/{resync_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER",
              "LIGHTSPEED",
              "WHATNOT"
            ]
          },
          "description": "Marketplace the resync job targets."
        },
        {
          "name": "resync_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "UUID of the resync job to fetch."
        }
      ],
      "get": {
        "operationId": "getMarketplaceResyncJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Get the status of a marketplace resync job",
        "description": "Returns the status of an async marketplace resync job, including the deleted and pushed listing counts and timestamps. Returns 404 if no such job exists for the store and marketplace.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Resync job status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResyncJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplaces/{marketplace}/resync/{resync_job_uuid}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER",
              "LIGHTSPEED",
              "WHATNOT"
            ]
          },
          "description": "Marketplace the resync job targets."
        },
        {
          "name": "resync_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          },
          "description": "UUID of the resync job to cancel."
        }
      ],
      "post": {
        "operationId": "cancelMarketplaceResyncJob",
        "tags": [
          "Inventory"
        ],
        "summary": "Cancel a marketplace resync job",
        "description": "Cancels a still-pending or running marketplace resync job — useful when a job is stuck in flight. The job transitions to the terminal \"cancelled\" state; the worker stops at the next chunk boundary and the in-progress lock is released so a fresh resync can be started. Already-finished jobs (completed, failed, or cancelled) return 409. Returns 404 if no such job exists for the store and marketplace.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The cancelled resync job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResyncJob"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/price-lock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "post": {
        "operationId": "createPriceLock",
        "tags": [
          "Inventory"
        ],
        "summary": "Lock a SKU's retail price against reprice rules.",
        "description": "Locks the pricing_data row's retail_price so subsequent reprice runs skip it. Rollback explicitly ignores this lock. Idempotent via 409 (re-locking an already-locked row returns conflict rather than silent success).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Lock created.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "removePriceLock",
        "tags": [
          "Inventory"
        ],
        "summary": "Remove a SKU's price lock.",
        "description": "Removes a SKU's price lock so reprice rules can change its price again. Returns 204 on success, 404 if the SKU has no pricing row, and 409 if it is not currently locked (`price_lock_not_set`), is locked only by a bin's standing price lock, which this cannot remove (`price_lock_from_bin`), or is a store item such as a graded slab, whose lock never lifts (`price_lock_permanent`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Lock removed.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/products/{tcgplayer_product_id}/price-lock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "post": {
        "operationId": "lockProductPrices",
        "tags": [
          "Inventory"
        ],
        "summary": "Lock every priced SKU of a product against reprice rules.",
        "description": "Bulk-locks the pricing_data rows for all of the store's priced SKUs of the product — every condition/language/finish of that printing — so subsequent reprice runs skip them. Idempotent: re-locking already-locked SKUs is not an error. Stocked SKUs with no price row cannot be locked and are reported via skipped_unpriced. Rollback explicitly ignores the lock.\n\nNeeds no inventory. pricing_data rows survive a sell-down, so a card the store sold out of locks through the ordinary path. A card the store has never priced has no row at all: the lock creates one per catalog SKU, priceless and locked, which repricing already reads as \"do not put a price on this card\" (it is excluded from first-pricing, and the reprice UPDATE carries NOT price_locked). Those rows are reported via created. 404 is now only for a product that is not in the catalog.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKUs locked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "locked",
                    "skipped_unpriced"
                  ],
                  "properties": {
                    "locked": {
                      "type": "integer",
                      "description": "Number of the store's priced SKUs of this product that are now locked."
                    },
                    "skipped_unpriced": {
                      "type": "integer",
                      "description": "Stocked SKUs of this product with no pricing_data row, which therefore could not be locked. Only non-zero alongside SKUs that do have one: a product the store neither prices nor stocks gets rows created instead, counted under created.\n"
                    },
                    "created": {
                      "type": "integer",
                      "description": "Priceless locked pricing_data rows this call created, for a product the store had neither priced nor stocked. 0 on every other path. Absent from responses served before this field existed, hence not required.\n"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "unlockProductPrices",
        "tags": [
          "Inventory"
        ],
        "summary": "Remove the price lock from every SKU of a product.",
        "description": "Bulk-unlocks all of the store's priced SKUs of the product. Idempotent: unlocking SKUs that are not locked is not an error. Unlike the lock, this keeps the stricter 404: with neither a price row nor stock there is no lock to lift, and a store can only be in that state by never having locked the card. A store item such as a graded slab is a 409 `price_lock_permanent`: nothing reprices it, so its lock never lifts.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKUs unlocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unlocked"
                  ],
                  "properties": {
                    "unlocked": {
                      "type": "integer",
                      "description": "Number of SKUs of this product that were unlocked by this call."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/search-suggestions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "suggestInventorySearchValues",
        "tags": [
          "Inventory"
        ],
        "summary": "Suggest values for the inventory search box's `set:`, `r:` and `tag:`.",
        "description": "Type-ahead for the operators whose values are data rather than a fixed vocabulary (#2417). `field=set` returns set codes (as they would be typed after `set:`) with the set name as the label; `field=rarity` returns rarities exactly as stored (what `r:` matches, not a per-game vocabulary); `field=tag` returns the store's own tags plus the system ones it has not used yet.\n\nSets and rarities are catalog facts, not the store's stock: every set in the catalog is offered whether or not the store holds a card from it. That is deliberate: a store-scoped distinct-set read is a per-SKU join that takes seconds on a large store, which does not fit a per-keystroke path. The list is held in memory per container and refreshed hourly, so a new set appears within the hour of the catalog ingesting it.\n\nMatching is case- and diacritic-insensitive. A code match ranks above a name match, a prefix above a word-start above a substring, and within a rank the newest set comes first. An empty `q` returns the newest sets (or the first rarities / tags), which suits a bare `set:`. Nothing in the response is cost data or another store's data.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "set",
                "rarity",
                "tag"
              ]
            },
            "description": "Which operator's values to suggest."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "What the user has typed after the operator so far. May be empty."
          },
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Restrict `set` and `rarity` to one game. Omit to search every game (rarity suggestions are then de-duplicated across games). Ignored for `tag`.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The best matches, best first.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventorySearchSuggestions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/hotlist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listHotlistProducts",
        "tags": [
          "Inventory"
        ],
        "summary": "List every card on the store's hotlist.",
        "description": "Enumerates the store's hotlist (the cards it wants to buy) straight from hotlist membership, so it is deliberately independent of inventory: cards the store does not stock are included, with `quantity` 0 and `in_stock` false. `quantity` is total on-hand across every condition/language/finish SKU of the card at this store. `added_at` is when the card was hotlisted.\n\nCatalog display fields (`product_name`, `set_name`, `set_code`, `product_number`, `image_url`, `variant`, and in the extreme case `game`) are null for a hotlist row whose catalog product is missing — hotlisting validates a card against the SKU catalog, not the product catalog, so a later catalog refresh can orphan a row. Those rows are returned rather than hidden, because this is the only way to see them and so the only way to remove them. Filtering by `name` necessarily excludes them, and they sort last under `sort=name` / `sort=set_name` in either direction.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Filter to a single game family. Omit to list every game."
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Partial, case-insensitive product-name filter (also matches a double-faced card's alternate back-face name), in the inventory grid's grammar limited to card-level operators: `set:`, `cn:`, `r:`, `c:` and `game:` (negation and `( a or b )` groups work as on the inventory grid). Operators for copies a store holds are a 422. Split on whitespace; every word must appear somewhere in the name or an alt name, in any order, and a quoted phrase is one word. Rows with no catalog product (null `product_name`) never match.\n"
          },
          {
            "name": "stock",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "in_stock",
                "not_stocked"
              ],
              "default": "all"
            },
            "description": "Narrow by on-hand stock at this store. `in_stock` is `quantity > 0`; `not_stocked` is `quantity == 0`, which covers both a card never stocked and one whose last copy has sold.\n"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "added_at",
                "name",
                "set_name"
              ],
              "default": "added_at"
            },
            "description": "Sort key. Ties break on `tcgplayer_product_id` ascending."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            },
            "description": "Sort direction. Null `name` / `set_name` values sort last in both directions.\n"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of hotlisted products.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedHotlistProductList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/products/{tcgplayer_product_id}/hotlist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "getProductHotlist",
        "tags": [
          "Inventory"
        ],
        "summary": "Whether a card is on the store's hotlist.",
        "description": "Reads the store's hotlist flag for the product. Independent of inventory, so the inventory-details page can show the toggle state for cards the store does not stock (the catalog-fallback view).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "A path id doesn't match anything (`inventory_item_not_found`, `product_not_found`, `sku_not_found`, `lot_not_found`, `label_template_not_found`, `delete_job_not_found`, `label_export_job_not_found`, `resync_job_not_found`, `transfer_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Hotlist state for the card.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hotlisted"
                  ],
                  "properties": {
                    "hotlisted": {
                      "type": "boolean",
                      "description": "Whether the card is on the store's hotlist."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "addProductToHotlist",
        "tags": [
          "Inventory"
        ],
        "summary": "Add a card to the store's hotlist.",
        "description": "Flags the product (all of its condition/language/finish SKUs) as hotlist for the store. Buylist rules can then match hotlisted cards via the HOTLIST condition, and the public storefront shows the flame badge. Idempotent: re-adding an already-hotlisted card is not an error.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card is on the hotlist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hotlisted"
                  ],
                  "properties": {
                    "hotlisted": {
                      "type": "boolean",
                      "description": "Whether the card is now on the store's hotlist."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "removeProductFromHotlist",
        "tags": [
          "Inventory"
        ],
        "summary": "Remove a card from the store's hotlist.",
        "description": "Clears the store's hotlist flag for the product. Idempotent: removing a card that is not hotlisted is not an error.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Card is not on the hotlist.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hotlisted"
                  ],
                  "properties": {
                    "hotlisted": {
                      "type": "boolean",
                      "description": "Whether the card is now on the store's hotlist (always false here)."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/store-items": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listStoreItems",
        "tags": [
          "Inventory"
        ],
        "summary": "List the store's own items (graded slabs).",
        "description": "Store-authored items that have no TCGplayer SKU, newest first. Today these are graded slabs, each its own SKU with a quantity of at most one. `status` defaults to `active`. `cert_number` matches the normalized cert (spaces and hyphens ignored).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "graded",
                "custom"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Substring of the item name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grader_code",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cert_number",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tcgplayer_product_id",
            "in": "query",
            "description": "The item's own product id, as the inventory grid links to it. Without a `status` this matches archived items too.\n",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "base_tcgplayer_product_id",
            "in": "query",
            "description": "The items whose base card belongs to this product: a card's slabs, for that card's detail page (#3528). Without a `status` this matches archived items too.\n",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of store items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemList"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createStoreItem",
        "tags": [
          "Inventory"
        ],
        "summary": "Add a graded slab to inventory.",
        "description": "Mints the slab its own SKU and takes it into `location_uuid` (or the last bin of an `absolute_chaos` container) at quantity 1, priced at `retail_price` with the price locked against repricing, in one transaction. `base_tcgplayer_sku_id` is the raw card the slab holds. The cert number is unique per store and grader for good: a slab the store has held before answers 409 `store_item_cert_already_exists` with `params.store_item_uuid`, and is restocked through ordinary intake on that item's SKU.\n\nSetting a price needs `inventory.set_sell_price`. Send an `Idempotency-Key`; a replay answers 200 with the item it already made. Photos are added afterwards through `createStoreItemImageUpload`; until the first one is ready the item has no image on any channel.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStoreItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replayed; the item this Idempotency-Key already created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemCreated"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The new item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemCreated"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/store-items/{store_item_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "store_item_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getStoreItem",
        "tags": [
          "Inventory"
        ],
        "summary": "One store item, with its grading and photos.",
        "description": "One store item (today, a graded slab) by its id, archived or not. The answer has the item's summary fields (its SKU and the base card's SKU and product, quantity on hand summed over its locations, retail price and whether that price is locked, a thumbnail URL), its grading when it is graded (grader, grade, cert number and a cert lookup URL where the grader has one, subgrades), its description and attributes, `archived_at`, and every photo in display order. A photo still processing or one that failed has `urls: null`. An unknown id, or another store's, is 404.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemDetail"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateStoreItem",
        "tags": [
          "Inventory"
        ],
        "summary": "Edit a store item's name, description, attributes or grading.",
        "description": "A new `name` is also the product name every channel shows. The grader cannot change; `grade_code` and `subgrades` can. `cert_number` can be corrected only while the slab has never sold (409 `store_item_cert_locked` after). Price edits go through the ordinary inventory price routes. `archived` archives or restores the item.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStoreItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated item.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemDetail"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/store-items/{store_item_uuid}/images": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "store_item_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listStoreItemImages",
        "tags": [
          "Inventory"
        ],
        "summary": "A store item's photos, in order, with their resize status.",
        "description": "The item's photos, in display order (`position`, then upload time); deleted photos are left out. Each carries its `status` (`pending` while it resizes, `ready`, or `failed` with an `error_code`), its size once known, and `urls` for each resized variant once `ready` (`null` until then). The first `ready` photo is the item's thumbnail. An unknown item id, or another store's, is 404.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The photos.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "images"
                  ],
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoreItemImage"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createStoreItemImageUpload",
        "tags": [
          "Inventory"
        ],
        "summary": "Start a photo upload; returns a presigned PUT URL.",
        "description": "PUT the image bytes to `upload_url` within `expires_in` seconds, with the same `Content-Type`. The photo is `pending` until the resize worker finishes (poll `listStoreItemImages`), then `ready` with its `urls`, or `failed` with `error_code` (`image_too_small` under 500px on the longest side, `image_too_large` over 25 MB, `image_unreadable`). An item holds at most 12 photos; the first ready one is its image everywhere.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content_type"
                ],
                "properties": {
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "image/jpeg",
                      "image/png",
                      "image/webp"
                    ]
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "front",
                      "back",
                      "extra"
                    ],
                    "default": "extra"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The pending photo and where to upload it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreItemImageUpload"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/store-items/{store_item_uuid}/images/order": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "store_item_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "put": {
        "operationId": "reorderStoreItemImages",
        "tags": [
          "Inventory"
        ],
        "summary": "Set the order of a store item's photos.",
        "description": "`image_uuids` must name every photo of the item exactly once. The first ready photo becomes the item's image.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image_uuids"
                ],
                "properties": {
                  "image_uuids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The photos in their new order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "images"
                  ],
                  "properties": {
                    "images": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoreItemImage"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/store-items/{store_item_uuid}/images/{image_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "store_item_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "image_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "delete": {
        "operationId": "deleteStoreItemImage",
        "tags": [
          "Inventory"
        ],
        "summary": "Remove a photo.",
        "description": "The photo's files are deleted and its CDN path invalidated. A listing a marketplace already copied the image into keeps it until that listing is updated.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Removed.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/tags": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listStoreTags",
        "tags": [
          "Inventory"
        ],
        "summary": "The store's tag dictionary.",
        "description": "Every tag the store has defined, plus the read-only system tags the platform derives from state it already owns. This is what makes tag autocomplete and filter chips cheap -- it reads a small store-scoped table rather than unnesting an array across the store's inventory.\n\n`usage_count` is how many assignments a custom tag has, which is what a delete confirmation needs. It is null for a derived tag, whose membership is a live predicate over other tables rather than a set of rows.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's tags.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tags"
                  ],
                  "properties": {
                    "tags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoreTag"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createStoreTag",
        "tags": [
          "Inventory"
        ],
        "summary": "Define a new tag.",
        "description": "Mints one custom tag. `slug` is the stable handle rules match on and is immutable once created; `name` is the display label and can be changed freely, which is what makes renaming a tag safe for every rule that references it.\n\n409 when the slug is already defined, when it is one the platform reserves (`hotlist`, `no-repricing-retail`, `no-repricing-buylist`, `do-not-sell`, `do-not-buy`), or when the store is at its dictionary cap of 200.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug"
                ],
                "properties": {
                  "slug": {
                    "type": "string",
                    "maxLength": 50,
                    "pattern": "^[a-z0-9][a-z0-9-]*$",
                    "description": "Lowercase handle. Trimmed and lowercased on the way in, so `Case-Staple` stores as `case-staple`.\n"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Display label. Defaults to the slug."
                  },
                  "color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20,
                    "description": "UI chip color. Null lets the frontend choose."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The created tag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreTag"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/tags/assignments": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getCardTags",
        "tags": [
          "Inventory"
        ],
        "summary": "What one card carries.",
        "description": "The tags on a card. With only `tcgplayer_product_id`, the product's own tags; with a `tcgplayer_sku_id` as well, that variant's tags plus its product's -- the effective set every filter and rule matches on.\n\nDerived system tags (the two repricing locks) are per-SKU by nature and are only reported when a SKU is given.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tcgplayer_product_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "tcgplayer_sku_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Narrow to one condition/language/finish variant."
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The card's tags.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tcgplayer_product_id",
                    "tags"
                  ],
                  "properties": {
                    "tcgplayer_product_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "tcgplayer_sku_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "format": "int64"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoreTagAssignmentEntry"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "applyStoreTagAssignments",
        "tags": [
          "Inventory"
        ],
        "summary": "Attach and detach tags in bulk.",
        "description": "Both lists are optional but at least one must be non-empty. Idempotent in both directions -- re-assigning is a no-op and un-assigning something absent is not an error -- so a UI can send the current state of a chip set without diffing first.\n\nAssignment is at catalog grain and deliberately does not require the store to stock the card: tagging a card you do not carry (\"do not buy this\") is the case a per-SKU pricing row could never express.\n\nAn omitted or null `tcgplayer_sku_id` tags the whole product, which every one of its condition/language/finish variants then carries.\n\nTwo slugs do something. `do-not-buy` declines the card on every buylist quote immediately and removes it from the storefront browse on the next offer refresh; `do-not-sell` withholds it from every marketplace and from the kiosk, which the sweeps carry out within their own cadence (30 minutes for the marketplaces, 5 for the kiosk). Their dictionary rows are created here on first use -- there is no need to create the tag first. Every other tag is inert by design.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "assign": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/StoreTagAssignmentInput"
                    }
                  },
                  "unassign": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/StoreTagAssignmentInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "What was applied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "assigned",
                    "unassigned"
                  ],
                  "properties": {
                    "assigned": {
                      "type": "integer"
                    },
                    "unassigned": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/tags/{slug}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "slug",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The tag's stable lowercase handle."
        }
      ],
      "patch": {
        "operationId": "updateStoreTag",
        "tags": [
          "Inventory"
        ],
        "summary": "Rename or recolor a tag.",
        "description": "Changes the display label and/or the chip color. The slug is immutable: rules match on it, so a rename must not change any rule's behavior, and it does not. To change a slug, delete and re-create -- which goes through the referencing-rules guard rather than around it.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The updated tag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreTag"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteStoreTag",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete a tag and every assignment of it.",
        "description": "409 while any stored reprice or buylist rule references the slug, with the offending rules named in `referencing_rules`. That is a hard stop rather than a warning because the failure it prevents is silent: a rule naming a deleted tag stays enabled, compiles cleanly, and simply matches nothing -- pricing nothing and reporting nothing.\n\n`force=true` deletes anyway, for the case where the rules are being retired alongside the tag.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Delete even when rules reference the tag."
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/marketplace-prices/{marketplace}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Target marketplace for the price override. One of the `RepriceMarketplace` vocabulary (CARDMARKET, CARD_NEXUS, CARD_TRADER, EBAY, KIOSK, LIGHTSPEED, MANA_POOL, MISPRINT, SHOPIFY, SICK_DEALS, SNAPCASTER, SQUARE, TCGPLAYER, TCGPLAYER_DIRECT, WHATNOT). `KIOSK` prices the store's own in-store pickup storefront, which reads this override directly rather than being pushed to. A `SNAPCASTER` override is in CAD, the only currency Snapcaster lists in.\n"
        }
      ],
      "put": {
        "operationId": "setMarketplacePrice",
        "tags": [
          "Inventory"
        ],
        "summary": "Set a per-marketplace price override for a SKU.",
        "description": "Sets (upserts) a per-marketplace price override for a SKU, so that marketplace lists at a price different from the store's base price. Returns 204 on success, 404 if the SKU has no base price, and 422 if the marketplace or price is invalid.\n\nSend `expected_retail_price` to make the write a compare-and-set against the override the client loaded (the detail read's `marketplace_prices` entry, or `null` when it had none). If a repricing run or another user changed the override since, nothing is written and the response is 412; reload and review the current price before saving again. An override that already holds the requested price is a success, so retrying a save is safe. Omitting it keeps the unconditional upsert.\n\nAn override is in a currency of its own (#3735): a USD store prices Snapcaster in CAD, a CAD store prices TCGplayer in USD. Send `currency` to say which; omitted, it is the store's currency when the marketplace lists in it, else the marketplace's only currency. A marketplace lists an override only in a currency it accepts for the store (Snapcaster: CAD; TCGplayer, ManaPool, Misprint: USD; CardNexus: the account's currency; every other one: the store's own).\n\n`currency` may also be the store's own currency for a marketplace that does not list in it but lists in exactly one other (TCGplayer, ManaPool, Misprint: USD; Snapcaster: CAD). The price is then converted at the store's applied exchange rate, rounded to the penny, and saved as an override in the marketplace's currency, so a later rate change leaves it alone; the response is 200 and carries both amounts and the rate (`MarketplacePriceConverted`). A save that needs no conversion keeps answering 204. Removing the override (DELETE) puts the marketplace back on the push's own conversion of the store's price.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "retail_price"
                ],
                "properties": {
                  "retail_price": {
                    "type": "number",
                    "format": "double",
                    "description": "Override price for this marketplace, in `currency`."
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "EUR",
                      "CAD",
                      "MXN"
                    ],
                    "description": "The currency `retail_price` is in. Omitted: the store's currency when the marketplace lists in it, else the marketplace's only listing currency (CAD for Snapcaster in a USD store); `marketplace_price_currency_required` when neither applies. The store's own currency is accepted for a marketplace that lists in exactly one other currency and is converted at the applied rate (no applied rate: `marketplace_price_rate_unavailable`). Any other currency the marketplace does not list in for this store is `marketplace_price_currency_unsupported`.\n"
                  },
                  "expected_retail_price": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "format": "double",
                    "description": "The override price the client last loaded for this marketplace, or `null` if it loaded none, in the currency the override is saved in (for a converted save, the marketplace's, not `currency`). Compared at two decimal places; a mismatch returns 412.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A field is invalid (`validation_error`), the SKU has no base price yet (`base_price_missing`), the body named no currency and the marketplace has none to default to (`marketplace_price_currency_required`), or `currency` is one the marketplace does not list in for this store (`marketplace_price_currency_unsupported`; `params.accepted_currencies` names the ones it does), or `currency` is the store's own and the store has no exchange rate for the currency the marketplace lists in (`marketplace_price_rate_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "204": {
            "description": "Override set as typed.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Override set from a store-currency price converted at the applied rate (`MarketplacePriceConverted`), and/or done but the marketplace sync event could not be queued (`marketplace_sync_not_queued`; answered instead of 204, the listings catch up within about 30 minutes).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplacePriceConverted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "removeMarketplacePrice",
        "tags": [
          "Inventory"
        ],
        "summary": "Remove a per-marketplace price override for a SKU.",
        "description": "Removes a SKU's per-marketplace price override, reverting that marketplace to the base price. Idempotent — returns 204 even if no override was set; returns 422 for an invalid marketplace.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "A path id doesn't match anything (`inventory_item_not_found`, `product_not_found`, `sku_not_found`, `lot_not_found`, `label_template_not_found`, `delete_job_not_found`, `label_export_job_not_found`, `resync_job_not_found`, `transfer_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "204": {
            "description": "Override removed (idempotent).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Done, but the marketplace sync event could not be queued (`marketplace_sync_not_queued`). Answered instead of 204; the listings catch up within about 30 minutes.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarningsOnlyResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/listing-exceptions/{marketplace}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "The marketplace to list the card on despite a `DO NOT LIST ON` rule. One of the `RepriceMarketplace` vocabulary except `TCGPLAYER_DIRECT`, which those rules cannot name.\n"
        }
      ],
      "put": {
        "operationId": "setListingException",
        "tags": [
          "Inventory"
        ],
        "summary": "List a SKU on a marketplace despite a Don't list rule.",
        "description": "Exempts one SKU from every `DO NOT LIST ON` repricing rule naming this marketplace. The rule's suppression for the SKU is lifted at once and the SKU is pushed to the marketplace; later repricing runs leave it listed. A delist set by hand (`not_listed_on` entry with `source: manual`) is not lifted. Idempotent. 422 `base_price_missing` when the SKU has no price yet.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Exception set (idempotent).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Done, but the marketplace sync event could not be queued (`marketplace_sync_not_queued`). Answered instead of 204; the listings catch up within about 30 minutes.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarningsOnlyResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The marketplace isn't one a `DO NOT LIST ON` rule can name (`validation_error`), or the SKU has no price yet (`base_price_missing`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "removeListingException",
        "tags": [
          "Inventory"
        ],
        "summary": "Let Don't list rules apply to a SKU again.",
        "description": "Removes a SKU's listing exception for this marketplace, returning it to `automatic` (`setListingState`): the store's `DO NOT LIST ON` rules are applied to the card at once, so a rule-blocked card is delisted by this request rather than at the next repricing run. Idempotent; a SKU with no price is a no-op.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Exception removed (idempotent).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/listing-state/{marketplace}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        },
        {
          "name": "marketplace",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "One of the `RepriceMarketplace` vocabulary except `TCGPLAYER_DIRECT`.\n"
        }
      ],
      "put": {
        "operationId": "setListingState",
        "tags": [
          "Inventory"
        ],
        "summary": "Set whether a SKU lists on a marketplace.",
        "description": "Puts a SKU in one of three listing states on one marketplace, taking effect at once (the card is pushed when its listing changes): `automatic` lets the store's `DO NOT LIST ON` rules decide, and applies them to the card now; `listed` lists it whatever the rules say (a listing exception, as `setListingException`); `removed` keeps it off whatever the rules say (a `source: manual` entry in `not_listed_on`, which repricing never clears). The detail read reports the state through `not_listed_on` and `listing_exceptions`. Idempotent. 422 `base_price_missing` when the SKU has no price.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "state"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "listed",
                      "removed"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "State set (idempotent).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Done, but the marketplace sync event could not be queued (`marketplace_sync_not_queued`). Answered instead of 204; the listings catch up within about 30 minutes.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarningsOnlyResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The marketplace isn't one a `DO NOT LIST ON` rule can name, or `state` is not one of the three (`validation_error`), or the SKU has no price yet (`base_price_missing`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/products/{tcgplayer_product_id}/sales": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "listProductSales",
        "tags": [
          "Inventory"
        ],
        "summary": "List historical sales line items for one TCGPlayer product",
        "description": "Returns one row per order line item that sold any SKU variant of the given `tcgplayer_product_id`. If a single order contains multiple SKUs of the same product (e.g. one NM and one LP copy), each line item is a separate row sharing the same `order_id` — group client-side if you need an order-level view.\nResults are sorted by `order_date` descending by default.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MarketplaceFilter"
          },
          {
            "name": "from",
            "in": "query",
            "description": "Include only sales ordered at or after this timestamp (inclusive, ISO 8601)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Include only sales ordered before this timestamp (exclusive, ISO 8601)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/IncludeSlabs"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated sales history for the product",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedProductSalesList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/products/{tcgplayer_product_id}/cogs": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "listProductCogs",
        "tags": [
          "Inventory"
        ],
        "summary": "List the cost (COGS) ledger for one TCGPlayer product",
        "description": "Returns one row per cost lot across every SKU variant of the product — \"we took in X copies on Y at Z each\" — newest received first. A lot is opened by each intake (manual add, CSV import, buylist push, transfer receive), so a card restocked five times has five rows, each with the cost that batch was bought at.\n\nUnlike the per-SKU `listInventoryLots`, this includes lots already sold through (`quantity_remaining` 0), because the question here is what the store has paid for the card rather than what the stock on the shelf is worth. Those rows are read-only: their cost was snapshotted onto the orders they filled and is frozen there, so `editable` is false and a `PATCH` naming one is rejected. Filter them out with `status=open` if the caller only wants the correctable set.\n\n`summary` covers the whole filtered set, not the returned page.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tcgplayer_sku_id",
            "in": "query",
            "description": "Narrow the ledger to one SKU variant of the product.",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "$ref": "#/components/parameters/IncludeSlabs"
          },
          {
            "name": "status",
            "in": "query",
            "description": "`open` = lots with stock left (the correctable set, matching `listInventoryLots`); `closed` = lots fully consumed; `all` (default) = both.\n",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "closed"
              ],
              "default": "all"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Include only lots received at or after this timestamp (inclusive, ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Include only lots received before this timestamp (exclusive, ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated cost ledger for the product.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedProductCogsList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "bulkUpdateProductCogs",
        "tags": [
          "Inventory"
        ],
        "summary": "Correct the cost basis of several lots at once",
        "description": "Bulk counterpart of `updateInventoryLotCogs`, so an edited table of cost cells saves in one call. Each entry names a `lot_id` returned by `listProductCogs` and its corrected per-unit cost.\n\nAll-or-nothing: the whole request is validated and locked before anything is written, and a single bad entry rejects the call with 422 rather than half-applying the save. An entry is bad if the lot does not exist, belongs to another store or product, appears twice in the same request, is fully consumed (`editable: false` — its cost is frozen onto the orders it filled), or carries a missing/negative `unit_cost`.\n\nCorrecting a cost sets that lot's `cost_basis_source` to `manual`, since a human supplying the number is exactly the point at which it stops being an estimate. Only *future* sales and removals from these lots are affected — orders already fulfilled keep the margin they were costed at. No quantity moves, so nothing is written to the inventory ledger.\n\nReturns the corrected rows, not a refreshed page — the caller's page, filters and offset are not part of this request.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entries"
                ],
                "properties": {
                  "entries": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "object",
                      "required": [
                        "lot_id",
                        "unit_cost"
                      ],
                      "properties": {
                        "lot_id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "A `lot_id` from `listProductCogs`."
                        },
                        "unit_cost": {
                          "type": "number",
                          "format": "double",
                          "minimum": 0,
                          "description": "Corrected per-unit cost (COGS), in the store's currency."
                        }
                      }
                    }
                  },
                  "note": {
                    "type": "string",
                    "description": "Optional operator note explaining the correction. Logged to telemetry; not stored on the inventory ledger (a cost-only correction has no quantity movement to attach a ledger row to).\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The corrected ledger rows.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "updated",
                    "entries"
                  ],
                  "properties": {
                    "updated": {
                      "type": "integer",
                      "description": "How many lots were recosted."
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductCogsEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A lot this would rewrite is in a cost batch that is not finished; its cost is set when the batch is finished.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/export": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "exportInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Start an async inventory export job",
        "description": "Kicks off an async CSV export. Rate limited to 1 request per 10 seconds. Poll the returned job UUID for status and download link. The generated file leads with the column set of the marketplace's own export (for `TCGPlayer`, their 16-column \"Pricing Custom Export\") in their order, so it can be uploaded back to that marketplace, then appends HippoLink's own `Location` column carrying each row's bin as a `\"A > B > C\"` breadcrumb. Rows are one per (SKU, bin) — a card split across bins appears once per bin with that bin's own quantity, so the file can be edited and re-imported to re-shelve stock (choose the `csv_location` strategy on import, which resolves the same breadcrumb). Note that a re-upload to the marketplace of a file containing a split SKU sets that SKU to its last row's quantity rather than the sum, since `Total Quantity` is absolute.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "TCGPlayer",
                      "HippoLinkLocations"
                    ],
                    "default": "TCGPlayer",
                    "description": "`TCGPlayer` mirrors that marketplace's own Pricing Custom Export, so the file uploads back to them unchanged. `HippoLinkLocations` (#2333) is HippoLink's own shape — the same rows plus a `Location Id` column and two blank ones, `New Location` and `Move Quantity`, which a store fills in and uploads back to `POST /inventory/relocate` to actually move the cards. Two distinct bins that share a breadcrumb are collapsed into one row in the `TCGPlayer` export and kept separate here, since `Location Id` is the only cell that can tell them apart.\n"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "If provided, the server will POST a job status update to this URL when the job completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
                  },
                  "filters": {
                    "$ref": "#/components/schemas/InventoryFilter",
                    "description": "Scope the export to inventory matching these filters (same shape as `GET /inventory`'s query parameters). Omit for a whole-store export.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Export job accepted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/export/{export_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "export_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getExportStatus",
        "tags": [
          "Inventory"
        ],
        "summary": "Get export job status",
        "description": "Returns progress and status for an async CSV export. Rate limited to 1 request per second. When status is \"completed\", the response includes a download_url for the generated file.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/relocate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "relocateInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Start a CSV relocation job",
        "description": "Kicks off the upload half of the relocation round-trip. Export with `format=HippoLinkLocations`, fill in the `New Location` column (and optionally `Move Quantity`) in a spreadsheet, then PUT the edited file to the returned presigned URL and call `/start`.\n\nA relocation is quantity-neutral and ledger-neutral: it moves cards between the store's own bins and changes no on-hand total. It is **not** an import — a re-imported export would *add* the row's copies to the new bin in merge mode and wipe the whole target tree in replace mode.\n\nRow contract: a row with a blank `New Location` does nothing at all — not \"move to itself\", not \"reconcile\" — which is what lets the same file be a full snapshot or three hand-edited lines. A blank `Move Quantity` moves the whole of what the source bin holds *at apply time, read live*, never the file's own `On Hand` cell. The source must already exist and is never created. Files are capped at 20,000 rows; a larger one fails with nothing moved.\n\nRows are grouped by `(source, destination)` and each group is applied in the order the file first names it, so a file that chains — `A -> B` on one row and `B -> C` on the next — sends the first row's copies on to `C`, and a swap written as `A -> B` / `B -> A` piles everything into `A`. That follows from a blank `Move Quantity` meaning \"whatever the source holds when this row runs\". Name an explicit `Move Quantity` on both rows to exchange two bins, and read the dry run first either way: it accounts for both ends of every move, so it reports these files the way the apply will run them.\n\nThere is no undo: the job is ledger-neutral, so the import-revert machinery cannot see it. The file **is** the undo — swap the `Location` and `New Location` columns and upload it again, **clearing the `Location Id` column as you do**. `Location Id` wins over `Location` whenever both are present, so a swapped file that still carries the original ids would resolve every source back to the bin the cards just left and report the whole file `no_stock`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dry_run": {
                    "type": "boolean",
                    "default": true,
                    "description": "Resolve every row and report the plan without moving anything. Defaults to true, and clients should require one before an apply: this is the step where a bad `New Location` column gets caught before a thousand cards move.\n"
                  },
                  "create_missing_locations": {
                    "type": "boolean",
                    "default": false,
                    "description": "Create a `New Location` naming a bin the store does not have, rather than reporting the row `unknown_destination_location`. Defaults to false because a typo autofilled down 5,000 spreadsheet rows would otherwise mint 5,000 bins, which a store cannot easily undo.\n"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "If provided, the server will POST a job status update to this URL when the job completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the request breaks a rule of this route (named by its `error` code, for example `import_mode_unsupported`, `sync_columns_fixed`, `invalid_bin_name_template`, `scope_too_large`). Or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Relocation job created; PUT the file to `upload_url`, then call /start",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/relocate/{relocation_job_uuid}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "relocation_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "startRelocation",
        "tags": [
          "Inventory"
        ],
        "summary": "Confirm upload and start relocation processing",
        "description": "After uploading the edited CSV to the presigned URL, call this endpoint to confirm the upload and begin async processing. The server validates that the file exists on S3 and is within the 10MB byte bound, then transitions the job to \"pending\". The 20,000-row limit itself is checked in the worker, after the file is parsed and before anything moves — a row count is not knowable from a byte length.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "422": {
            "description": "The uploaded file is over the 10 MB limit (`relocation_file_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Relocation processing started",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/relocate/{relocation_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "relocation_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getRelocationStatus",
        "tags": [
          "Inventory"
        ],
        "summary": "Get relocation job status, plan, or report",
        "description": "Returns progress and per-row outcomes for a relocation job. The same shape serves the dry-run plan and the applied report, because they are the same rows — so a store reading a preview is reading the report it will get. When status is \"completed\" the response includes a `report_url` for the CSV download: the store's own columns plus `Result` and `Detail`.\n\nThe job is **not** atomic across the file: a pair whose transfer fails leaves earlier pairs applied, and these rows are authoritative about what actually moved rather than about what was planned.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RelocationJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/relocate-by-template/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewTemplateRelocation",
        "tags": [
          "Inventory"
        ],
        "summary": "Preview re-shelving existing stock by bin template",
        "description": "Diffs a location subtree's stock against where your bin template says each card belongs, and reports what would move. Writes nothing: no job, no bins, no stock.\n\n`location_uuid` is the scope and means **that location and everything beneath it** — a container resolves to its bins, a bin to itself. There is no whole-store shorthand: a template move over a whole store is a legitimate thing to want, but it should be something you type rather than something you fall into by leaving a field blank.\n\n**The plan is a diff.** Cards already sitting where the template says are counted under `already_shelved` and never listed per row, because on a store that has been importing under this template that is most of them — the expected result of \"re-shelve my Magic wall\" on a healthy store is 0 moved, and that is success rather than a broken job.\n\n**The template names a split, not a bin.** A store may legitimately keep a Zendikar shelf box and a Zendikar overflow box; a card in *either* is already shelved. Where cards have to move *into* such a split and you have not chosen, the split is blocked rather than guessed, and reported under `ambiguities` with its candidates in shelf order (the picker's own walking route) — grouped per split, so forty cards blocked on one Zendikar choice is one question and not forty identical lists. Answer them in `resolutions` and run the preview again.\n\nTwo warnings are worth reading before applying: `emptied_sources` names any bin that would lose all or nearly all of its stock (a hand-built overflow box carries no template identity, so it is invisible to the split machinery and would otherwise be drained quietly), and `new_bins` counts the bins that would be created under `Unassigned`. A template typo shows up here as \"38,000 cards move, 1,204 new bins\" rather than as a re-shelving project discovered on Monday.\n\n`plan_digest` is what you send back to the apply route. The apply re-plans immediately before it moves anything and refuses on a material change, so a plan you looked at an hour ago cannot be acted on blind.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateRelocationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The plan",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateRelocationPlan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The template does not parse, or the scope holds more stocked rows than one plan will walk. The plan is deliberately never truncated — a number on screen that is not the number that moves is worse than a refusal — so narrow the scope to a container or a bin and re-run.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/bins/resolve-by-template": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "resolveBinsByTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Resolve the bin each SKU would be shelved in under a bin template",
        "description": "For a list of SKUs, returns the bin a CSV import under the store's **default** bin template (or the saved template named by `bin_template_uuid`) would shelve each in. It is the same planner the import uses: same rendering, same adoption of bins the store already has, same bins created (under `Unassigned`, alphabetical, keyed).\n\nWith `create: false` (the default) nothing is written. A bin the store already has comes back `existing` with its `location_uuid`; one it lacks comes back `new` with the `path` it would be created at.\n\nWith `create: true` the bins the plan named are created and returned as `created` with a `location_uuid`; a bin that already existed, including one a concurrent call created first, stays `existing`. Concurrent calls for the same new bin never produce duplicates. Send `create: true` only for the SKUs still `new` after a preview.\n\nA SKU the template cannot render (no catalog identity, or a token the catalog cannot fill) is `unresolved` with a `reason`: `unknown_sku`, or `missing_catalog_product: <missing parts>`.\n\n422 with `error: no_default_bin_template` when no template is named and the store has no default; 404 with `bin_template_not_found` when the named template is not one of this store's; 422 with `invalid_sku_ids`, `too_many_sku_ids` (over 1000 distinct ids), `invalid_create` or `invalid_bin_template_uuid` for a malformed body.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveBinsByTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The resolved bin per SKU, in request order with duplicates removed",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveBinsByTemplateResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/relocate-by-template": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "relocateInventoryByTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Re-shelve existing stock by bin template",
        "description": "Applies the plan `/relocate-by-template/preview` returned. Creates an async relocation job and returns its `job_uuid`; poll it through `GET /inventory/relocate/{relocation_job_uuid}`, which serves this job the same way it serves a CSV relocation — same counts, same per-row outcomes, same report CSV — because they are the same job type with two plan sources.\n\n**`plan_digest` is required.** An apply that never previewed is the accident this feature exists to make impossible: a template typo is the difference between \"412 cards move\" and \"38,000 cards move into 1,204 new bins\". The digest is re-checked in the worker against a fresh plan immediately before anything moves, so a shelf that changed in between fails the job with nothing moved rather than acting on a stale picture.\n\n`create_missing_locations` defaults **true** here, unlike the CSV relocation's, and the difference is real: there the destination comes from a cell autofilled down 5,000 spreadsheet rows, while here it comes from one template string you previewed. Filing cards into bins that do not exist yet is half of what this feature is for.\n\nThe job is **not atomic across the scope**: a chunk that fails leaves earlier chunks applied, and the report is authoritative about what actually moved. There is no undo — the move is ledger-neutral, so the import-revert machinery cannot see it. Re-running the same scope under the same template is a clean 0 moved, which is what makes re-running safe.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TemplateRelocationRequest"
                  },
                  {
                    "type": "object",
                    "required": [
                      "plan_digest"
                    ],
                    "properties": {
                      "plan_digest": {
                        "type": "string",
                        "description": "The `plan_digest` the preview returned for this exact scope, template, resolutions and `create_missing_locations`.\n"
                      },
                      "delete_scope_when_empty": {
                        "type": "boolean",
                        "default": false,
                        "description": "When `location_uuid` is a bin, soft-delete it after the last chunk if it holds no stock, atomically with that check, and report the outcome as `scope_deleted` on the job. A bin that still holds copies (blocked or already-shelved rows, or stock committed mid-job) is kept. Needs `locations.manage_structure` on top of this route's `locations.transfer_contents`. 422 for a container scope or the default intake bin.\n"
                      },
                      "callback_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "If provided, the server POSTs a job status update here when the job completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Relocation job created and queued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_uuid": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`plan_digest` is missing, or the template does not parse. Or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "importInventory",
        "tags": [
          "Inventory"
        ],
        "summary": "Start an async inventory import job",
        "description": "Creates an import job and returns a presigned S3 upload URL. The client PUTs the CSV file directly to the upload URL, then calls the /start endpoint to begin processing. **merge** mode (default) upserts — matches on product ID / condition, updates existing rows (quantities are summed), and inserts new ones. **replace** mode drops all existing inventory in the target location tree and then sets quantities to exactly match the file — existing rows are overwritten, not accumulated.\n\nThese **location_strategy** options control where imported items land:\n- **template** — shelve every card into the tree your own bin-name\n  template describes. The template is a string of `$` variables with\n  `\" > \"` between levels: everything before the last level is a\n  container and the last is the bin. Names come from HippoLink's\n  catalog, not from your file, so two exports that spell a set\n  differently land in one bin. Pick a saved template with\n  `bin_template_uuid`, pass a one-off with `bin_name_template`, or send\n  neither to use the store's default. `location_uuid`, `bin_size` and\n  `bin_name_prefix` must not be provided, and merge mode only —\n  `replace` is rejected. See the Bin templates endpoints for the\n  variable list and a live preview.\n\n- **single** (default) — all items go to the user-selected `location_uuid`.\n  Requires `location_uuid`.\n\n- **set_code** — items are automatically organised into a container per set\n  holding one bin per first letter of the card name, and each bin repeats\n  its set so its name is unique store-wide: \"Dominaria United\" holds\n  \"Dominaria United - A\", \"Dominaria United - B\", …. A set from a game\n  other than Magic leads with the game, \"Disney Lorcana - The First\n  Chapter - G\", because a set name is not unique across games; Magic\n  shelves keep the bare set name. A card whose name does not start with a\n  letter files under `<set> - Misc`. Names come from HippoLink's catalog\n  rather than from your file, so two exports that spell a set differently\n  land in one bin. A location the store already has by either name,\n  anywhere in its tree, receives the rows; only a name it has never used\n  is created under the \"Unassigned\" root, and the set container is only\n  created when a bin has to be. If a name matches more than one location,\n  the oldest wins. Locations this creates are shelved A–Z among their\n  siblings rather than in the order your file lists the cards, and each\n  bin's contents are kept in card-name A–Z order too; a location or card\n  that is already there keeps its place, so re-importing never reshuffles\n  a shelf. `location_uuid` must not be provided.\n\n- **csv_location** — each unique \"Location\" / \"Bin\" value in the CSV routes\n  to the bin the store already has by that name, or becomes a child of the\n  \"Unassigned\" root if it has never used it. A value spelled as a\n  `\"A > B > C\"` breadcrumb — what this endpoint's export writes into its\n  `Location` column — is walked as a path from the root instead, creating\n  only the levels that are missing, so an exported file re-imports onto the\n  shelves it came from. `location_uuid` must not be provided.\n\n- **split_bins** — pour the import into fixed-size bins under a target\n  container. `location_uuid` must be a **container** (it receives the\n  auto-created bins) and `bin_size` is required. Bins are created as they\n  fill (`Bin 1`, `Bin 2`, …, or `bin_name_prefix N`), counting by card\n  quantity and keeping each stack whole. Re-importing into the same\n  container tops off the last partial bin, then continues numbering.\n  merge mode only — `replace` is rejected.\n\n- **absolute_chaos** — Absolute Chaos Binning, for a TCGplayer-format\n  file (rows keyed by `TCGplayer Id`) or a ScanAbility file (rows keyed\n  by `SkuId`; a card row with no `SkuId` fails the file). Files the cards into numbered\n  bins under a target container in exact file order, filling each bin\n  to exactly `bin_size` copies, so a row can continue into the next\n  bin; a card repeated in one bin keeps its place each time it\n  appears. The container's highest `<prefix> N` bin is topped off\n  first, then `<prefix> N+1`, `N+2`, … are created. Every row is\n  matched before anything is placed: one SKU HippoLink does not have\n  fails the job (`unmatched_skus`) with nothing written. Always\n  previewed first: create the job with `dry_run: true`, upload and\n  start it as usual, read the plan from\n  `GET .../import/{import_job_uuid}/bins`, then apply it with\n  `POST .../import/{import_job_uuid}/apply`. `location_uuid` must be a\n  container and `bin_size` is required; merge mode only.\n\n- **smart_binning** — for a standard TCGplayer dump. Each card is shelved\n  into a bin HippoLink names from the card's own game, set, language,\n  condition and finish (\"Dominaria United - Lightly Played - Non-Foil\";\n  a card from a game other than Magic leads with the game, \"Disney\n  Lorcana - The First Chapter - Near Mint - Non-Foil\", and a non-English\n  card carries its language, \"Dominaria United - Japanese - Near Mint -\n  Foil\", so both shelve apart from English Magic ones; sealed product\n  drops the finish, \"Dominaria United - Unopened\"), and\n  each bin's contents are kept in card-name A–Z order. A bin the store already has\n  by that name anywhere in its tree receives the cards, wherever the\n  store has since moved it; only a name it has never used is created\n  under \"Unassigned\". Rows are read as **additions**: only the file's\n  `Add to Quantity` column adds copies, and `Total Quantity` is ignored,\n  so **re-uploading the same file adds its quantities again**. A row that\n  adds nothing acts as a price/reserve update against stock already held,\n  and is skipped entirely if the store holds none of that card. A card\n  HippoLink's catalog cannot yet name a bin for is reported as a row\n  error rather than shelved under a placeholder — nothing about that row\n  is applied, and re-importing once the card is in the catalog picks it\n  up. When set,\n  `TCG Marketplace Price` — or, on a file that has no such column, the\n  file's own price column — overwrites the card's price, and\n  `My Store Reserve Quantity` sets the copies held back from third-party\n  marketplaces (blank leaves each alone; a reserve of `0` clears it, and\n  a price of `0` reads as an unfilled cell, leaving the card's price\n  alone rather than costing the row). `location_uuid`, `bin_size`,\n  and `bin_name_prefix` must not be provided, and merge mode only —\n  `replace` is rejected.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "location_strategy": {
                    "type": "string",
                    "enum": [
                      "single",
                      "set_code",
                      "csv_location",
                      "split_bins",
                      "smart_binning",
                      "template",
                      "absolute_chaos"
                    ],
                    "default": "single",
                    "description": "Controls how imported items are distributed across locations. **single**, **split_bins** and **absolute_chaos** require `location_uuid` (a bin, a container and a container respectively). **template**, **set_code**, **csv_location** and **smart_binning** manage locations automatically and must not include `location_uuid`. **set_code** and **smart_binning** are kept for compatibility and behave exactly as they always have; both are fixed shapes of **template**, which is where new combinations live.\n"
                  },
                  "bin_template_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A saved bin template to shelve this import by. Only for **template**, and mutually exclusive with `bin_name_template`. Send neither to use the store's default template; 422 if it has none.\n"
                  },
                  "bin_name_template": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "A one-off bin-name template for this job, instead of a saved one. Only for **template**, and mutually exclusive with `bin_template_uuid`. Validated at request time: an unknown variable, an empty level, a last level with no variable at all, or a template whose longest possible bin name would exceed a location name's 500-character limit is a 422.\n"
                  },
                  "sync_columns": {
                    "type": "boolean",
                    "default": true,
                    "description": "**Deprecated and no longer a choice.** A `template` import always reads its rows under the sync contract, and sending `false` is a 422 rather than a silent override; `true` and omitting it are the same request. The two legacy aliases keep their own frozen values (`set_code` always false, `smart_binning` always true) and a contradictory value alongside either is a 422 too.\nThe contract: quantities are added, never read as a final count, so **re-uploading the same file adds its quantities again**. Where the file carries an `Add to Quantity` column that column is the only thing that adds copies and `Total Quantity` is ignored; where it does not (a Roca, ManaPool, Shopify, ManaBox or CardTrader export, or a TCGplayer export carrying only `Total Quantity`) the file's one quantity column is what the row adds. Price reads the same way: where the file carries `TCG Marketplace Price` that column is the only thing that prices a row, and where it does not the file's own price column (ManaBox's `Purchase price`, ManaPool's `price`, Shopify's and Roca's `Price`) is what the row sets. `My Store Reserve Quantity` sets the copies held back from third-party marketplaces. A row that adds nothing acts as a price/reserve update against stock already held, and is skipped entirely if the store holds none of that card.\n**A zero is not an absent column.** A TCGplayer Pricing Manager or on-hand export carries `Add to Quantity` filled with `0` beside a real `Total Quantity`, so it stays on the strict read and adds no copies — every row becomes a price/reserve update instead. That is deliberate: those are the files whose `Total Quantity` is stock the store already holds, and adding it would re-import the whole shelf on every upload.\n"
                  },
                  "acknowledge_axis_change": {
                    "type": "boolean",
                    "default": false,
                    "description": "Confirm that this template splits bins on different card properties than the store's last import did. **`template` only** — `set_code` and `smart_binning` are never blocked by it, since alternating those two has always re-split a store's shelves. Without it, such a request is rejected `409 bin_axes_changed` with the previous template and the added/removed properties named — the cards already on those shelves stay where they are and new bins are created alongside them, which is a decision rather than a surprise. A reorder or a delimiter change is not an axis change and never blocks.\n"
                  },
                  "location_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the inventory location for the import. For **single** this is the destination bin; for **split_bins** and **absolute_chaos** it is the container that receives the auto-created bins. Required for those three; must not be provided for `set_code` / `csv_location` / `smart_binning` / `template`.\n"
                  },
                  "bin_size": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Cards per bin for **split_bins** (e.g. 40) and **absolute_chaos**. Required for those two; ignored otherwise.\n"
                  },
                  "bin_name_prefix": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[^>]*$",
                    "default": "Bin",
                    "description": "Label prefix for bins auto-created by **split_bins** and **absolute_chaos**, producing `<prefix> 1`, `<prefix> 2`, …. Defaults to \"Bin\". Cannot contain `>`, which is the separator HippoLink joins a location's `full_path` breadcrumb with (422 otherwise).\n"
                  },
                  "start_new_bin": {
                    "type": "boolean",
                    "default": false,
                    "description": "**absolute_chaos only.** Absolute Chaos Binning only; true starts the import in a new bin instead of topping off the last one (bin 1 when the container has no numbered bin). `true` with any other strategy is a 422.\n"
                  },
                  "dry_run": {
                    "type": "boolean",
                    "default": false,
                    "description": "**absolute_chaos only, and required `true` there.** The job plans the bins and writes nothing else — no inventory, no bins, no prices — and is left out of the jobs list. Its status carries `plan_digest`, its plan is at `GET .../import/{import_job_uuid}/bins`, and `POST .../import/{import_job_uuid}/apply` imports it. `true` with any other strategy, or `absolute_chaos` without it, is a 422.\n"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "merge",
                      "replace"
                    ],
                    "default": "merge"
                  },
                  "lock_prices": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true the import adds and adjusts quantities only and never writes a price, whatever the file carries: existing prices stay as they are and a card the store has not priced yet stays unpriced until repricing reaches it. Use it for a file from scanning software whose prices should not replace the store's own. Not the same as the per-SKU price lock, which exempts one SKU from reprice rules.\n"
                  },
                  "price_from_rules": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, every card this import leaves in stock without a price is priced by the store's enabled repricing rules as the import finishes, instead of waiting for the next scheduled reprice. It only fills prices that are missing: a price from the file, a price the store already has, and a locked SKU are never changed. A card no rule prices stays unpriced and is counted in `rules_needs_attention`. Needs the `inventory.set_sell_price` permission (403 otherwise). Not with `location_strategy: absolute_chaos` (422).\n"
                  },
                  "cost_batch_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Put every card this import takes in into this open cost batch. Each row that adds copies becomes a lot in the batch, priced or not: the file's purchase price is its provisional cost, else $0, and Auto COGS does not apply. The batch's total is spread over them when it is finished. Not with `new_cost_batch_name`, and not with `mode: replace` (422: a replace import re-imports the cards the store already had, which would count them in the batch twice). Needs the `inventory.manage_cost_batches` permission (403). 404 for an unknown batch, 409 (`cost_batch_not_open`) for one that is finishing or finished.\n"
                  },
                  "new_cost_batch_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "description": "Create a new open cost batch with this name and put the import's cards into it, as `cost_batch_uuid` does. Not with `cost_batch_uuid`, and not with `mode: replace` (422).\n"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "If provided, the server will POST a job status update to this URL when the job completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Import job created with presigned upload URL",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Either an idempotency-key conflict, or — with `error: \"bin_axes_changed\"` — a bin template that splits on different card properties than the store's last import did, which needs `acknowledge_axis_change: true` to go ahead. Or, with error \"cost_batch_not_open\", the chosen cost batch is finishing or finished.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinAxesChangedError"
                }
              }
            }
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/bin-templates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBinTemplates",
        "tags": [
          "Inventory"
        ],
        "summary": "List the store's saved bin-name templates",
        "description": "A bin-name template describes how a **template**-strategy import files cards on the store's shelves: a string of `$` variables with `\" > \"` between levels, where everything before the last level is a container and the last is the bin. A store keeps several — one per wall, say — and picks one at import time, or lets the import fall back to whichever is marked default.\n\nUnpaginated: this is a picker, not a feed. Default first, then A–Z by name.\n\nThe response also carries `presets`: three ready-made layouts, identical for every store and ordered by how many things about a card decide its bin (five, then four, then three), that a store with nothing saved can start from. That order is not a ranking by how many bins the store ends up with — an alphabetical split costs far more bins than a condition one — so each preset's `description` states its own bin cost.\n\nThe outer two are the strategies this wizard used to offer — \"Smart Binning by Set, Language, Condition, Finish\" and \"Bin by Game, Set, & Letter\" — written out as editable templates, so a store that filed either way keeps its shape and can then adjust it; the middle one shelves foils apart while letting conditions share a bin. Suggestions only: they are saved through `createBinTemplate` like anything else.\n\n**The variables**, and when each renders nothing:\n\n| variable | renders | renders nothing when | |---|---|---| | `$GAME_NAME` | `Disney Lorcana` | the card is Magic | | `$GAME_NAME_ALWAYS` | `Magic: The Gathering` | never | | `$SET_NAME` | `Dominaria United` | never | | `$SET_NAME_UNLESS_FOREIGN` | `Dominaria United` | the card is neither English nor its game's catalog language; pair it with `$LANGUAGE` so a foreign card's bin is named for its language alone, one bin per language whatever the set | | `$PRODUCT_STARTING_LETTER` | `A`, or `Misc` | never | | `$LANGUAGE` | `Japanese` | the card is English | | `$LANGUAGE_ALWAYS` | `English` | never | | `$CONDITION` | `Near Mint`, `Unopened` | never | | `$FINISH` | `Non-Foil` | the card is sealed (`Unopened`) | | `$FINISH_ALWAYS` | `Foil` | never |\n\nThe suppressing variants exist so every Magic and every English bin a store has already built and physically labelled keeps its name; the `_ALWAYS` variants are for a store that wants the word on the label. Switching between the two variants of a variable **relabels** a store's bins without splitting them.\n\nLiteral text collapses around a variable that renders nothing, so `\"$GAME_NAME - $SET_NAME - $CONDITION\"` reads `Dominaria United - Near Mint` for a Magic card and `Disney Lorcana - The First Chapter - Near Mint` for a Lorcana one. A level whose variables all render nothing is dropped and its children move up a level.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's saved templates, and the starters to begin from",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "templates",
                    "presets"
                  ],
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BinTemplate"
                      }
                    },
                    "presets": {
                      "type": "array",
                      "description": "Ready-made layouts a store can start from, the same for every store and in a fixed order. Nothing is saved until the store copies one through `createBinTemplate`, so a store with an empty `templates` still has somewhere to begin. They carry no `template_uuid`, which is how a picker tells a starter from a saved template.\n",
                      "items": {
                        "$ref": "#/components/schemas/BinTemplatePreset"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createBinTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Save a bin-name template",
        "description": "Validates the template before saving it, so a template a store saves cannot be one an import then refuses: an unknown variable, an empty level, a last level with no variable at all, two levels splitting on the same variables, or a template whose longest possible bin name would exceed a location name's 500-character limit is a 422.\n\n`is_default: true` takes the default over from whichever template currently holds it. A store with no default must name one at import time.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BinTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Template saved",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The store already has a template by that name",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/bin-templates/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewBinTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Render a bin-name template against a sample card",
        "description": "What the template builder shows live while someone types: the levels a template would build for one card, the machine key each level would carry, the card properties it splits on, and — when the store has run a templated import before — which of those properties changed since. Read-only; it creates nothing and saves nothing.\n\nAdvisory. The blocking half of the same check runs on the import create itself (409 `bin_axes_changed`), because a one-off `bin_name_template` can change the split without ever passing through the builder.\n\nA sample the template *refuses* comes back as `refused` naming the missing catalog values rather than as an error — \"this template cannot shelve a card whose set we don't know\" is what the builder should show.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "sample": {
                    "type": "object",
                    "description": "Override any of the sample card's fields. Defaults to a Magic, English, Near Mint, non-foil single — the bulk of every store's shelf, and the case where the suppressing variables all disappear. Unknown fields are ignored.\n",
                    "properties": {
                      "game": {
                        "type": "string"
                      },
                      "set_name": {
                        "type": "string"
                      },
                      "language": {
                        "type": "string"
                      },
                      "condition": {
                        "type": "string"
                      },
                      "finish": {
                        "type": "string"
                      },
                      "product_name": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The rendered preview",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinTemplatePreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/bin-templates/{template_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "template_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getBinTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Get one saved bin-name template",
        "description": "One of the store's saved bin-name templates: its name, the template text an import uses to name bins, and whether it is the store's default (the template an import that names none falls back to). The built-in presets have no id and are only returned by `listBinTemplates`. An unknown id, or another store's, is 404.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateBinTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Update a saved bin-name template",
        "description": "Absent fields are left alone. A template sent here is validated exactly as it is on create.\n\nEditing a template does **not** re-file anything: jobs that already ran keep their own snapshot of the text they ran with, which is what lets the next import find the shelves the last one built. If the edit changes which card properties the template splits on, the next import asks for confirmation before running.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "template": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "is_default": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The updated template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The store already has a template by that name",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteBinTemplate",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete a saved bin-name template",
        "description": "Jobs that ran with it are untouched — each snapshots the template text it ran with, so deleting the saved row does not strand the shelves it built.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/api": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "importInventoryFromApi",
        "tags": [
          "Inventory"
        ],
        "summary": "Start an inventory import from a connected marketplace API",
        "description": "Triggers an inventory import that pulls listings from a connected marketplace API (no file upload). `format_id` selects a registered API-source importer (e.g. `cardtrader_api`); the job is created and enqueued immediately, then runs asynchronously using the store's saved credentials for that marketplace. Poll the returned job UUID for status.\n\n`snapcaster_api` imports the seller's existing Snapcaster listings (keyed by TCGplayer SKU, on-hand quantity, CAD price). Offer it before the first push to Snapcaster, which replaces the seller's listings with HippoLink's. It answers 409 `snapcaster_not_connected` when no active Snapcaster connection exists and 409 `snapcaster_import_currency_unsupported` for a store that does not price in CAD.\n\n**mode** matches the file import: **merge** (default) upserts, **replace** drops existing inventory in the target location tree and sets quantities to exactly match the source — existing rows are overwritten, not accumulated. **location_strategy** supports **single** (requires `location_uuid`) and **set_code** (locations managed automatically; `location_uuid` must not be provided). `csv_location` is not available for API imports.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "format_id"
                ],
                "properties": {
                  "format_id": {
                    "type": "string",
                    "description": "Registry id of an API-source importer, e.g. `cardtrader_api`.\n",
                    "example": "cardtrader_api"
                  },
                  "location_strategy": {
                    "type": "string",
                    "enum": [
                      "single",
                      "set_code"
                    ],
                    "default": "single",
                    "description": "**single** requires `location_uuid`. **set_code** manages locations automatically and must not include `location_uuid`; it organises into `<set>` containers holding `<set> - <letter>` bins.\n"
                  },
                  "location_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Destination location. Required when `location_strategy` is `single`; must not be provided otherwise.\n"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "merge",
                      "replace"
                    ],
                    "default": "merge"
                  },
                  "lock_prices": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true the import adds and adjusts quantities only and never writes a price, whatever the file carries: existing prices stay as they are and a card the store has not priced yet stays unpriced until repricing reaches it. Use it for a file from scanning software whose prices should not replace the store's own. Not the same as the per-SKU price lock, which exempts one SKU from reprice rules.\n"
                  },
                  "price_from_rules": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, every card this import leaves in stock without a price is priced by the store's enabled repricing rules as the import finishes, instead of waiting for the next scheduled reprice. It only fills prices that are missing: a price from the file, a price the store already has, and a locked SKU are never changed. A card no rule prices stays unpriced and is counted in `rules_needs_attention`. Needs the `inventory.set_sell_price` permission (403 otherwise).\n"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "If provided, the server POSTs a job status update to this URL when the job completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Import job accepted and enqueued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "startImport",
        "tags": [
          "Inventory"
        ],
        "summary": "Confirm upload and start import processing",
        "description": "After uploading the CSV to the presigned URL, call this endpoint to confirm the upload and begin async processing. The server validates the file exists on S3 and transitions the job to \"pending\".\nA merge-mode import adds to the shelf, so uploading the same file again would add the same copies a second time. When the file is byte-identical to an earlier merge import of the store (queued, running or completed, not reverted, within the last 30 days) the request is refused with 409 `duplicate_import_file`, naming the earlier job. Send `confirm_duplicate: true` to run it anyway, or revert the earlier import first. Replace-mode imports and previews are not checked (#3115).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "confirm_duplicate": {
                    "type": "boolean",
                    "default": false,
                    "description": "Run a merge import even though the same file was already imported (see the 409 below).\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Import processing started",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The upload is missing (`import_upload_missing`), the import was already started (`import_job_already_started`), or (`duplicate_import_file`) the file is identical to an earlier merge import of this store. `duplicate_of_job_uuid` and `imported_at` identify that import.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "duplicate_of_job_uuid": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "imported_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getImportStatus",
        "tags": [
          "Inventory"
        ],
        "summary": "Get import job status",
        "description": "Returns progress and results for an async CSV import. Rate limited to 1 request per second. On failure the import is fully rolled back.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/revert": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "revertInventoryImport",
        "tags": [
          "Inventory"
        ],
        "summary": "Revert a completed inventory import",
        "description": "Creates a revert job that undoes a completed import's recorded effects — quantities are restored (or, for a replace-mode wipe, reinserted) only where the current state still matches what the import's ledger recorded; anything touched since (a sale, another import, a manual edit) is left alone and reported as skipped. Neither prices nor store reserves are reverted — a price change is recorded in the card's price history and stands. Poll the returned job UUID via the status endpoint; a revert job's `job_type` is `revert` and its `source_job_uuid` names the import it targets. A job can only be reverted once, and a revert job itself cannot be reverted.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Revert job created and enqueued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The source import isn't completed, has already been reverted, or already has a revert job in progress (`revert_conflict`, with `params.reason` saying which).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The target job is itself a revert job (`invalid_revert_target`).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/cost-batch": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "assignImportToCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Add a completed import's cards to a cost batch",
        "description": "Puts the cards a completed import took in into an open cost batch. Lots the import made (rows with a purchase price) join at their cost, which becomes provisional; every other row the import added copies for gets a $0 provisional lot, received when the import completed. 409 when the import is not completed, was reverted, is being reverted, was a replace-mode import (its cards would be counted twice), or already has cards in a batch, or when the batch is not open.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignImportToCostBatchRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the request breaks a rule of this route (named by its `error` code, for example `import_mode_unsupported`, `sync_columns_fixed`, `invalid_bin_name_template`, `scope_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The cards joined the batch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchAssignment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/rows": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listImportJobRows",
        "tags": [
          "Inventory"
        ],
        "summary": "List the cards an import created or updated",
        "description": "The rows behind a completed import's `created` and `updated` counters: one per bin-and-SKU the import wrote, with its quantity before and after. Filter with `outcome`; `counts` always carries both totals so a screen showing them as cards needs no second call. Skipped rows are not here, they are the `errors` on the job status. An import that ran before this endpoint existed has no rows, so `counts` is zero for it even when the job's own counters are not. Paginated in write order.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "created",
                "updated"
              ],
              "default": "all"
            },
            "description": "Filter by what the import did to the card."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Created / updated rows for the import job",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportJobRowListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/tags": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getImportTagReview",
        "tags": [
          "Inventory"
        ],
        "summary": "Review the tag changes an import staged",
        "description": "A CSV import's `HippoLink Tags` column does not change the store's tags while it runs: it stages one add or remove per product and tag for the store to review. This returns one entry per tag with how many products it would be added to and removed from. `state` is derived from the staged rows: `none` when the import staged nothing; `processing` while rows are pending but the import has not completed (nothing can be applied yet, and there is no `expires_at`); `pending` while any row is still pending, until seven days after the import completed, when it becomes `expired` (`expires_at` is that moment, and is reported for both); with nothing pending, `discarded` when every row was discarded, `reverted` when a revert of the import undid its applied changes, and `applied` otherwise (applied, noop and refused rows all mean the review was acted on). `warnings_count` is how many tag warning rows (`tag_name_invalid`, `tag_name_ambiguous`, `tag_not_assignable`, `tag_hotlist_not_allowed`, `tag_staging_failed`) the import recorded on its job status `errors`; each code lists at most 100 rows, then one more row (`row_number` 0) giving that code's total. 404 `import_job_not_found` for an unknown job or another store's.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The staged tag changes",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportTagReview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/tags/products": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listImportTagProducts",
        "tags": [
          "Inventory"
        ],
        "summary": "List the products behind one staged tag",
        "description": "The products one entry of the tag review would add the tag to or remove it from, with the store's on-hand count of each. `key` is the entry's `key` from the review. Paginated; `limit` over 250 is a 422. A missing `key` or an `action` other than `add` / `remove` is a 400 `query_param_invalid`. 404 `import_job_not_found` for an unknown job or another store's.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tag entry's `key` from the review."
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "add",
                "remove"
              ]
            }
          },
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "set_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was missing or malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "One page of products",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ImportTagProduct"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/tags/apply": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "applyImportTags",
        "tags": [
          "Inventory"
        ],
        "summary": "Apply the reviewed tag changes of an import",
        "description": "Applies the staged tag changes of the tags named in `keys` (each a `key` from `getImportTagReview`) and discards every other pending change of the import, in one transaction. A new tag is created with a slug derived from its name (`-2`, `-3`, ... when taken; never a platform slug); a new name that now matches one of the store's tags, ignoring case, is added to that tag instead. A new name matching two or more of the store's tags, and a tag the store deleted since the import, are refused and listed in `refused_tags`. A system tag (Do Not Sell, Do Not Buy, the eBay pair, the hotlist) is created on first use. `colors` sets the color of a new tag the apply creates (stored uppercased); it never recolors an existing tag, including one a new name attaches to. A product whose added tags would take it over 25 store tags has all of its changes refused (`refused_products`); system tags count toward neither limit. `applied` counts changes that changed a tag on a card, `noop` those already in place. Removes take only whole-card tags; a tag set on single SKUs stays. After the commit, changes to Do Not Sell re-push the cards' in-stock SKUs to marketplaces, Do Not Buy refreshes their buylist offers, the eBay pair re-runs the eBay selection, and hotlist adds update the storefront. Beyond the route's `inventory.manage_import`, the caller needs `inventory.manage_tags`, and `inventory.manage_hotlist` when `keys` includes `hotlist`; a caller without one gets 403 `permission_denied` naming it in `params.permission_key`, and nothing is applied. 409 `import_tags_not_ready` while the job is not a completed import, `import_tags_not_pending` once the changes were applied or discarded (including by a concurrent call), `import_tags_expired` seven days after the import completed, `import_tags_store_limit` when the new tags would take the store over 200 tags (nothing is written; `params.limit`, `params.new_tags`, `params.existing`); 422 `import_tags_unknown_key` for a key with no pending change (`params.keys`), `validation_error` for a missing body or a missing or empty `keys`, or a `colors` entry that is not a `#RRGGBB` hex color or not keyed by a new tag in `keys` (a field error on `colors`). 404 `import_job_not_found` for an unknown job or another store's.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyImportTagsRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "What the apply did",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportTagApplyResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`import_tags_not_ready`, `import_tags_not_pending`, `import_tags_expired` or `import_tags_store_limit`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`import_tags_unknown_key` or `validation_error` (no body, or no `keys`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/tags/discard": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "discardImportTags",
        "tags": [
          "Inventory"
        ],
        "summary": "Discard the staged tag changes of an import",
        "description": "Discards every pending tag change the import staged, leaving the store's tags as they are. An expired review can still be discarded. 409 `import_tags_not_ready` while the job is not a completed import, `import_tags_not_pending` once the changes were applied or discarded (including by a concurrent call). 404 `import_job_not_found` for an unknown job or another store's.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "How many changes were discarded",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "discarded"
                  ],
                  "properties": {
                    "discarded": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`import_tags_not_ready` or `import_tags_not_pending`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/apply": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "applyImportPreview",
        "tags": [
          "Inventory"
        ],
        "summary": "Apply an Absolute Chaos Binning preview",
        "description": "Creates the import a completed `absolute_chaos` preview planned and queues it — same file (no re-upload), same container, bin size and prefix — and returns it. Send the preview's `plan_digest`. The job re-plans before it writes: if the container's last bin changed since the preview (a card added, sold or moved there, a bin created), it fails with `plan_changed` and writes nothing, and the store previews again. One apply per preview: calling this again returns the same job. 409 `not_a_preview` for any other job, `preview_not_completed` for a preview still running or one that failed, `preview_upload_expired` once the preview's file has expired from storage; 422 `plan_digest_mismatch` for a digest that is not this preview's. The apply is a merge import, so a file identical to an earlier non-reverted merge import of the store is refused with 409 `duplicate_import_file` unless `confirm_duplicate` is true (#3115).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyImportPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "The import was created and queued (or had been, by an earlier call).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`not_a_preview`, `preview_not_completed`, `preview_upload_expired` or `duplicate_import_file`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`validation_error` (no `plan_digest`) or `plan_digest_mismatch`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/bins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listImportPlanBins",
        "tags": [
          "Inventory"
        ],
        "summary": "List an Absolute Chaos Binning job's bins",
        "description": "An `absolute_chaos` job's bins in order, each with the runs of the file that land in it, in file order. On a preview this is the plan (a bin the import will create has no `location_uuid` yet); on the applied job it is the filing report. A run's positions are its place in the bin when filed; they are not kept in step with later sales. 409 `not_absolute_chaos` for a job of another strategy. Paginated over bins.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "One page of the job's bins",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPlanBinListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/discrepancies": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listImportDiscrepancies",
        "tags": [
          "Inventory"
        ],
        "summary": "List stock an override import removed or reduced",
        "description": "For a replace/override import, returns the review-and-mark overview of what the override wiped: each card that was in the bin but absent (or short) in the file, with quantity before → after and its captured cost basis. Nothing counts as shrinkage until marked (see the mark endpoint). Merge imports produce none. Paginated, newest/removed-first.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "pending",
                "marked"
              ],
              "default": "all"
            },
            "description": "Filter by review status."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "removed",
                "reduced"
              ],
              "default": "all"
            },
            "description": "Filter by discrepancy type."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Override discrepancies for the import job",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportDiscrepancyListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/import/{import_job_uuid}/discrepancies/mark": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "import_job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "markImportDiscrepancies",
        "tags": [
          "Inventory"
        ],
        "summary": "Classify override discrepancies as shrinkage or correction",
        "description": "Applies one removal reason to the selected discrepancies — or every pending row when `all` is true. A `shrinkage_*` reason records the loss in the shrinkage report valued at the captured cost; `manual_correction` records a non-loss and is excluded. Marking is one-way: an already-marked row is left locked and reported under `skipped`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkImportDiscrepanciesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Discrepancies marked",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkImportDiscrepanciesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listLocations",
        "tags": [
          "Locations"
        ],
        "summary": "List locations for a store as a depth-limited tree",
        "description": "Returns locations as a nested tree, similar to Unix `tree -L`. The `depth` parameter controls how many levels are expanded (default 2 — roots and their immediate children). Nodes at the depth boundary have `children: []`; compare with `child_count` to tell whether a node is a leaf or has unexpanded children. Use `parent_location_uuid` to shift the query root for lazy-loading deeper subtrees when expanding a collapsed node in the UI.\n\nThis endpoint does not support name search: it returns a depth-limited tree, so a name filter here would silently miss matches below the loaded depth. Passing a `q` or `search` query parameter returns 422 — route name search through `GET /v1/stores/{store_uuid}/locations/search`, which scans the whole store regardless of tree depth.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 2
            },
            "description": "Number of tree levels to expand from the query root. 1 = only root-level (or direct children of parent_location_uuid); 2 = roots + their children (default); 3 = three levels; etc. A value above 10 is treated as 10.\n"
          },
          {
            "name": "parent_location_uuid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Shift the query root to this location. The response will contain its direct children (expanded `depth` levels). Omit to start from the store's root-level locations.\n"
          },
          {
            "name": "card_preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, each bin location in the response includes `first_card` and `last_card` — the first and last card by sequence index with product name and number. Omit or pass false (default) to skip the product lookup, which can be expensive for stores with many bins.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Maximum number of nodes returned per parent. It pages the queried level together with `offset`, and it also truncates every level below it to that many children per node. Defaults to the cap rather than the usual 50 so a store whose levels all fit under 250 sees the whole tree in one call.\n"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "Number of nodes to skip at the queried level (the direct children of `parent_location_uuid`, or the store's root-level locations). Deeper levels are not offset — drill into a node with `parent_location_uuid` to page its children.\n"
          },
          {
            "name": "include_stats",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, the response carries a `stats` object rolling up the store's whole location set (card count, bins, containers, summed capacity). Opt-in because it aggregates every storage row the store owns — request it only where those figures are displayed, and note they describe the store, not the returned page.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Location tree expanded to the requested depth",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationTreeResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Create a new location within a store",
        "description": "Creates a new location. If parent_location_uuid is provided, the location is created as the last child of that parent. Otherwise it is created as a root-level location. The server automatically assigns the next sequence_index value among siblings.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 500,
                    "pattern": "^[^>]*$",
                    "description": "Cannot contain `>`, which is the separator HippoLink joins a location's `full_path` breadcrumb with (and writes into the `Location` column of inventory exports). 422 otherwise. Widened from 200 to 500 characters by the templated import binning strategy, whose rendered bin names can carry several catalog values at once.\n"
                  },
                  "description": {
                    "type": "string"
                  },
                  "custom_id": {
                    "type": "string",
                    "description": "Optional user-defined identifier for the location"
                  },
                  "maximum_capacity": {
                    "type": "integer",
                    "description": "Maximum number of cards this location can hold"
                  },
                  "is_listable": {
                    "type": "boolean",
                    "default": true,
                    "description": "When false, stock in this location is held (cost-tracked but not synced to marketplaces). Defaults to true.\n"
                  },
                  "prices_locked": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true (bins only), every card with stock in this bin is price-locked: repricing rules and first-pricing skip it. A card moved into the bin is locked and one moved out stops being locked by the bin; a lock the user set on the card itself is untouched. Setting it needs the lock-bin-prices permission. Defaults to false.\n"
                  },
                  "in_store_only": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, stock in this location sells in store (Square, Shopify, the kiosk) but is never listed on a third-party marketplace (TCGplayer, ManaPool, CardTrader, eBay). Unlike is_listable=false, which holds the stock back from every channel. Defaults to false.\n"
                  },
                  "is_default_intake": {
                    "type": "boolean",
                    "default": false,
                    "description": "Marks this location as the store's default intake location: the fallback destination for buylist pushes using the set_code or chaos strategy. At most one per store; setting it here clears it elsewhere.\n"
                  },
                  "notify_on_online_sale": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, an online sale of a card physically present in this location raises a \"pull this copy now\" alert so staff can remove it before a walk-in double-sells it. Intended for customer-browsable display cases. Defaults to false.\n"
                  },
                  "intake_set_codes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Set codes (e.g. \"MH3\", \"OTJ\") routed to this location by the buylist push set_code strategy. Normalized to uppercase.\n"
                  },
                  "location_type": {
                    "$ref": "#/components/schemas/LocationType"
                  },
                  "parent_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "UUID of the parent location. Omit or set to null to create a root-level location. The parent must be a container type.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Location created",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/search": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "searchLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Search locations by breadcrumb or custom_id",
        "description": "Performs a flat (non-hierarchical) search across all locations in the store, matching against the location's whole breadcrumb (`full_path`) or its custom_id, case-insensitively. Results include ancestry breadcrumbs for context but do not include child nodes. Locations whose own name/custom_id matched are returned first, each tier ordered by full_path ascending.\n\nThis is the endpoint a location search box should call. `listLocations` returns one page of one level of the tree and rejects a search parameter outright, so filtering its response client-side can only ever match what that page happened to load.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3
            },
            "description": "Search query. Matched against the location's whole breadcrumb (`full_path`, the ancestor names joined with ` > `) and its custom_id using case-insensitive pattern matching (ILIKE). Both sides fold diacritics, so `Cafe` finds a bin labelled `Café Case`, and a bin at `Back Room > Shelf A > Slot 3` is found by any of the three segments — not only its own leaf label.\n\nA term may itself be a breadcrumb (`Shelf A > Slot`); separator spacing is normalised and a run of separators collapses, so `Shelf A>Slot` and `Shelf A>>Slot` match the same rows. That applies to the breadcrumb match only — custom_id is matched against the term as typed, since a `>` is legal in a custom_id even though it is not in a name. A term made only of separators is refused (422), the same call the length floor makes. A location whose own name or custom_id matched sorts ahead of one that matched only through an ancestor, so the bin a user named exactly is not buried behind its container's other contents.\n\n**At least 3 characters, after trimming.** A shorter term matches most of a store's locations, so it costs a full scan plus the `total` count to return a page nobody can use — once per keystroke if a UI fires per character. A blank or absent `q` is a missing required parameter (400); a present-but-too-short one is a well-formed request the server declines to run (422). A client with a search box should gate on the length itself so a user never meets either.\n"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "card_preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, each bin in the results carries `first_card` and `last_card`, the same snapshot `listLocations` populates. Use it when search results render in the same card as the browsing view, so a match doesn't lose the preview strip. Omit or pass false (default) to skip the product lookup.\n"
          },
          {
            "name": "parent_location_uuid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Narrow the search to this location's **subtree** — its descendants at any depth, not the location itself. Omit to search the whole store. Within a scope the breadcrumb match is *relative* to it: the scope's own ancestry is not searchable from inside it, since every descendant carries it and typing the container you are standing in would return everything it holds.\n\nThis is what makes the endpoint usable as the search box of a browsing UI: pass the same `parent_location_uuid` the view is browsing, and a search covers everything inside that container rather than the one page of one level `listLocations` returned. Descendants rather than direct children, because a match one container deeper is still \"in here\" to the person typing.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated flat list of matching locations",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationSearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/lookup": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "lookupLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Resolve many locations by uuid",
        "description": "Resolves a set of location uuids to their metadata and ancestry breadcrumbs in one request. This is the endpoint to call when you already know *which* locations you are showing and only need to **label** them — a picker rendering the breadcrumb of a stored bin, a list showing where each of its rows is destined.\n\nUse it instead of calling `getLocation` per uuid. That operation answers a much bigger question: it embeds a page of up to 50 cards plus a quantity sum, a row count and a per-level ancestor walk, none of which a breadcrumb reads. Resolving one label per row that way costs one request per row, and a screen with enough rows will exhaust the API stage's burst allowance and start taking 429s.\n\nUnknown, cross-store and soft-deleted uuids are **omitted** from the response rather than failing it, so one stale uuid costs that row its breadcrumb and nothing more. Duplicates collapse. Results are ordered by `full_path` ascending, matching `searchLocations`, so the two responses sort the same way when merged into one cache.\n\n`first_card` and `last_card` are always present and always null here — this endpoint never peeks at cards. They are emitted so a location from this response and one from `searchLocations` have the same shape.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "uuids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated location uuids, at most **150** distinct values per request; over that is a 422 telling you to send the rest in a second request. Duplicates collapse and do not count against the limit.\n\nThe 150 is a request-line budget, not the usual 250 pagination ceiling. These uuids travel in the query string, and API Gateway caps the combined request line and header values at 10,240 bytes: a uuid plus its comma is 37 of them, so 250 would spend 9,250 on the query string alone and leave under a kilobyte for every header — less than a bearer token often is by itself. Chunk above 150; the saving is the ratio against one request per uuid, not the batch size.\n\nA malformed uuid is a 422 naming it, rather than a silent omission: the batch resolves in one statement, so a value Postgres cannot cast would drop results that are otherwise fine. An absent or blank `uuids` is a missing required parameter (400).\n"
          }
        ],
        "responses": {
          "200": {
            "description": "The locations that resolved, ordered by full_path.\n\nDeliberately carries **no `ETag`**, unlike the other location reads. The validator they return is store-wide — two aggregates, one a MAX over every storage row the store owns — which would cost more than the whole rest of this endpoint, to produce something no client sends back and that any unrelated write in the store invalidates.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationLookupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/recount-flags": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listRecountFlags",
        "tags": [
          "Locations"
        ],
        "summary": "List bin recount flags",
        "description": "Lists bins flagged for a physical recount after a pick shortfall (a picker found fewer copies than the system expected during fulfillment). Each flag carries the expected/found counts, the bin's current system count, and bin + card metadata. A manager resolves a flag by recounting the bin. Filter by `status` (open by default), by bin (`location_uuid`), and by how many open flags a bin holds (`min_flags_per_bin`). For open flags `min_flags_per_bin` defaults to the store's `recount_alert_min_flags_per_bin` (1 unless the store raised it), so the default open list is the set the Bin Recounts badge counts; `below_threshold` says how many open flags that leaves out.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Which flags to return; defaults to open (unresolved).",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "location_uuid",
            "in": "query",
            "description": "Only flags in these bins: up to 100 comma-separated bin ids. An id that names no bin of the store matches nothing.\n",
            "schema": {
              "type": "string"
            },
            "example": "1f0c4a9e-2b7d-4c1e-9a55-3c1b2d4e5f60,7a9e0b3c-6d2f-4e8a-b1c4-0d9e8f7a6b5c"
          },
          {
            "$ref": "#/components/parameters/RecountMinFlagsPerBin"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of bin recount flags",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecountFlagListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/recount-flags/resolve-as-is": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "resolveAllRecountFlagsAsIs",
        "tags": [
          "Locations"
        ],
        "summary": "Approve all open bin recount flags at the current count",
        "description": "Resolves every open recount flag in the store with `recount_qty` set to the bin's current system count for the SKU, the same result as resolving each flag with an equal count: no stock moves, no ledger rows are written and the SKUs are re-pushed so copies a flag was hiding go back on sale. Meant for after a full inventory count, when the open flags are stale. Pass `flagged_at_or_before` (the newest `flagged_at` the caller has seen) so a flag raised since stays open. Pass `location_uuids` to approve only those bins, and `min_flags_per_bin` to approve only bins holding at least that many open flags; it defaults to the store's `recount_alert_min_flags_per_bin`, so with no scope this approves what the default `listRecountFlags` view shows. Flags in TCGplayer Direct or CardTrader Zero holding locations stay open and are counted in `skipped_holding`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveAllRecountFlagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The open flags were resolved at the current count",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveAllRecountFlagsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/recount-flags/bins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listRecountFlagBins",
        "tags": [
          "Locations"
        ],
        "summary": "List bins with open recount flags",
        "description": "One row per bin holding open recount flags, most flags first (then most missing copies, then bin path). `missing_copies` sums what the pickers came up short by. `newest_flagged_at` is the cutoff to send as `flagged_at_or_before` when approving one bin as-is. `min_flags_per_bin` defaults to the store's `recount_alert_min_flags_per_bin`, the same bins the default `listRecountFlags` view shows; `below_threshold` counts the bins and flags it leaves out. Holding bins are listed with `is_holding` true: they cannot be recounted or approved as-is.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RecountMinFlagsPerBin"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated bins with open recount flags",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecountFlagBinListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/recount-flags/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getRecountFlagSettings",
        "tags": [
          "Locations"
        ],
        "summary": "Get the store's recount settings",
        "description": "Returns whether an open bin recount flag hides that bin's copies of the SKU from sale. With `recount_hides_stock` on, the copies a flagged bin holds are left out of every quantity listed on a marketplace, Square and the kiosk until the flag is resolved. Off by default. Also returns `recount_alert_min_flags_per_bin`: how many open flags a bin needs before they count toward the Bin Recounts badge, the aging banner and the default flag list (1 by default, which counts every flag).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's recount settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecountFlagSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "updateRecountFlagSettings",
        "tags": [
          "Locations"
        ],
        "summary": "Save the store's recount settings",
        "description": "Saves either setting, or both; a field left out keeps its saved value. `recount_hides_stock` sets whether an open bin recount flag hides that bin's copies of the SKU from sale. Off by default. Turning it on takes the copies in every bin with an open flag off sale; turning it off puts them back. Either change re-pushes every SKU with an open flag so the marketplaces catch up. Saving the value the store already has changes nothing. `recount_alert_min_flags_per_bin` (1-100) sets how many open flags a bin needs before they count toward the badge, the aging banner and the default flag list; it never changes what the hold hides.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecountFlagSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved recount settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecountFlagSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/recount-flags/{flag_uuid}/resolve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "flag_uuid",
          "in": "path",
          "required": true,
          "description": "The recount flag to resolve.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "resolveRecountFlag",
        "tags": [
          "Locations"
        ],
        "summary": "Resolve a bin recount flag with a manager recount",
        "description": "Records a manager's physical recount of the flagged bin+SKU and clears the flag. This is the only path that writes a bin's count down from a pick discrepancy. Sets the bin's total quantity to `recount_qty`: a lower count books shrinkage (consuming lots FIFO) and drops the storage row when the recount is zero; a higher count intakes the difference as a lot at the SKU's last known cost; an equal count just clears the flag.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveRecountFlagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The flag was resolved and the bin count reconciled",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveRecountFlagResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "get": {
        "operationId": "getLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Get a single location",
        "description": "Returns location metadata and ancestry breadcrumb. Fetch the products stored in this location separately via `GET /v1/stores/{store_uuid}/locations/{location_uuid}/products`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Location details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationDetailResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Update a location's details",
        "description": "Updates a location's fields (name, description, custom_id, capacity, listable and default- intake flags, intake set codes). Can reparent the location via parent_location_uuid, which must reference a container and must not create a cycle. Honors the If-Match ETag (412 on mismatch).\n\nThe ETag also moves whenever stock in the location changes, so an edit form should send `expected_<field>` for each field it sets instead: the value it loaded for that field (#3278). Each is only accepted alongside its field (400 otherwise). A mismatch with the stored value returns 412 and writes nothing, unless the location already holds the requested value (a retried save).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 500,
                    "pattern": "^[^>]*$",
                    "description": "Cannot contain `>`, which is the separator HippoLink joins a location's `full_path` breadcrumb with (and writes into the `Location` column of inventory exports). 422 otherwise. Widened from 200 to 500 characters by the templated import binning strategy, whose rendered bin names can carry several catalog values at once.\n"
                  },
                  "description": {
                    "type": "string"
                  },
                  "custom_id": {
                    "type": "string"
                  },
                  "maximum_capacity": {
                    "type": "integer"
                  },
                  "is_listable": {
                    "type": "boolean",
                    "description": "When false, stock in this location is held (cost-tracked but not synced to marketplaces).\n"
                  },
                  "prices_locked": {
                    "type": "boolean",
                    "description": "When true (bins only), every card with stock in this bin is price-locked: repricing rules and first-pricing skip it. A card moved into the bin is locked and one moved out stops being locked by the bin; a lock the user set on the card itself is untouched. Setting it needs the lock-bin-prices permission.\n"
                  },
                  "in_store_only": {
                    "type": "boolean",
                    "description": "When true, stock in this location sells in store (Square, Shopify, the kiosk) but is never listed on a third-party marketplace (TCGplayer, ManaPool, CardTrader, eBay). Turning it on delists the bin's stock; turning it off relists it up to what is free to sell.\n"
                  },
                  "apply_to_descendants": {
                    "type": "boolean",
                    "description": "When true and the request sets `is_listable` or `in_store_only`, the same value is applied to every location inside this one (holding-program boxes are skipped), and marketplaces are updated for every card in them. A container holds no cards of its own, so without this a container's flag changes nothing in its bins. Applies even when this location already has the value. Not stored; ignored when neither flag is set, and a no-op on a bin. Defaults to false.\n"
                  },
                  "is_default_intake": {
                    "type": "boolean",
                    "description": "Marks this location as the store's default intake location (fallback for set_code/chaos buylist pushes). At most one per store; setting it true clears it from any other location.\n"
                  },
                  "notify_on_online_sale": {
                    "type": "boolean",
                    "description": "When true, an online sale of a card physically present here raises a \"pull this copy now\" alert (double-sell guard for display cases).\n"
                  },
                  "intake_set_codes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Set codes routed to this location by the buylist push set_code strategy. Normalized to uppercase.\n"
                  },
                  "parent_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Move this location (and its subtree) under a new parent. Set to null to make it a root-level location. The server validates that the target is not a descendant of this location (no circular references) and belongs to the same store. The location is appended as the last sibling under the new parent.\n"
                  },
                  "expected_name": {
                    "type": "string",
                    "description": "The `name` the client loaded; see the operation description."
                  },
                  "expected_description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The `description` the client loaded; see the operation description."
                  },
                  "expected_custom_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The `custom_id` the client loaded; see the operation description."
                  },
                  "expected_maximum_capacity": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "The `maximum_capacity` the client loaded; see the operation description."
                  },
                  "expected_is_listable": {
                    "type": "boolean",
                    "description": "The `is_listable` the client loaded; see the operation description."
                  },
                  "expected_in_store_only": {
                    "type": "boolean",
                    "description": "The `in_store_only` the client loaded; see the operation description."
                  },
                  "expected_prices_locked": {
                    "type": "boolean",
                    "description": "The `prices_locked` the client loaded; see the operation description."
                  },
                  "expected_is_default_intake": {
                    "type": "boolean",
                    "description": "The `is_default_intake` the client loaded; see the operation description."
                  },
                  "expected_notify_on_online_sale": {
                    "type": "boolean",
                    "description": "The `notify_on_online_sale` the client loaded; see the operation description."
                  },
                  "expected_intake_set_codes": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "The `intake_set_codes` the client loaded; see the operation description."
                  },
                  "expected_parent_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The `parent_location_uuid` the client loaded; see the operation description."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Location updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Delete a location",
        "description": "Deletes the location. By default, child locations are reparented to the deleted location's parent. When `recursive=true`, all child and descendant locations are deleted along with their inventory. Remaining sibling locations keep their existing sequence_index values; the gap the deleted location leaves is not closed, and the surviving order is unchanged.\n\nThe delete is refused (409) while it would take stock something else needs: `location_in_use_by_fulfillment_run` when a bin in scope is on an active pick run, and `location_has_committed_stock` (with `params.copies`, `params.skus` and up to 50 `params.tcgplayer_sku_ids`) when open orders owe copies of a card the bins in scope hold and the store's other sellable bins can't cover.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "recursive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, delete this location and all its descendants (including their inventory). When false (default), children are reparented to the grandparent location.\n"
          }
        ],
        "responses": {
          "204": {
            "description": "Location deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/merge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "mergeLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Merge source locations into a target location",
        "description": "Atomically moves all inventory from the source locations into the target location (summing quantities for shared SKUs) and soft-deletes the sources. Neither the target nor any source may be a container type. Blocked when any source is referenced by an active fulfillment run.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target_location_uuid",
                  "source_location_uuids"
                ],
                "properties": {
                  "target_location_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the location that will absorb the sources."
                  },
                  "source_location_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "One or more location UUIDs to merge into the target. Each source is soft-deleted after its inventory is transferred.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Merge successful; returns the updated target location",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationDetailResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/renumber": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "renumberLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Renumber a level's pick-path order from a sort key",
        "description": "Reassigns `sequence_index` for every direct child of `parent_location_uuid` (or every root-level location when omitted), ordered by the chosen key.\n\nThis is the bulk counterpart to `reorderLocations`, and the reason a client can cap drag-to-reorder. That operation takes the complete sibling order as an array of UUIDs, so reordering a level with thousands of children means paging every one of them to the browser and posting them all back. This one decides the order server-side: the request carries a single word however many locations it renumbers, and the write is one statement with no per-row parameters.\n\nSorting is **natural**, not plain text: a label is split into digit and non-digit runs and the digits are compared numerically, so `Bin 2` precedes `Bin 10`. Plain text ordering is not a cosmetic complaint here — `sequence_index` is the picker's walking route, so it would hand the shop floor a route that zigzags the aisle with nothing on screen to say why. An already zero-padded label sorts identically either way.\n\nLocations with a null sort key sort last in either direction, and rows whose position does not change are left untouched, so `updated_at` only moves when something actually moved. Re-running with the same key is a no-op.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sort_by"
                ],
                "properties": {
                  "parent_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "UUID of the parent whose direct children are renumbered. Omit or set to null to renumber root-level locations.\n"
                  },
                  "sort_by": {
                    "type": "string",
                    "enum": [
                      "name",
                      "custom_id"
                    ],
                    "description": "Which label decides the new order."
                  },
                  "direction": {
                    "type": "string",
                    "enum": [
                      "asc",
                      "desc"
                    ],
                    "default": "asc",
                    "description": "Ascending (A to Z, 1 to 9) or descending. Locations with a null sort key sort last in **both** directions, so an unlabelled location never leads the route.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Level renumbered",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "renumbered",
                    "sort_by",
                    "direction"
                  ],
                  "properties": {
                    "renumbered": {
                      "type": "integer",
                      "description": "How many locations actually moved. Zero means the level was already in this order.\n"
                    },
                    "sort_by": {
                      "type": "string",
                      "enum": [
                        "name",
                        "custom_id"
                      ]
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "asc",
                        "desc"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/alphabetize": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "alphabetizeLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Sort the cards in many bins alphabetically at once",
        "description": "The bulk form of `alphabetizeLocationProducts`. Takes bins and/or containers; a container stands for every bin beneath it at any depth. Each bin is sorted on its own, with exactly the order and write rules of the single-bin operation (it replaces any manual order, and only rows whose position changes are written, so a second run reports `moved: 0`). A bin named twice, or named alongside a container that holds it, is sorted once.\n\nEvery uuid must be a live location in this store: an unknown, soft-deleted or other-store uuid is a 404 and nothing is sorted. The work is bounded so the one statement fits the request timeout: more than 1,000 bins, or more than 12,000 storage rows across them, is a 422 whose `error` gives the counts. Nothing is locked or written when it is refused.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "location_uuids"
                ],
                "properties": {
                  "location_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Bins and/or containers to alphabetize."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bins alphabetized",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlphabetizeLocationsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/reorder": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "put": {
        "operationId": "reorderLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Reorder sibling locations for pick-path sequencing",
        "description": "Atomically reassigns sequence_index values for sibling locations under a given parent. When parent_location_uuid is omitted (or null), reorders root-level locations. The request must include every direct child of that parent exactly once — returns 422 if any are missing or duplicated. Array position determines the new sequence_index (first element = 1, second = 2, etc.).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "location_uuids"
                ],
                "properties": {
                  "parent_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "UUID of the parent whose direct children are being reordered. Omit or set to null to reorder root-level locations.\n"
                  },
                  "location_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Ordered list of all direct child location UUIDs of the specified parent. Array position determines the new sequence_index.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Locations reordered",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "locations"
                  ],
                  "properties": {
                    "locations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Location"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "createBoxRebuild",
        "tags": [
          "Locations"
        ],
        "summary": "Preview a box rebuild",
        "description": "Starts a preview of a rebuild of the box (a container of bins): every card in it re-filed bin by bin in sort order, packing each bin to its capacity and dropping the bins left empty. `mode` `simple` rebuilds from what the box holds and queues the preview (202). `mode` `csv` also reads a TCGplayer or ScanAbility file: it returns 201 with an `upload_url` to PUT the file to, then call start. A file's cards the box lacks are added (into the open cost batch given here or, once the preview reports `copies_added`, with the apply) and the box's cards the file lacks are written off as shrinkage. Nothing changes until apply. Errors: 404 `location_not_found`; 409 `box_rebuild_holding_box`, `box_rebuild_open_picks`, `cost_batch_not_open`; 404 `cost_batch_not_found`; 422 `box_rebuild_not_container`, `box_rebuild_bin_capacity_missing`, `box_rebuild_no_bins`, `validation_error`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBoxRebuildRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "A simple preview was created and queued.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBoxRebuildResponse"
                }
              }
            }
          },
          "201": {
            "description": "A CSV preview was created; upload the file to `upload_url`, then start it.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBoxRebuildResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`box_rebuild_holding_box`, `box_rebuild_open_picks` or `cost_batch_not_open`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`box_rebuild_not_container`, `box_rebuild_bin_capacity_missing`, `box_rebuild_no_bins` or `validation_error`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`). Nothing was started; try again in a moment.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "get": {
        "operationId": "getBoxRebuild",
        "tags": [
          "Locations"
        ],
        "summary": "Get a box rebuild",
        "description": "The rebuild's status, counts and, once failed, its error. Poll this until a preview is `completed` or `failed`. A failed rebuild's `error.code` is one of the async codes listed on the `BoxRebuildError` schema. A rebuild `running` for more than 20 minutes is failed `box_rebuild_stale` when read. 404 `box_rebuild_not_found` for a rebuild of another store or box.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The rebuild.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "post": {
        "operationId": "startBoxRebuild",
        "tags": [
          "Locations"
        ],
        "summary": "Start a CSV box rebuild preview",
        "description": "Queues a CSV preview once its file is uploaded to the `upload_url` that create returned. 409 `box_rebuild_already_started` if it was started already, `box_rebuild_upload_missing` if no file has been uploaded; 503 `file_storage_unavailable` or `job_queue_unavailable`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "The preview was queued.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`box_rebuild_already_started` or `box_rebuild_upload_missing`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "File storage didn't answer (`file_storage_unavailable`) or the job couldn't be queued (`job_queue_unavailable`). Try again in a moment.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/bins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "get": {
        "operationId": "listBoxRebuildBins",
        "tags": [
          "Locations"
        ],
        "summary": "List a box rebuild's bins",
        "description": "The plan's bins in order, each with the card runs (segments) that land in it. On a preview this is the plan, and bins the rebuild empties are listed with `will_delete`; on an apply it is the filing report. Paginated over bins. 404 `box_rebuild_not_found`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "One page.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildBinsPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/missing": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "get": {
        "operationId": "listBoxRebuildMissing",
        "tags": [
          "Locations"
        ],
        "summary": "List the cards a rebuild file doesn't name",
        "description": "Copies the box holds that the file doesn't name, which the apply writes off as shrinkage, with an estimated FIFO cost (null when no cost lot covers them). The page also carries `total_cost` and `uncosted_copies` over every missing copy. 404 `box_rebuild_not_found`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "One page.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildMissingPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/added": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "get": {
        "operationId": "listBoxRebuildAdded",
        "tags": [
          "Locations"
        ],
        "summary": "List the cards a rebuild file adds",
        "description": "Copies the file names that the box doesn't hold, which the apply creates into the cost batch. 404 `box_rebuild_not_found`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "One page.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildAddedPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/conflicts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "get": {
        "operationId": "listBoxRebuildConflicts",
        "tags": [
          "Locations"
        ],
        "summary": "List a rebuild's condition conflicts",
        "description": "Cards where the file and the box name different conditions of one printing, each with the saved `resolution` (null until chosen). 404 `box_rebuild_not_found`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "One page.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildConflictsPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "resolveBoxRebuildConflicts",
        "tags": [
          "Locations"
        ],
        "summary": "Resolve a rebuild's condition conflicts",
        "description": "Saves the store's choice (`incoming`, the file's condition, or `existing`, the box's) for some conflicts or, with `all`, for every one, and returns the preview's new `plan_digest` to apply with. 409 `box_rebuild_not_a_preview`, `box_rebuild_preview_not_completed`, `box_rebuild_already_applied` once the preview has been applied (start a new preview), or `box_rebuild_plan_changed` when the box moved since the preview (preview again); 404 `box_rebuild_not_found`; 422 `validation_error`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveBoxRebuildConflictsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The choices were saved.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveBoxRebuildConflictsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`box_rebuild_not_a_preview`, `box_rebuild_preview_not_completed`, `box_rebuild_already_applied` or `box_rebuild_plan_changed`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`validation_error`: neither or both of `resolutions` and `all`, or a choice that isn't `incoming` or `existing`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/rebuilds/{rebuild_uuid}/apply": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        },
        {
          "$ref": "#/components/parameters/RebuildUuid"
        }
      ],
      "post": {
        "operationId": "applyBoxRebuild",
        "tags": [
          "Locations"
        ],
        "summary": "Apply a box rebuild preview",
        "description": "Creates the apply of a completed preview and queues it, returning the apply (poll get with its `rebuild_uuid`). Send the preview's current `plan_digest`, and a `cost_batch_uuid` when the preview adds copies and was made without one. The apply re-plans under the bin locks and writes nothing if the box moved since the preview (`box_rebuild_plan_changed`). One apply per preview: calling again returns the same apply (and ignores a different `cost_batch_uuid`); after a failed apply, preview again. 409 `box_rebuild_not_a_preview`, `box_rebuild_preview_not_completed`, `box_rebuild_plan_changed`, `box_rebuild_upload_expired`, `box_rebuild_in_progress`, `cost_batch_not_open`; 404 `box_rebuild_not_found`, `cost_batch_not_found`; 422 `box_rebuild_cost_batch_required` (copies added, no batch), `validation_error`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyBoxRebuildRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The apply was queued (or had been, by an earlier call).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BoxRebuildEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`box_rebuild_not_a_preview`, `box_rebuild_preview_not_completed`, `box_rebuild_plan_changed`, `box_rebuild_upload_expired`, `box_rebuild_in_progress` or `cost_batch_not_open`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`box_rebuild_cost_batch_required`: the preview adds copies and neither it nor this call names a cost batch. `validation_error`: no `plan_digest`, or a cost batch id that isn't an id.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "File storage didn't answer (`file_storage_unavailable`) or the job couldn't be queued (`job_queue_unavailable`). Try again in a moment.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/products": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "get": {
        "operationId": "listLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "List products in a location",
        "description": "Returns one row per position stored directly at this location, in shelf order, paginated. A SKU filed at two separate spots appears twice with different `slot`s.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated products in this location",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedLocationProductList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "upsertLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "Set product quantities in a location",
        "description": "Upserts the supplied products at this location. `quantity` and `quantity_visible` replace any existing values for the SKU — they are absolute, not deltas — except that `quantity` may be omitted for a SKU the location already holds, which leaves its physical count alone. Rows missing from the request are left untouched.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "products"
                ],
                "properties": {
                  "products": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_product_id",
                        "tcgplayer_sku_id",
                        "quantity_visible"
                      ],
                      "properties": {
                        "tcgplayer_product_id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Parent TCGPlayer product ID for the SKU being set."
                        },
                        "tcgplayer_sku_id": {
                          "type": "integer",
                          "format": "int64"
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Absolute new quantity at this location (replaces any existing value). Omit it to change only `quantity_visible` and leave the physical count as it stands when the write lands; omitting it for a SKU the location does not hold is a 400.\n"
                        },
                        "quantity_visible": {
                          "type": "integer",
                          "description": "Absolute new visible quantity at this location (replaces any existing value)."
                        },
                        "slot": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The position to write. Omit it when the SKU has at most one stocked row in this location. Setting an absolute quantity without it on a SKU stocked at several positions is a 422.\n"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Products added or updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "products"
                  ],
                  "properties": {
                    "products": {
                      "type": "array",
                      "description": "Write-ack for the upserted entries — confirms the stored quantities. Display metadata is not returned; use listLocationProducts to read the full product details.",
                      "items": {
                        "type": "object",
                        "required": [
                          "tcgplayer_sku_id",
                          "slot",
                          "quantity",
                          "quantity_visible"
                        ],
                        "properties": {
                          "tcgplayer_sku_id": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "slot": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "The storage row the entry wrote (the request's `slot`, or the SKU's one stocked row in the bin). `quantity` and `quantity_visible` are that row's."
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "quantity_visible": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "removeLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "Remove products from a location",
        "description": "Removes the supplied SKUs from this location's inventory; the request body lists the products to remove. Removing a location's copies is a genuine stock reduction (the SKU may still be stocked at other locations), so the removed quantity is recorded in the inventory ledger with the supplied `reason` (+ optional `note`), consistent with `deleteInventory`. `reason` is optional and defaults to the non-loss `manual_correction` sentinel when omitted, so a quick remove is never blocked; `shrinkage_*` reasons feed the shrinkage report. Each product's `quantity` is optional and partial: omitted, the SKU's full on-hand quantity at this location is removed and the row is deleted; given, only that many are removed and the remainder stays (422 if it exceeds what's on hand). Returns 204 on success.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "products"
                ],
                "properties": {
                  "products": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_product_id",
                        "tcgplayer_sku_id"
                      ],
                      "properties": {
                        "tcgplayer_product_id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Parent TCGPlayer product ID for the SKU being removed."
                        },
                        "tcgplayer_sku_id": {
                          "type": "integer",
                          "format": "int64"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Optional partial-removal count. Omitted removes the SKU's full on-hand quantity at this location (the row is deleted); a value below that leaves the remainder in place. A value above the on-hand quantity is a 422.\n"
                        },
                        "slot": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "The position to remove from. Omitted, copies are taken from the SKU's rows in shelf order, and a removal without `quantity` removes every row of the SKU here.\n"
                        }
                      }
                    }
                  },
                  "reason": {
                    "$ref": "#/components/schemas/RemovalReason"
                  },
                  "note": {
                    "type": "string",
                    "description": "Optional operator note stored on the inventory-ledger movement for the removed quantity (e.g. why the stock left this location).\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Products removed from location",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`lot_cost_locked`: copies this removal takes out of stock are being updated (a cost batch they are in is being finished, or they kept changing). Try again in a minute.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/products/alphabetize": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "alphabetizeLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "Sort the cards in a bin alphabetically",
        "description": "Rewrites the shelf order of every row in one bin, server-side, so the request carries nothing however many cards the bin holds. Rows are ordered by card name (accent-folded, case-insensitive), then set name, collector number (natural order, so 2 sorts before 10), condition (Near Mint first), language (English first), finish (non-foil first) and SKU; two rows of one SKU keep their current relative order. Rows holding no copies are sorted with the rest. This replaces any manual order the bin had. Only rows whose position changes are written, so running it twice moves nothing the second time, and the cards' `updated_at` is left alone. 422 when the location is a container.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bin alphabetized",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlphabetizeLocationProductsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/products/reidentify": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "reidentifyLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "Change copies in a bin to a different card, printing or condition",
        "description": "Re-records copies on one row of a bin as another SKU: a different condition, language, finish, printing or card. The copies keep their spot in the bin and their cost: the old SKU's lots are consumed oldest first and re-created on the new SKU at the same unit cost and received date. The inventory ledger records a `reidentify_out` / `reidentify_in` pair, which counts as neither shrinkage nor a purchase. Copies allocated to open orders or held by an active pick run cannot be changed. A new SKU with no price is priced from the store's rules. Both SKUs are queued for the marketplace push. 404 `bin_card_not_found` when the row is gone or `sku_not_found` when a SKU does not exist, 409 `reidentify_copies_committed`, `lot_cost_locked` or `holding_location_locked`, 422 `reidentify_same_card`, `reidentify_quantity_exceeds_row`, `slot_ambiguous`, `location_is_container` or `bin_slot_limit_exceeded`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReidentifyLocationProductsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Copies re-identified",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReidentifyLocationProductsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/move-cards": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "moveCardsToLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Move selected SKUs' full on-hand stock into a destination bin",
        "description": "Consolidates the full on-hand quantity of the selected SKUs from all their current locations into the destination bin, which must be a bin (not a container). Select SKUs with exactly one of `tcgplayer_sku_ids` or `filters` (supplying both, or neither, is a 422). Copies an open pick run holds (a pending or picked task on a picking or unassigned run) stay in their bin and only the rest move; a SKU with every copy held is reported in the `conflicts` array and skipped in place. The rest of the batch still moves, so a per-SKU conflict never fails the request. Relocation is ledger-neutral: no inventory transactions are written.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveCardsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Move completed; returns the moved SKUs, the skipped per-SKU conflicts (reported in-band, never as a 409), and the updated destination bin.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveCardsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/moves": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listLocationMoves",
        "tags": [
          "Locations"
        ],
        "summary": "List bulk moves and whether each pull sheet still needs printing",
        "description": "The store's `moveCardsToLocation` calls, newest first. A move changes stock on record at once while the cards stay in their old bins until someone walks its pull sheet, so each entry says whether that sheet was printed (`pull_sheet_printed_at`, set by `markLocationMovePullSheetPrinted`), marked handled (`pull_sheet_dismissed_at`), or undone (`undo_status`, `undo_partial`). `needs_pull_sheet_count` counts the entries with `needs_pull_sheet` over the whole list, not just this page. Moves made before moves were recorded are not listed.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of moves",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "moves",
                    "total",
                    "limit",
                    "offset",
                    "needs_pull_sheet_count"
                  ],
                  "properties": {
                    "moves": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LocationMove"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "needs_pull_sheet_count": {
                      "type": "integer",
                      "description": "Moves across the whole list whose `needs_pull_sheet` is true."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/moves/pull-sheets/dismiss": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "dismissAllLocationMovePullSheets",
        "tags": [
          "Locations"
        ],
        "summary": "Mark every bulk move still needing its pull sheet handled",
        "description": "Sets `pull_sheet_dismissed_at` on every move whose `needs_pull_sheet` is true. `expected_count` is the `needs_pull_sheet_count` the user was shown: if the number has changed, nothing is marked and it answers 409 `location_moves_changed`, so a move made since the page loaded is never marked handled unseen. Undo a mark one move at a time with `dismissLocationMovePullSheet`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "expected_count"
                ],
                "properties": {
                  "expected_count": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many moves were marked handled",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dismissed_count"
                  ],
                  "properties": {
                    "dismissed_count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/moves/{move_uuid}/pull-sheet/printed": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "move_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "markLocationMovePullSheetPrinted",
        "tags": [
          "Locations"
        ],
        "summary": "Record that a bulk move's pull sheet was printed",
        "description": "Takes the move out of `needs_pull_sheet` by setting `pull_sheet_printed_at`. Call it once the `getLocationMovePullSheet` PDF has arrived, so a sheet that never reached the browser still reads as needing printing. Repeating it keeps the first time. Answers the move. A administrator's call changes nothing. 404 `location_move_not_found` for a move that is not this store's.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The move, as the move list serves it",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationMove"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/moves/{move_uuid}/pull-sheet/dismiss": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "move_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "dismissLocationMovePullSheet",
        "tags": [
          "Locations"
        ],
        "summary": "Mark a bulk move's pull sheet handled without printing it",
        "description": "`dismissed: true` takes the move out of `needs_pull_sheet` without printing its sheet (the cards were carried some other way); `dismissed: false` puts the move back to needing its sheet, clearing `pull_sheet_printed_at` too (a sheet opened but never walked). Repeating either is a no-op, and a second `true` keeps the first time. Answers the move. 404 `location_move_not_found` for a move that is not this store's.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "dismissed"
                ],
                "properties": {
                  "dismissed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The move, as the move list serves it",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationMove"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/moves/{move_uuid}/pull-sheet": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "move_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getLocationMovePullSheet",
        "tags": [
          "Locations"
        ],
        "summary": "Print a bulk move's pull sheet as a PDF",
        "description": "The pick list's sheet over the stock a `moveCardsToLocation` call moved, listed where it sat before the move: one row per source row it took copies from, in walking order of the old bins, printed with the store's saved pick-list layout. The move changes stock on record at once and the cards still have to be carried, so this is the list to walk with. It reads the move's own record, not live stock, and leaves off rows an undo has since sent back. It can be printed any number of times. Rendering it records nothing: once the PDF has arrived, call `markLocationMovePullSheetPrinted`. A move made before this record existed, or one that is not this store's, is a 404 `location_move_not_found`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `locations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pull sheet PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"pull-sheet-{move_uuid}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`pull_sheet_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/moves/{move_uuid}/undo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "move_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "undoLocationMove",
        "tags": [
          "Locations"
        ],
        "summary": "Undo a bulk move, sending every card back to its bin",
        "description": "Undoes a `moveCardsToLocation` call made by mistake: every card the move took out of a bin goes back to that bin, in exactly the quantity the move took. Creates an async relocation job (`plan_source` `move_undo`) and returns its `job_uuid`; poll it through `GET /inventory/relocate/{relocation_job_uuid}`, which reports it like any relocation — counts, per-row outcomes, report CSV.\n\nA card sold or moved on since the move comes back as that row's `insufficient_stock` or `no_stock` while the rest still go back; a bin deleted since is `unknown_destination_location` and is not re-created. Each card goes in at the back of its bin: the move recorded which bin it came from, not where in the bin.\n\nA move is undone once. A second request while its undo is pending, running or completed is a 409 `location_move_already_undone` with the undo's `job_uuid` in `params`; after a failed undo it can be requested again. 404 `location_move_not_found` for a move that is not this store's, 422 `location_move_destination_gone` when the bin the move filled has since been deleted, 409 `location_move_empty` when the move moved nothing.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Undo job created and queued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "job_uuid",
                    "status"
                  ],
                  "properties": {
                    "job_uuid": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/transfer": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "transferLocationProducts",
        "tags": [
          "Locations"
        ],
        "summary": "Move per-SKU quantities from this location into another bin",
        "description": "Moves the requested quantity of each SKU out of the source location into `destination_location_uuid`, or into the entry's own `products[].destination_location_uuid` when it names one, so a single call can send each card to a different bin. Every destination moves in one transaction: a missing or container destination fails the whole request. Note the path location is the **source** here, unlike `moveCardsToLocation`, where it is the destination. Partial quantities are supported: only the requested copies move, and the source keeps the remainder (its storage row is deleted only when it empties). The destination must be a bin (not a container) and must differ from the source. SKUs that are not stocked in the source, that have fewer copies on hand than requested, or that ask for more copies than open pick runs leave free (a run's pending or picked copies stay where the picker expects them) are reported per-SKU in the `conflicts` array and skipped in place; the rest of the batch still moves, so a per-SKU conflict never fails the request. Visible quantity follows the stock: up to `quantity` of the source's visible copies move with it, and a non-listable destination receives them as not visible. Use `insert_position` to place the batch at the front, the back, after a named card, or alphabetically among the destination bin's cards. Relocation is ledger-neutral: no inventory transactions are written.\nThe `Idempotency-Key` header is required (#3147), so a double click or a retry replays the first response instead of moving the stock again; a request without one is a 400 `missing_idempotency_key`. A concurrent request with the same key returns 409 `idempotency_key_in_progress`, and a key reused with a different body 422 `idempotency_key_conflict`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferProductsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer completed; returns the moved SKUs with their remaining source quantity, plus the skipped per-SKU conflicts (reported in-band, never as a 409).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferProductsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/price-lock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "lockBinPrices",
        "tags": [
          "Locations"
        ],
        "summary": "Lock every priced SKU currently stored in a bin",
        "description": "Bulk-locks the pricing_data rows of every SKU currently, physically stocked in this bin (`inventory_locations_storage` rows with `total_quantity > 0` — a sold-out SKU's zero-quantity row is not \"in the bin\"), mirroring `lockProductPrices`' verb pair and response shape. Point-in-time, not a standing rule: the lock is applied to the bin's SKU set as it stands right now, and nothing records that a lock came from this bin — a SKU later moved out keeps its lock, and one added later is unaffected. Idempotent: re-locking already-locked SKUs is not an error. Stocked SKUs with no pricing_data row cannot be locked and are reported via skipped_unpriced. Rollback explicitly ignores the lock. An empty bin returns zero counts rather than a 404. A container location (which cannot hold cards) returns 422 rather than a misleading zero-count success.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKUs locked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "locked",
                    "skipped_unpriced"
                  ],
                  "properties": {
                    "locked": {
                      "type": "integer",
                      "description": "Number of the bin's priced SKUs that are now locked."
                    },
                    "skipped_unpriced": {
                      "type": "integer",
                      "description": "Stocked SKUs in this bin with no pricing_data row, which therefore could not be locked.\n"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "unlockBinPrices",
        "tags": [
          "Locations"
        ],
        "summary": "Remove the price lock from every SKU currently stored in a bin",
        "description": "Bulk-unlocks the pricing_data rows of every SKU currently, physically stocked in this bin (same `total_quantity > 0` scope as the lock), mirroring `unlockProductPrices`' verb pair and response shape. Point-in-time, like the lock: only the bin's current SKU set is affected — a SKU that sold out of this bin and was restocked elsewhere is unaffected by unlocking this bin. Idempotent: unlocking SKUs that are not locked is not an error. Unlike the lock response, there is no skipped_unpriced — unpriced SKUs were never locked, so there is nothing to report. A container location returns 422 rather than a misleading zero-count success.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SKUs unlocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unlocked"
                  ],
                  "properties": {
                    "unlocked": {
                      "type": "integer",
                      "description": "Number of SKUs in this bin that were unlocked by this call. A store item such as a graded slab stays locked and is not counted.\n"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/locations/{location_uuid}/round-prices": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/LocationUuid"
        }
      ],
      "post": {
        "operationId": "roundLocationPrices",
        "tags": [
          "Locations"
        ],
        "summary": "Round the prices of every card in a bin or container",
        "description": "Rounds the sell price of every SKU currently stocked in this bin, or in any bin beneath this container (`total_quantity > 0`, the same scope as `lockBinPrices`), to the next, previous or nearest multiple of `increment`. A one-shot write into the SKU's base price, not a standing rule: a card added to the bin later is not rounded, and the next reprice run may move a rounded price unless the card is price-locked (a bin's `prices_locked` is the usual way to hold a show bin's rounded prices). The lock does not block this write. Each SKU's per-marketplace price overrides are rounded the same way, and the rounding is stored with the price so a price converted for a marketplace in another currency is rounded alike. A price already on the step is unchanged, and a positive price the step would take to 0.00 is left as it is and counted in `skipped_to_zero`. The price belongs to the SKU, so a card also stocked elsewhere has its price changed there too. With `dry_run` the counts are computed and nothing is written. Rounding an already rounded price changes nothing, so a retry is harmless. A real write (not a dry run) also needs the store's `inventory.set_sell_price` grant, the one every other sell-price writer checks.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `locations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoundLocationPricesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Prices rounded, or the counts a rounding would produce when `dry_run` is set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoundLocationPricesResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}/label": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "generateSkuLabel",
        "tags": [
          "Labels"
        ],
        "summary": "Generate a printable SKU label (standard fold+QR or compact flat sticker)",
        "description": "Returns a single-page PDF label for the SKU, in the store's saved `label_config.label_format` (see `InventorySettings`) unless the `format` query param below overrides it for this request.\n\n`standard` (the default for a store that has never customized its format) is a wrap-around vertical strip: a QR encoding the HippoLink customer lookup URL on the front, folding over the card's bottom edge to a Code 128 barcode of the `HL-{product_id}-{sku_id}` id on the back, alongside the card name and language/finish/condition. Self-sized to the tightest bounding box per label, so it prints at actual size.\n\n`compact` is the flat sticker (#1281's pictured model): no fold, fixed 2.25in width, height self-sizing to whichever fields are enabled. The Code 128 barcode of the same `HL-{product_id}-{sku_id}` id is always present -- a barcode label without a barcode is a price sticker -- with the id itself printed below it as text when `sku_id` is in the store's saved `compact_fields`. Every other line (card name, set/edition, condition, price, store name, store logo) is included by membership in the store's saved `compact_fields` pick-list; the printed order is always the fixed top-down layout (logo, store name, card name, set, condition/price row, QR code, barcode, SKU id, date), independent of the pick-list's own order. A field whose datum doesn't resolve (e.g. no pricing row) is silently omitted. The `date` field, when enabled, is this render's date, not an intake date. Unlike `standard`, `compact` has no QR by default -- `qr_code` in `compact_fields` adds one, encoding the same customer lookup URL.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "compact",
                "template"
              ]
            },
            "description": "Overrides the store's saved `label_format` for this request; absent, the store's saved format is used (`standard` for a store that has never customized it). `compact_fields` always comes from the store's saved config regardless of this override. An invalid value is a 422.\n"
          },
          {
            "name": "template_uuid",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Print this designed label template (#2592) instead of the store's saved format. Implies `format=template`; sending it together with a different `format` is a 422 rather than a precedence rule, because either reading of that request is a guess. A template that does not exist for this store is a 404 -- unlike the store's saved *default* going missing, which falls back to `standard`, because a caller that named a template and silently got a different one is worse than an error.\n"
          },
          {
            "name": "show_price",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, renders the store's retail price (currency-formatted) above the QR code on the front panel; off by default so the layout is unchanged, and a SKU without pricing data omits the line. Applies to the `standard` format only; ignored when `format` resolves to `compact`, where the saved `compact_fields` pick-list's own `price` entry governs instead.\n"
          },
          {
            "name": "show_date",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, renders a `Priced YYYY-MM-DD` line from the SKU's last-repriced date; off by default so the layout is unchanged, and a SKU without pricing data omits the line. Applies to the `standard` format only; ignored when `format` resolves to `compact`, where the saved `compact_fields` pick-list's own `date` entry governs instead.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "SKU label PDF.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "generateBatchSkuLabels",
        "tags": [
          "Labels"
        ],
        "summary": "Generate printable labels for many SKUs or products (max 250 labels)",
        "description": "Returns a single combined PDF with one label per SKU, in request order, one page per label. Each label is rendered exactly as the single-label endpoint would render it -- see `generateSkuLabel` for the `standard`/`compact` geometry and how `format` resolves.\n\nProvide **exactly one** of `tcgplayer_sku_ids`, `tcgplayer_product_ids`, or `location_uuid` (supplying more than one, or none, is a 422). A SKU list is printed in request order. A product-id list is expanded into its SKUs against the store's inventory, governed by `filter`:\n- `in_stock` (default) — SKUs the store currently holds (quantity > 0).\n- `ever_stocked` — SKUs with any inventory row, even depleted to 0.\n- `all` — every SKU of the product, regardless of inventory.\n\nWhatever the selector or `filter`, a SKU with nothing on hand never prints (#4415): its `total_quantity` summed over the store's live, non-holding bins must be above 0 (a location's entries are already in stock). So `ever_stocked` and `all` now only decide which SKUs the 250-card cap counts. A request left with nothing to print is a 404 `label_none_on_hand`.\n\nA `location_uuid` is expanded server-side into the location's stocked entries: a bin's own storage rows, or the recursive union of a container's descendant bins' storage rows. Bins order by the ancestor path of `sequence_index` values from the requested location down to each bin, so bins under one sub-container sort together before the next sub-container's bins; entries within a bin then order by their own `sequence_index`. Two siblings sharing a `sequence_index` break the tie on `location_uuid` at that level, so their subtrees stay grouped rather than interleaving. The same SKU stocked in two bins is two entries and prints two labels. An entry whose SKU has no live catalog identity (a soft-deleted `global_identifiers` row) is skipped rather than failing the print.\n\nThe `filter` field is ignored for a direct SKU list and for `location_uuid` (its entries are inherently in stock). The combined PDF is capped at 250 cards, checked against the resolved SKU or entry count before any `copies` expansion; a product-id expansion or location resolution that would exceed that is a 422 `label_limit_exceeded` naming the matched count.\n\n`copies` (#4415) picks how many labels each card gets: `one` (default) prints one per SKU or entry as above; `on_hand` prints one per copy the store holds, with a card's copies next to each other. For a location, a copy is each entry's own `total_quantity` in its bin; for a SKU or product list, it is the SKU's `total_quantity` summed over the store's live bins, leaving out holding locations. A SKU with nothing on hand prints no label, and a request left with no labels at all is a 404 `label_none_on_hand`. Once copies are counted, one print makes at most 6,000 labels; more is a 422 `label_copy_limit_exceeded` with `params.count` and `params.limit`, and the guidance is to start a label job. For a location, the guidance is to start a label job (`POST .../inventory/label-jobs` with `location_uuid`) to print the whole location. A product-id request that matches no SKUs returns 404, as does a `location_uuid` not found for this store (or soft-deleted), or one that resolves to no stocked entries.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Provide exactly one of `tcgplayer_sku_ids`, `tcgplayer_product_ids`, or `location_uuid`.\n",
                "properties": {
                  "tcgplayer_sku_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "description": "SKUs to print, in request order; ones with nothing on hand are left out. Mutually exclusive with `tcgplayer_product_ids` and `location_uuid`.\n",
                    "items": {
                      "type": "integer",
                      "format": "int64",
                      "minimum": 1
                    }
                  },
                  "tcgplayer_product_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "description": "Product ids expanded into their in-inventory SKUs (see `filter`), in request order then by SKU id. Mutually exclusive with `tcgplayer_sku_ids` and `location_uuid`.\n",
                    "items": {
                      "type": "integer",
                      "format": "int64",
                      "minimum": 1
                    }
                  },
                  "location_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A location whose stocked entries are expanded into labels server-side: a bin's own storage rows, or the recursive union of a container's descendant bins' storage rows. Bins order by the ancestor path of `sequence_index` values from the requested location down to each bin, so bins under one sub-container sort together before the next sub-container's bins; entries within a bin then order by their own `sequence_index`. Two siblings sharing a `sequence_index` break the tie on `location_uuid` at that level, so their subtrees stay grouped rather than interleaving. The same SKU stocked in two bins prints two labels. An entry whose SKU has no live catalog identity (a soft-deleted `global_identifiers` row) is skipped rather than failing the print. `filter` is ignored for this selector, since resolved entries are inherently in stock. Mutually exclusive with `tcgplayer_sku_ids` and `tcgplayer_product_ids`.\n"
                  },
                  "filter": {
                    "type": "string",
                    "enum": [
                      "in_stock",
                      "ever_stocked",
                      "all"
                    ],
                    "default": "in_stock",
                    "description": "Stock filter applied when expanding `tcgplayer_product_ids` into SKUs. Ignored for a direct `tcgplayer_sku_ids` list.\n"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "compact",
                      "template"
                    ],
                    "description": "Overrides the store's saved `label_format` for every label in this batch; absent, the store's saved format is used (`standard` for a store that has never customized it). Valid for all three selectors above (a direct SKU list, a product-id expansion, or a `location_uuid` expansion). `compact_fields` always comes from the store's saved config regardless of this override. An invalid value is a 422.\n"
                  },
                  "template_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Print this designed label template (#2592) for every label in the batch. Implies `format=template`; sending it together with a different `format` is a 422. A template that does not exist for this store is a 404.\n"
                  },
                  "show_price": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, renders the store's retail price (currency-formatted) above the QR code on the front panel of every label in the batch; off by default so the layout is unchanged, and a SKU without pricing data omits the line. Applies to the `standard` format only; ignored when `format` resolves to `compact`, where the saved `compact_fields` pick-list's own `price` entry governs instead.\n"
                  },
                  "show_date": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, renders a `Priced YYYY-MM-DD` line from each SKU's last-repriced date on every label in the batch; off by default so the layout is unchanged, and a SKU without pricing data omits the line. Applies to the `standard` format only; ignored when `format` resolves to `compact`, where the saved `compact_fields` pick-list's own `date` entry governs instead.\n"
                  },
                  "copies": {
                    "type": "string",
                    "enum": [
                      "one",
                      "on_hand"
                    ],
                    "default": "one",
                    "description": "`one` prints one label per card (per SKU, or per storage entry for `location_uuid`). `on_hand` prints one label per copy the store holds: a location entry's own `total_quantity`, or a listed SKU's `total_quantity` summed over the store's live, non-holding bins. The 250 cap counts cards before copies; the copies themselves cap at 6,000 labels (422 `label_copy_limit_exceeded`). Valid for all three selectors.\n"
                  }
                },
                "oneOf": [
                  {
                    "required": [
                      "tcgplayer_sku_ids"
                    ]
                  },
                  {
                    "required": [
                      "tcgplayer_product_ids"
                    ]
                  },
                  {
                    "required": [
                      "location_uuid"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Combined SKU labels PDF.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels/count": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "countBatchSkuLabels",
        "tags": [
          "Labels"
        ],
        "summary": "Count the labels a bulk print would make, per variant and per copy",
        "description": "How many labels a bulk print would make, both ways, so a print menu can show it before the user chooses (#4415): `variants` is the number with `copies: one` (one per SKU, or per storage entry for a location) and `copies` the number with `copies: on_hand`. Takes the same selectors as `generateBatchSkuLabels` (`tcgplayer_sku_ids`, `tcgplayer_product_ids` with `filter`, or `location_uuid`), or a label job's `filters` (with `label_filter` and `exclude_product_ids`) for select-all-matching; exactly one. They are resolved exactly as the print or the job resolves them, sold-out SKUs left out, so the numbers are what prints. Neither the 250-card cap nor the 6,000-label ceiling applies here, and a selection with nothing on hand answers `{variants: 0, copies: 0}`. A `location_uuid` not found for this store is a 404 `location_not_found`. A `filters` count gets 5 seconds; a filter too broad to count in that time is a 422 `label_count_too_large`, and the print itself still works (as a label job).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Exactly one of `tcgplayer_sku_ids`, `tcgplayer_product_ids`, `location_uuid` or `filters`.\n",
                "properties": {
                  "tcgplayer_sku_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "integer",
                      "format": "int64",
                      "minimum": 1
                    }
                  },
                  "tcgplayer_product_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "integer",
                      "format": "int64",
                      "minimum": 1
                    }
                  },
                  "filter": {
                    "type": "string",
                    "enum": [
                      "in_stock",
                      "ever_stocked",
                      "all"
                    ],
                    "default": "in_stock",
                    "description": "As on `generateBatchSkuLabels`, for `tcgplayer_product_ids`."
                  },
                  "location_uuid": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "filters": {
                    "$ref": "#/components/schemas/InventoryFilter"
                  },
                  "label_filter": {
                    "type": "string",
                    "enum": [
                      "in_stock",
                      "ever_stocked",
                      "all"
                    ],
                    "default": "in_stock",
                    "description": "As on a label job, for `filters`."
                  },
                  "exclude_product_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int64",
                      "minimum": 1
                    },
                    "description": "As on a label job, for `filters`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Label counts for the selection.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "variants",
                    "copies"
                  ],
                  "properties": {
                    "variants": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Labels with `copies` = `one`."
                    },
                    "copies": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Labels with `copies` = `on_hand`."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels/templates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listLabelTemplates",
        "tags": [
          "Labels"
        ],
        "summary": "List the store's designed label templates",
        "description": "The store's saved layout documents (#2592), name-ordered, plus which one is the default. Several per store is the normal case: a shelf sticker and a toploader tag are different labels, and duplicating a working template is the safe way to try a change.\n\n**Who can call this:** Store employee, Store manager, Store owner.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's templates.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelTemplateList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createLabelTemplate",
        "tags": [
          "Labels"
        ],
        "summary": "Create a designed label template",
        "description": "Saves a layout document (#2592). The document is validated before it is stored and any `error`-severity finding is refused with a 422 -- an unscannable barcode is not something to discover at the register. Validation here runs without a sample card, so it covers geometry and vocabulary but not text fit; use `previewLabelTemplate` for that.\n\n**Who can call this:** Store manager, Store owner.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplateCreate"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The created template.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A live template of this store already uses that name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels/templates/seed": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getLabelTemplateSeed",
        "tags": [
          "Labels"
        ],
        "summary": "A starting layout document derived from the store's current label",
        "description": "Returns a document approximating what the store's `compact` settings print today, so the designer opens on something recognizable instead of an empty canvas. Read-only: it saves nothing and has no `template_uuid`; the caller POSTs it back, edited or not, to create a template.\n\nIt is an approximation, not a reproduction. The compact renderer self-sizes its height and a designed canvas is fixed, so the canvas is rounded up and the spacing absorbs the difference. The barcode is the one element placed full-bleed rather than inside the margin, because its quiet zone is budgeted inside its own box -- an inset barcode spends that width on nothing and can drop under the scannability floor for a long payload.\n\n**Who can call this:** Store employee, Store manager, Store owner.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A starting document.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "document"
                  ],
                  "properties": {
                    "document": {
                      "$ref": "#/components/schemas/LabelTemplateDocument"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels/templates/{template_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "template_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getLabelTemplate",
        "tags": [
          "Labels"
        ],
        "summary": "Read one designed label template",
        "description": "Scoped by store as well as by id: a template belonging to another store reads as absent rather than forbidden, so the response cannot confirm that someone else's template exists.\n\n**Who can call this:** Store employee, Store manager, Store owner.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The template.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "put": {
        "operationId": "updateLabelTemplate",
        "tags": [
          "Labels"
        ],
        "summary": "Rename or redraw a designed label template",
        "description": "Partial: an absent `name` or `document` leaves that field alone. A body naming neither is a 422 rather than a no-op 200, so a caller whose key names are wrong hears about it. A replacement document is validated exactly as `createLabelTemplate` validates one.\n\n**Who can call this:** Store manager, Store owner.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplateUpdate"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The updated template.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelTemplate"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Another live template of this store already uses that name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteLabelTemplate",
        "tags": [
          "Labels"
        ],
        "summary": "Delete a designed label template",
        "description": "Soft delete. If this template was the store's default, the default is cleared in the same transaction -- leaving the pointer dangling would send every print down the fall-back-to-standard path with no way for the store to see why. The name becomes reusable immediately.\n\n**Who can call this:** Store manager, Store owner.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/inventory/labels/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "previewSkuLabel",
        "tags": [
          "Labels"
        ],
        "summary": "Render a live preview of the store's printed label against a fixed demo card",
        "description": "Returns a PNG preview of what a printed SKU label looks like under the given `format`/`compact_fields`, rendered against a fixed demo card (Phelddagrif, Alliances) rather than a real inventory SKU -- for the Store settings \"Printed Labels\" preview. Uses the real, authenticated store's name/logo, so the preview reflects actual branding.\n\nUnlike `generateSkuLabel`, `compact_fields` MAY be overridden per request here (comma-separated, same vocabulary as `InventorySettings.label_config.compact_fields`) -- the preview's whole purpose is showing an in-progress, not-yet-saved field selection as the settings form changes. Both `format` and `compact_fields` default to the store's saved config when omitted, so a bare call reproduces what a real print would use today.\n\nResponse headers `X-Label-Width-In` / `X-Label-Height-In` give the label's actual print dimensions (inches, to 3 decimals), computed from the same render that produced the image -- `compact` is always 2.25in wide with a height that self-sizes to the enabled fields; `standard` self-sizes both dimensions to its wrap-around-the-card geometry (see `generateSkuLabel`).\n\n**Who can call this:** Store employee, Store manager, Store owner.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "compact",
                "template"
              ]
            },
            "description": "Overrides the store's saved `label_format` for this request; absent, the store's saved format is used. An invalid value is a 422.\n"
          },
          {
            "name": "compact_fields",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated subset of `card_name`, `set_edition`, `condition`, `price`, `sku_id`, `date`, `store_name`, `store_logo`, `qr_code` -- overrides the store's saved `compact_fields` for this request. Absent, the store's saved field list is used. Ignored when `format` resolves to `standard`. An unrecognized field name is a 422.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "PNG preview of the label as it would print.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Label-Width-In": {
                "schema": {
                  "type": "string"
                },
                "description": "Rendered label width, in inches, to 3 decimals."
              },
              "X-Label-Height-In": {
                "schema": {
                  "type": "string"
                },
                "description": "Rendered label height, in inches, to 3 decimals."
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "previewLabelTemplate",
        "tags": [
          "Labels"
        ],
        "summary": "Render and validate a designed label template",
        "description": "Renders a draft layout document (#2592), or a saved template, and returns the picture together with every validation finding.\n\nA POST rather than a GET because a layout document does not fit in a query string: API Gateway's request line caps at 10,240 bytes, which a ten-element document plus URL encoding passes with no error anywhere that says why. It returns JSON rather than a bare PNG for the same kind of reason -- the findings need a second channel, and a preview that could only show a picture would leave the designer with no way to say \"this barcode will not scan\".\n\nThe document is rendered even when findings include errors. A designer that shows nothing until the layout is perfect is useless while you are still dragging; the findings list is what says the layout is not printable yet.\n\nBy default the render uses the same fixed demo card the GET preview uses, so a store with no inventory can still design a label. Naming a real SKU in `sample` is worth doing before saving: the demo card's name is short and its barcode payload is a sentinel, so a template that looks fine against it can still truncate, or drop under the scannability floor, for real stock.\n\n**Who can call this:** Store employee, Store manager, Store owner.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelTemplatePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The rendered label, its dimensions, and every finding.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelTemplatePreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/rules/validate": {
      "post": {
        "operationId": "validateRules",
        "tags": [
          "Rules"
        ],
        "summary": "Validate rule DSL strings (stateless, no store context needed)",
        "description": "Always returns 200 — check the `valid` field and per-rule results for errors. Rate limited to 2 requests per second.\n\n**Who can call this:** Any signed-in user.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string"
                    },
                    "description": "List of DSL rule strings to validate"
                  },
                  "region": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Region"
                      }
                    ],
                    "default": "usa",
                    "description": "Which seller-facing CONDITION vocabulary the rules are written in (#1597). This route takes no `store_uuid`, so the caller states the region the rule builder is composing for. `usa` (the default) accepts the stored US conditions only, exactly as before; `eu` additionally accepts the Cardmarket/MKM grades `GET /v1/reprice/dsl?region=eu` advertises and the store-scoped rule save already accepts, so a preview stops rejecting a rule that would save fine.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A value in the request was refused (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Validation results",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "results"
                  ],
                  "properties": {
                    "valid": {
                      "type": "boolean",
                      "description": "True only if every rule passed validation"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "sequence_index",
                          "rule",
                          "is_valid"
                        ],
                        "properties": {
                          "sequence_index": {
                            "type": "integer",
                            "description": "1-based position of the rule in the submitted array"
                          },
                          "rule": {
                            "type": "string",
                            "description": "The DSL rule string that was validated"
                          },
                          "is_valid": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string",
                            "description": "Present when is_valid is false"
                          },
                          "line": {
                            "type": "integer",
                            "description": "1-based source line of the parse error (absent for a semantic error)"
                          },
                          "column": {
                            "type": "integer",
                            "description": "1-based source column of the parse error (absent for a semantic error)"
                          },
                          "validation_errors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "message"
                              ],
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              }
                            },
                            "description": "One entry per distinct cause, present on a multi-field constraint violation"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listRules",
        "tags": [
          "Rules"
        ],
        "summary": "Get a store's rules for a game",
        "description": "Returns the ordered ruleset for a single game. Repricing rules are scoped per game; the `game` query parameter selects which ruleset to read and defaults to `magic` when omitted.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's ruleset to return. Defaults to `magic` when omitted.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Defaults to 100. Maximum 500, a whole game's ruleset in one page; a larger value is capped to it.\n",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated rules for the store in evaluation order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceRules",
        "tags": [
          "Rules"
        ],
        "summary": "Replace a game's rule set atomically",
        "description": "Replaces the ruleset for a single game with the provided set. The target game is the `game` query parameter when given, otherwise it is inferred from the body — every item must belong to the same game (new rules via their `game` field, existing references via the stored rule's game), and to the `game` parameter when one is sent; a mixed-game array returns 422. Array order determines evaluation order within that game. An empty array deletes every rule of the `game` parameter's game; without `game`, an empty array returns 422. Each item is either a new rule (with both `rule` and `name`) or a reference to an existing rule by `rule_uuid`. An existing-rule reference may also carry `rule`, `name`, and/or `is_enabled` to update that rule in place — its `rule_uuid` (and reprice history) is preserved and its version advances. Existing rules of that game not included in the array are deleted; rules of other games are left untouched. The `If-Match` ETag and the response are scoped to the target game.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's ruleset to replace. Required to send an empty array; otherwise optional, and the game is inferred from the items.\n"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "description": "Defines the complete rule set and evaluation order. Each item either references an existing rule by rule_uuid (optionally with rule/name/is_enabled to update it in place) or creates a new one with rule, name and game. Existing rules not included in the array are deleted.\n",
                    "items": {
                      "type": "object",
                      "anyOf": [
                        {
                          "required": [
                            "rule_uuid"
                          ]
                        },
                        {
                          "required": [
                            "rule",
                            "name",
                            "game"
                          ]
                        }
                      ],
                      "properties": {
                        "rule_uuid": {
                          "type": "string",
                          "format": "uuid",
                          "description": "UUID of an existing rule to keep in this position. Send it alone to keep the rule unchanged, or with rule/name/is_enabled to update it in place (the rule_uuid and its reprice history are preserved).\n"
                        },
                        "rule": {
                          "type": "string",
                          "description": "DSL rule string. Required for new rules; optional when updating an existing rule in place.\n"
                        },
                        "name": {
                          "type": "string",
                          "description": "User-defined name. Required for new rules; optional when updating an existing rule in place.\n"
                        },
                        "is_enabled": {
                          "type": "boolean",
                          "description": "Whether the rule is active. Defaults to true on create; optional when updating an existing rule in place.\n"
                        },
                        "currency": {
                          "$ref": "#/components/schemas/Currency"
                        },
                        "game": {
                          "$ref": "#/components/schemas/GameId",
                          "description": "The TCG this rule scopes to. Required when creating a new rule. Immutable on update (ignored for existing rules).\n"
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "rules": [
                  {
                    "rule": "IF CONDITION IS 'Near Mint' THEN SET PRICE TCGPLAYER_LOW_NEAR_MINT",
                    "name": "Near Mint at TCG Low",
                    "game": "magic"
                  },
                  {
                    "rule_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`). Or a `game` query value that is not a known game.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "A rule name is already in use in that game (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "`If-Match` is required when rules exist (`if_match_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Rule set replaced",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rules"
                  ],
                  "properties": {
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createRule",
        "tags": [
          "Rules"
        ],
        "summary": "Create a single rule",
        "description": "Creates one new rule for the given game. Appends to the end of that game's evaluation order unless `position` (1-based) is given. Only the target game's rules are affected -- other games are untouched. Rule names must be unique within the store for that game; a duplicate `name` returns 422.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleCreateInput"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "A rule name is already in use in that game (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Rule created",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/rules/order": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "put": {
        "operationId": "reorderRules",
        "tags": [
          "Rules"
        ],
        "summary": "Atomically reorder a single game's rules",
        "description": "Reassigns evaluation order for a single game's rules in one atomic operation. `rule_uuids` must be exactly the current set of that game's rule uuids (no missing, extra, or foreign-game entries) -- this is the safe alternative to N individual PATCHes, which could leave the ruleset half-reordered. Other games are never touched.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's rules to reorder."
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_uuids"
                ],
                "properties": {
                  "rule_uuids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "The complete, reordered set of the target game's rule uuids. Must match the game's existing rules exactly.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`). The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The game's rules changed since they were loaded (`rule_set_changed`), or a rule name collided (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "`If-Match` is required when rules exist (`if_match_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Rules reordered for the given game",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rules"
                  ],
                  "properties": {
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rule"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/rules/{rule_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RuleUuid"
        }
      ],
      "get": {
        "operationId": "getRule",
        "tags": [
          "Rules"
        ],
        "summary": "Get a single rule",
        "description": "Returns a single repricing rule (DSL, name, currency, game, enabled state, and evaluation order) with an ETag for conditional updates.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Rule details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateRule",
        "tags": [
          "Rules"
        ],
        "summary": "Update a rule's DSL string, name, or enabled state",
        "description": "game cannot be changed via PATCH; the field is immutable once a rule is created.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "rule": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "User-defined name for the rule"
                  },
                  "is_enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The new name is already used by another rule in that game (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Rule updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteRule",
        "tags": [
          "Rules"
        ],
        "summary": "Delete a single rule",
        "description": "Deletes a repricing rule and compacts the sequence_index of the remaining rules for that game so evaluation order has no gaps. Returns 204.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Rule deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewReprice",
        "tags": [
          "Reprice"
        ],
        "summary": "Preview repricing changes for selected inventory (dry run)",
        "description": "Shows what the rules would change for the specified inventory without applying. Rate limited to 1 request per second.\n\nEntries come in two shapes. A price entry carries `current_price` and `new_price`. A listing entry carries `marketplace` plus an `action` of `suppress` or `unsuppress`, describing what a `DO NOT LIST ON` rule would do to the SKU's marketplace listing; `action` is present only on listing entries, so its presence is what tells the two apart.\n\n`outcomes` has one entry per previewed SKU, including the ones no rule moved, with a `decision` that tells a rule matching at the same price (`no_change`) from no rule matching at all (`no_match`).\n\nCards come from `products`, from a `search` within `game`, or both: pinned products first, then the search fills the rest of the per-run cap of 50. A broad search is counted in full (`matched_total`) but only a sample spread across price is evaluated. `match_rule` fills the run with the cards one rule matches instead of a search. `draft_rules` previews an unsaved ruleset for `game` in place of the saved one.\n\nA `scope: catalog` search must narrow the catalog: it needs a `set:` or `cn:` filter, or at least one name word of 3 or more letters or numbers. `r:` and `c:` ride along beside one of those but do not narrow on their own, and a negated filter such as `-set:` never counts. Anything broader is refused with a 422 (`reprice_preview_search_too_short`) before any card is read.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Give `products`, or `game` with `search` or `match_rule`, or products and one of those.",
                "properties": {
                  "game": {
                    "$ref": "#/components/schemas/GameId"
                  },
                  "search": {
                    "type": "string",
                    "description": "Inventory-style card search (`set:`, `cn:`, `r:`, `c:` and name words) within `game`. Required with `scope: catalog`, where it needs a `set:` or `cn:` filter or a name word of 3 or more letters or numbers.\n"
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "in_stock",
                      "catalog"
                    ],
                    "default": "in_stock",
                    "description": "`in_stock` searches the store's priced cards that have stock; `catalog` searches every card of `game`, including ones the store has never priced.\n"
                  },
                  "draft_rules": {
                    "type": "array",
                    "maxItems": 500,
                    "description": "An unsaved ruleset for `game`, in evaluation order, used instead of the saved rules of that game. Validated as a save would be. Requires `game`.\n",
                    "items": {
                      "$ref": "#/components/schemas/RepriceDraftRule"
                    }
                  },
                  "match_rule": {
                    "type": "object",
                    "description": "Fill the run with the in-stock cards one rule matches, selected by the rule engine, instead of a `search`. Counted in full as `matched_total` and sampled across price like a search. A price-locked card, or one the rule computes no price for, still counts as matched. A `MARKETPLACE` rule is matched on the rest of its condition. Requires `game`; cannot be combined with `search`.\n",
                    "properties": {
                      "rule_uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "A saved rule of `game`, or a rule in `draft_rules` that carries this id.\n"
                      },
                      "draft_index": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Position of the rule in `draft_rules`, for an unsaved rule that has no id yet.\n"
                      }
                    }
                  },
                  "products": {
                    "type": "array",
                    "maxItems": 50,
                    "description": "Inventory to preview repricing for. Each entry pairs a TCGPlayer product with the specific SKU variant being previewed.",
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_product_id",
                        "tcgplayer_sku_id"
                      ],
                      "properties": {
                        "tcgplayer_product_id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Parent TCGPlayer product ID for the SKU being previewed."
                        },
                        "tcgplayer_sku_id": {
                          "type": "integer",
                          "format": "int64"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The body is not JSON or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Preview results",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "previews"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "previews": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/RepricePreview"
                          },
                          {
                            "$ref": "#/components/schemas/RepriceListingPreview"
                          }
                        ]
                      }
                    },
                    "outcomes": {
                      "type": "array",
                      "description": "One base-price outcome per previewed SKU, in request order.",
                      "items": {
                        "$ref": "#/components/schemas/RepricePreviewOutcome"
                      }
                    },
                    "marketplace_outcomes": {
                      "type": "array",
                      "description": "One entry per marketplace price a previewed card has or a `MARKETPLACE` rule matches, in request order then by marketplace. Unlike `previews`, it includes prices a rule matched but did not change and prices no rule touches. Covers cards the store has priced only (`in_inventory: true`), and does not apply `N PER DAY` limits.\n",
                      "items": {
                        "$ref": "#/components/schemas/RepricePreviewMarketplaceOutcome"
                      }
                    },
                    "matched_total": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "How many SKUs the `search` matched before sampling. Null when the request had no search.\n"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), the search box used an operator it can't read (`search_query_invalid`), or a `scope: catalog` search is too broad to run (`reprice_preview_search_too_short`, with a `validation_errors` entry on `search`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/schedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getRepriceSchedule",
        "tags": [
          "Reprice"
        ],
        "summary": "Get the store's scheduled repricing hours",
        "description": "Returns the hours of day (0-23, UTC) at which the store is scheduled to reprice automatically. An empty array means scheduled repricing is off.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's repricing schedule",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceSchedule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/execute/{reprice_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RepriceJobUuid"
        }
      ],
      "get": {
        "operationId": "getRepriceJob",
        "tags": [
          "Reprice"
        ],
        "summary": "Get the status of a repricing job",
        "description": "Polls a repricing job by UUID, returning its status (pending, completed, or failed), the rules applied, the number of price changes, and summary statistics. Use the reprice/history detail route to page through the individual changes.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/execute/{reprice_job_uuid}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RepriceJobUuid"
        }
      ],
      "post": {
        "operationId": "cancelRepriceJob",
        "tags": [
          "Reprice"
        ],
        "summary": "Cancel a repricing job",
        "description": "Cancels a still-pending or running repricing job — useful when a job is stuck in flight or a scheduled run needs to be stopped. The job transitions to the terminal \"cancelled\" state: a pending job never runs, and a running job stops at the next chunk boundary. Cancelling releases the per-store concurrency lock so a fresh reprice can start immediately. Already-finished jobs (completed, failed, or cancelled) return 409. Returns 404 if no such reprice job exists for the store.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The cancelled reprice job.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/reprice/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listRepriceHistory",
        "tags": [
          "Reprice"
        ],
        "summary": "List past repricing executions",
        "description": "Lists the store's past repricing executions newest-first, paginated via limit (default 7, max 30) and offset, with optional filters for status and created_after / created_before.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Defaults to 7 (one full week of daily repricing runs). Maximum 30 due to large payload size per execution record.\n",
            "schema": {
              "type": "integer",
              "default": 7,
              "minimum": 1,
              "maximum": 30
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by job status",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Filter executions created at or after this timestamp (inclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "description": "Filter executions created before this timestamp (exclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated execution history",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRepriceHistoryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/history/{reprice_job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RepriceJobUuid"
        }
      ],
      "get": {
        "operationId": "getRepriceExecution",
        "tags": [
          "Reprice"
        ],
        "summary": "Get details of a specific repricing execution",
        "description": "Returns execution metadata along with a filtered, sorted, paginated list of individual price changes. Use limit and offset to page through the embedded changes array. The filter and sort parameters let a store owner find a specific card within one run (by name, SKU, set, or collector number) and narrow or order the changes.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Card search in the inventory grid's grammar, limited to card-level operators: `set:`, `cn:`, `r:`, `c:` and `game:` (negation and `( a or b )` groups work as on the inventory grid). Operators for copies a store holds (`cogs:`, `tag:`, `bin:`, `qty:`, `usd`, ...) are a 400. The rest is card-name text: words are matched independently (word-order-independent, all required), and a quoted phrase is one word.\n"
          },
          {
            "name": "tcgplayer_sku_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Filter to a single variant by exact TCGPlayer SKU ID."
          },
          {
            "name": "set_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by exact set abbreviation (e.g. \"MKM\")."
          },
          {
            "name": "collector_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by exact collector / product number within the set."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter to changes recorded for a single marketplace."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "increase",
                "decrease",
                "new",
                "unchanged"
              ]
            },
            "description": "Filter by price-change direction — `increase`/`decrease` compare price_after to price_before; `new` selects first-priced rows (no prior price); `unchanged` selects rows a rule matched but whose computed price equals the prior price. Omitting this parameter (or passing an unrecognized value) excludes `unchanged` rows from both the returned list and `total_changes`, matching the job-level `total_changes` — `unchanged` is the only way to see them.\n"
          },
          {
            "name": "min_change",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double",
              "minimum": 0
            },
            "description": "Only changes whose absolute price delta is at least this amount. First-priced rows (no prior price) are excluded when set.\n"
          },
          {
            "name": "rule_uuid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Filter to changes attributed to a single reprice rule."
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "change",
                "change_abs",
                "price_after",
                "price_before",
                "sku"
              ],
              "default": "name"
            },
            "description": "Sort key for the changes array. `change`/`change_abs` are the signed and absolute price deltas. Defaults to card name.\n"
          },
          {
            "name": "sort_dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            },
            "description": "Sort direction. Defaults to ascending."
          }
        ],
        "responses": {
          "422": {
            "description": "The search box uses an operator this page cannot use, or contradicts the page's `game` filter (`search_query_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Execution details with paginated changes",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceJobDetail"
                }
              }
            }
          },
          "400": {
            "description": "A filter that is malformed (`query_param_invalid`: `rule_uuid`, `tcgplayer_sku_id`, `min_change`, `limit`, `offset`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/coverage-gaps": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listRepriceCoverageGaps",
        "tags": [
          "Reprice"
        ],
        "summary": "List inventory the store's reprice rules do not cover",
        "description": "The cards behind the `unmatched` and `needs_attention` counts on a run summary: inventory no enabled rule matched, so repricing left it alone. Two kinds, told apart by `gap_type` — `no_rule_matched` (the SKU was priced and no price rule touched it; a `DO NOT LIST ON` rule sets no price, so a SKU only that kind of rule matched is still listed here) and `stocked_unpriced` (the SKU has stock but no price, and no rule could give it one).\n\nThis is a projection of the store's current rule set, not per-run history: each completed reprice run rewrites it and drops the previous run's rows, so it answers \"what is my ruleset missing now\". `job_uuid` and `generated_at` say which run produced the answer. Price-locked SKUs are never listed — they are excluded from repricing deliberately, and are reported as the summary's `skipped_locked` instead.\n\nPaginated via limit (default 50, max 200) and offset, with the same card-finding filters and sorts as the run-detail change list.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "gap_type",
            "in": "query",
            "required": false,
            "description": "Restrict to one kind of gap. Omit for both. The unfiltered totals for each are always returned in `counts_by_type`.\n",
            "schema": {
              "$ref": "#/components/schemas/RepriceCoverageGapType"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Card search in the inventory grid's grammar, limited to `set:` (and `( set:a or set:b )`) and `game:`; the structured `set_code` and `collector_number` params cover the rest. Any other operator (`cogs:`, `tag:`, `bin:`, `qty:`, `usd`, `r:`, `c:`, `cn:`, negation, ...) is a 400. The rest is card-name text: words are matched independently (word-order-independent, all required), and a quoted phrase is one word.\n"
          },
          {
            "name": "tcgplayer_sku_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Restrict to a single SKU."
          },
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one game (e.g. `magic`, `pokemon`)."
          },
          {
            "name": "set_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one set code."
          },
          {
            "name": "collector_number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to one collector number within a set."
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "sku",
                "uncovered_since",
                "price"
              ],
              "default": "name"
            },
            "description": "Sort key. `uncovered_since` surfaces the longest-standing gaps first when combined with `sort_dir=asc`.\n"
          },
          {
            "name": "sort_dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          }
        ],
        "responses": {
          "422": {
            "description": "The search box uses an operator this page cannot use, or contradicts the page's `game` filter (`search_query_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated coverage gaps",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceCoverageGapList"
                }
              }
            }
          },
          "400": {
            "description": "A filter that is malformed or not allowed (`query_param_invalid`: `gap_type`, `tcgplayer_sku_id`, `limit`, `offset`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/watchlist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getRepriceWatchlist",
        "tags": [
          "Reprice"
        ],
        "summary": "List the cards a store watches in the Price Lab for one game",
        "description": "The cards a store keeps an eye on while it edits its pricing rules, for one game, oldest first. The Price Lab tests them as a quick set, and the rules editor previews them against a draft before saving (an ordinary `previewReprice` call with the cards as `products`). A list holds at most `max_cards` cards, which is what one preview evaluates.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The game's watchlist",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceWatchlist"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/watchlist/{tcgplayer_sku_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "put": {
        "operationId": "addRepriceWatchlistCard",
        "tags": [
          "Reprice"
        ],
        "summary": "Watch a card in the Price Lab",
        "description": "Adds the card to the watchlist of its game, which is taken from the catalog, and returns that game's list. Adding a card already watched changes nothing. A card the store does not stock can be watched. A list that already holds `max_cards` cards refuses another (`reprice_watchlist_full`).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The card's game's watchlist, with the card in it",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepriceWatchlist"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "removeRepriceWatchlistCard",
        "tags": [
          "Reprice"
        ],
        "summary": "Stop watching a card in the Price Lab",
        "description": "Removes the card from its game's watchlist. Removing a card that is not watched changes nothing.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "The card is no longer watched",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/prices/skus/{tcgplayer_sku_id}/explain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "explainRepricePriceSku",
        "tags": [
          "Reprice"
        ],
        "summary": "Explain the retail price for one SKU",
        "description": "Answers \"why is this card priced this way?\" for a single SKU — one grade of one printing. The retail twin of `explainBuylistOfferSku` (#2250).\n\nRe-runs the store's reprice rules against the SKU right now, through the same compiled predicates and price expressions the base-price update uses, but without the first-match short-circuit. The response reports every rule's own verdict (matched / shadowed by an earlier match / did not match / undecidable because a price or date it compares has no value for this SKU yet / disabled / unsupported), the value of every variable those rules read for this SKU, and the store's own `pricing_data` row — with any disagreement between the two named in `divergence`. A catalog attribute the catalog has no value for — rarity on sealed product or a token — is decided, not undecidable.\n\n`live` is the base retail price and `marketplace_live` each marketplace's: a `MARKETPLACE`-conditioned rule is judged on the rest of its condition and decides the marketplaces it names, the way a reprice run does (first match claims a marketplace; a later base rule clears an earlier override). A `DO NOT LIST ON` rule asserts a suppression rather than computing a price, and is reported in `skipped_rules` rather than explained.\n\nRead-only: nothing is rebuilt, priced, or cached. Store-configurable (`reprice.explain_price`): managers and owners by default; a store owner can grant it to employees, who then see every rule's source.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `repricing:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retail price attribution for the SKU",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepricePriceExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "explainRepricePriceSkuDraft",
        "tags": [
          "Reprice"
        ],
        "summary": "Explain the retail price for one SKU against unsaved rules",
        "description": "The same report as `explainRepricePriceSku`, evaluated against an unsaved ruleset for the SKU's game instead of the saved one. For the Price Lab's Draft mode. Nothing is saved, priced, or cached.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "game",
                  "draft_rules"
                ],
                "properties": {
                  "game": {
                    "$ref": "#/components/schemas/GameId"
                  },
                  "draft_rules": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "$ref": "#/components/schemas/RepriceDraftRule"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retail price attribution for the SKU against the draft",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepricePriceExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/prices/products/{tcgplayer_product_id}/explain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "explainRepricePriceProduct",
        "tags": [
          "Reprice"
        ],
        "summary": "Explain the retail price for every grade of one card",
        "description": "The product-wide form of `explainRepricePriceSku`: same attribution, run over every SKU of the printing rather than one. Use it when the question is \"why is my Near Mint copy priced less than I expected\" — the grades sit side by side, each with the rule that priced it and the condition its price actually resolved off.\n\nRead-only. The retail twin of `explainBuylistOfferProduct` — the per-product read behind the inventory page's retail pricing tab. Store-configurable (`reprice.explain_price`): managers and owners by default; a store owner can grant it to employees, who then see every rule's source.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `repricing:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retail price attribution for every SKU of the product",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepricePriceExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/sku/{tcgplayer_sku_id}/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "tcgplayer_sku_id",
          "in": "path",
          "required": true,
          "description": "TCGplayer SKU identifier",
          "schema": {
            "type": "integer",
            "format": "int64"
          }
        }
      ],
      "get": {
        "operationId": "getSkuRepriceHistory",
        "tags": [
          "Reprice"
        ],
        "summary": "Get base-price history for a specific SKU",
        "description": "Returns a paginated, reverse-chronological list of changes to a SKU's base price, merging reprice-engine changes (across all completed reprice jobs), manual edits, and inventory imports into one series.\nScoped to the base price. Per-marketplace price overrides are excluded: an override applies to one sales channel rather than to the price this SKU carries, and these entries have no field identifying a marketplace, so including them would produce points a client cannot attribute or plot as a distinct series.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of results per page (default 20, max 100)",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated per-SKU repricing history",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSkuRepriceHistory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reprice/rules/{rule_uuid}/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RuleUuid"
        }
      ],
      "get": {
        "operationId": "getRuleRepriceHistory",
        "tags": [
          "Reprice"
        ],
        "summary": "Get repricing history for a specific rule",
        "description": "Returns a paginated, reverse-chronological list of every price change caused by a given rule across all completed reprice jobs. Each entry includes the SKU, product, before/after prices, and the job that produced the change.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `repricing:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Include only changes created at or after this timestamp (inclusive, ISO 8601)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "description": "Include only changes created before this timestamp (exclusive, ISO 8601)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated per-rule repricing history",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRuleRepriceHistory"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/reprice/parse": {
      "post": {
        "operationId": "dslParse",
        "tags": [
          "DSL"
        ],
        "summary": "Parse a DSL rule string into an AST",
        "description": "Tokenizes and parses a single DSL rule string, returning the structured AST on success or a parse error on failure. Stateless — no store context required.\n\n**Who can call this:** Any signed-in user.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DslParseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully parsed. A single-string request returns the AST directly; an array request returns a `DslBatchParseResult` with one entry per rule (partial success on individual parse failures).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DslRuleAst"
                    },
                    {
                      "$ref": "#/components/schemas/DslBatchParseResult"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "rule": "#/components/schemas/DslRuleAst",
                      "batch_result": "#/components/schemas/DslBatchParseResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/reprice/dsl": {
      "get": {
        "operationId": "dslListVariables",
        "tags": [
          "DSL"
        ],
        "summary": "List all supported DSL variables and operators",
        "description": "Returns every supported variable name, attribute, and operator recognized by the DSL parser. Useful for building UI autocomplete or validation on the client side. Stateless — no store context required. `finish_values` and `rarity_values` are game-specific and follow the `game` query parameter (default `magic`). `condition_values` follows the `region` query parameter (default `usa`): `eu` returns the Cardmarket/MKM grades an EU seller writes rules in, plus `Unopened`, which an EU store's rule write translates to the stored US conditions at parse time (#1152). All other fields are game/region-agnostic, and the stored vocabulary is always the US six.\n\n**Who can call this:** Any signed-in user.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's finish/rarity vocabulary to return. Defaults to `magic` when omitted.\n"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Region"
            },
            "description": "Which seller-facing condition vocabulary `condition_values` should return (#1150/#1151/#1152). `usa` (the default) returns the stored US conditions; `eu` returns the Cardmarket/MKM grades plus `Unopened` (sealed product has no Cardmarket grade), which this region's stores may write rules in.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "All supported DSL variables and operators",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DslVariables"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/buylist/rules/validate": {
      "post": {
        "operationId": "validateBuylistRules",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Validate buylist rule DSL strings (stateless, no store context needed)",
        "description": "Always returns 200 -- check the `valid` field and per-rule results for errors. Rate limited to 2 requests per second.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string"
                    },
                    "description": "List of buylist DSL rule strings to validate"
                  },
                  "region": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Region"
                      }
                    ],
                    "default": "usa",
                    "description": "Which seller-facing CONDITION vocabulary the rules are written in (#1597). This route takes no `store_uuid`, so the caller states the region the rule builder is composing for. `usa` (the default) accepts the stored US conditions only, exactly as before; `eu` additionally accepts the Cardmarket/MKM grades `GET /v1/buylist/dsl?region=eu` advertises and the store-scoped rule save already accepts, so a preview stops rejecting a rule that would save fine.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A value in the request was refused (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Validation results",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "results"
                  ],
                  "properties": {
                    "valid": {
                      "type": "boolean",
                      "description": "True only if every rule passed validation"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "sequence_index",
                          "rule",
                          "is_valid"
                        ],
                        "properties": {
                          "sequence_index": {
                            "type": "integer",
                            "description": "1-based position of the rule in the submitted array"
                          },
                          "rule": {
                            "type": "string",
                            "description": "The buylist DSL rule string that was validated"
                          },
                          "is_valid": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string",
                            "description": "Present when is_valid is false"
                          },
                          "line": {
                            "type": "integer",
                            "description": "1-based source line of the parse error (absent for a semantic error)"
                          },
                          "column": {
                            "type": "integer",
                            "description": "1-based source column of the parse error (absent for a semantic error)"
                          },
                          "validation_errors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "message"
                              ],
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              }
                            },
                            "description": "One entry per distinct cause, present on a multi-field constraint violation"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistRules",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Get all of a game's buylist rules",
        "description": "Returns every buylist rule of a single game in evaluation (sequence_index) order, with the ruleset ETag. It is not paged: the whole game's ruleset comes back in one response, which is what `replaceBuylistRules` replaces. The `game` query parameter selects which ruleset to read and defaults to `magic` when omitted.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's ruleset to return. Defaults to `magic` when omitted.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Every buylist rule of the game, in evaluation order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceBuylistRules",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Replace a single game's buylist rule set atomically",
        "description": "Replaces the buylist rules for a single game (selected via the required `game` query parameter) with the provided set. Array order determines evaluation order. An empty array is not accepted -- returns 422. Each item is either a new rule (with both `rule` and `name`) or a reference to an existing rule by `rule_uuid`. Existing rules of this game not included in the array are deleted; rules belonging to other games are never read, modified, or deleted.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's ruleset to replace."
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "minItems": 1,
                    "description": "Defines the complete rule set (for the `game` query parameter) and evaluation order. Each item must have either rule_uuid (to keep an existing rule) or both rule and name (to create a new one). Existing rules of this game not included in the array are deleted.\n",
                    "items": {
                      "$ref": "#/components/schemas/BuylistRuleInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "A rule name is already in use (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "`If-Match` is required when rules exist (`if_match_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Buylist rule set replaced for the given game",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createBuylistRule",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Create a single buylist rule",
        "description": "Creates one new rule for the given game. Appends to the end of that game's evaluation order unless `position` (1-based) is given. Only the target game's rules are affected -- other games are untouched. Rule names must be unique within the store (across all games); a duplicate `name` returns 422.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistRuleCreateInput"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "A rule with that name already exists (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Buylist rule created",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/rules/order": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "put": {
        "operationId": "reorderBuylistRules",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Atomically reorder a single game's buylist rules",
        "description": "Reassigns evaluation order for a single game's rules in one atomic operation. `rule_uuids` must be exactly the current set of that game's rule uuids (no missing, extra, or foreign-game entries) -- this is the safe alternative to N individual PATCHes, which could leave the ruleset half-reordered. Other games are never touched.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's rules to reorder."
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_uuids"
                ],
                "properties": {
                  "rule_uuids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "The complete, reordered set of the target game's rule uuids. Must match the game's existing rules exactly.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The set of rules changed (`rule_set_changed`). Reload and reorder again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "`If-Match` is required when rules exist (`if_match_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Buylist rules reordered for the given game",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/rules/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewBuylistRules",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Preview what the store's buylist rules would pay for some cards (dry run)",
        "description": "The buy-side twin of `previewReprice`: runs the store's enabled ruleset over the requested SKUs and reports what each would be bought for, and which rule decides it, without writing anything. Send `tcgplayer_sku_ids`, `tcgplayer_product_id` (every grade of one card), or both; at least one is required.\n\nEach row pairs the store's **current** offer -- the `store_buylist_offer` row the storefront is quoting right now -- with what the rules compute **today**, so `current_cash`/`current_credit` and `new_cash`/`new_credit` are directly comparable. The two disagree legitimately in two ways, and the row carries the flags to tell them apart: the offer projection rebuilds on the store's `repricing_hours`, so it is *meant* to lag a rule edit, and a `locked` row is a deliberate price freeze the next rebuild will not touch at all -- the previewed price there is what the rules say, not what the store will pay.\n\n`decision` is `buy`, `decline` (a DECLINE rule matched -- store policy) or `no_match` (nothing matched -- a rule-coverage gap). A BUY rule that matched but computed no price is a fourth state: `decision` stays `buy` with a null `new_cash`, which is the usual reason a card is silently missing from the storefront. `GET .../offers/skus/{id}/explain` is what diagnoses why that price is null.\n\nBounded to 50 SKUs, counted *after* a `tcgplayer_product_id` expands to its grades -- a card resolving to more SKUs than the caller can see is refused rather than silently truncated.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of `tcgplayer_sku_ids` or `tcgplayer_product_id`. Both together is allowed and unions the two sets.\n",
                "properties": {
                  "tcgplayer_sku_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "description": "The SKU variants to preview. Deduped; order does not matter."
                  },
                  "tcgplayer_product_id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Preview every live grade of this card. Expands to its `global_identifiers` SKUs before the 50-SKU bound is applied.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview results, one row per resolved SKU in ascending SKU order.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "previews"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "How many rows `previews` holds. A SKU that is not in the catalog (or is soft-deleted) is simply absent, so this can be smaller than what was asked for.\n"
                    },
                    "previews": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BuylistRulePreview"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/rules/{rule_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RuleUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistRule",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Get a single buylist rule",
        "description": "Returns a single buylist rule with its ETag for optimistic concurrency.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Buylist rule details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateBuylistRule",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Update a buylist rule's DSL string, name, or enabled state",
        "description": "Updates a buylist rule's DSL, name, game, or enabled state. An optional If-Match with the rule's ETag makes it conditional (412 on mismatch); it validates the DSL against the rule's game.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "rule": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "User-defined name for the buylist rule"
                  },
                  "game": {
                    "type": "string",
                    "description": "Game the rule applies to (magic, pokemon, lorcana, onepiece, riftbound, unionarena, pokemonjp, gundam, starwars, yugioh, cyberpunk, palworld, digimon, fleshblood, cookierun, sleeves, sorcery, wow, deckboxes, playmats, binders, colstorage, counters, vanguard, dbsmasters, dbsfusion, weiss).\n"
                  },
                  "is_enabled": {
                    "type": "boolean"
                  },
                  "currency": {
                    "$ref": "#/components/schemas/Currency"
                  },
                  "sequence_index": {
                    "type": "integer",
                    "description": "Direct override of this rule's evaluation order among its own game's rules. Prefer PUT .../rules/order for a safe, atomic multi-rule reorder.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "A rule with that name already exists (`rule_name_already_exists`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Buylist rule updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistRule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteBuylistRule",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Delete a single buylist rule",
        "description": "Deletes a buylist rule and resequences the remaining rules of its game. Returns 204. An optional If-Match with the rule's ETag (from GET or PATCH) makes the delete conditional: 412 when the rule changed since.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "204": {
            "description": "Buylist rule deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/rules/{rule_uuid}/offers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RuleUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistRuleOffers",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "The cards one buylist rule is currently pricing",
        "description": "Every offer this rule owns as of the last offer rebuild, highest buy price first, with `total` stating the whole size of the rule's footprint rather than the page's.\n\nThis is the buy-side counterpart of `getRuleRepriceHistory` and deliberately not the same thing. That endpoint reads `reprice_snapshots` -- one row per SKU per job, stamped with the rule that moved the price -- so it can show a rule's effect over time. The buylist side writes no such ledger: an offer rebuild is a whole-catalog delete-and-reinsert of `store_buylist_offer`, and the only attribution that survives it is the winning rule on the current row. So this answers the present tense -- what is this rule doing to my buy prices -- and there is no buylist equivalent of a per-rule change log to ask for.\n\nTwo things follow from reading the projection. It is **as old as the projection**: the rows were written by the last rebuild, which runs on the store's `repricing_hours`, so a rule edited five minutes ago still shows the previous rule set's rows. `POST .../buylist/rules/preview` is the live counterpart. And a **price-locked offer keeps whichever rule priced it before the freeze**, because the rebuild leaves that row untouched -- so a rule can own rows it would no longer match. That is the truth about who set the price, which is the point.\n\nThe response echoes the rule's `game`, but the listing is not scoped to it. A rule can be moved between games, and the frozen rows it priced under the previous one keep pointing at it with no rebuild that will ever re-derive them; a game-scoped page would report `total: 0` for a rule still holding a price.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "enum": [
                "cash_desc",
                "cash_asc",
                "name_asc"
              ],
              "default": "cash_desc"
            },
            "description": "`cash_desc` (default) is highest buy price first -- the rows where a rule mistake costs real money. A rule matching forty thousand bulk commons is unreadable in any other order.\n"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Page of the offers this rule prices.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistRuleOfferList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/quote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "evaluateBuylistQuote",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Evaluate a buylist quote against the store's active enabled ruleset",
        "description": "Stateless evaluator. Loads the store's enabled rules, compiles projection SQL, runs it against the provided input rows, returns per-line outcomes. First-match semantics: the lowest sequence_index rule whose WHERE matches an input row wins. DECLINE rules surface their rule_uuid; no-rule-matched outcomes have matched_rule_uuid=null.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A card in the request was refused, or the request has more cards than an offer can hold (`validation_error`, `offer_line_limit_exceeded`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Per-line quote results in input order.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistQuoteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/quote/override": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "overrideBuylistDecline",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Buy a card the store's ruleset declines",
        "description": "Records a manager/owner decision to buy a card the ruleset declines, and returns what the rules currently say for that SKU so the caller can seed its price input (`cash_offer`/`credit_offer` are null on a genuine decline — the operator prices it). `was_declined` false means a rule changed since the quote and the card is bought normally. Purely advisory + audited: the line is persisted by the usual create / replace-lines / reconcile call, which re-checks this same permission for every line it marks as an override.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistDeclineOverrideRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A value in the request was refused (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Override recorded; current rules outcome for the SKU.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistDeclineOverrideResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/push": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "pushBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Push a received BuylistPurchase into inventory.",
        "description": "Converts a received BuylistPurchase into inventory via the costed-intake primitive. Requires the purchase to be in `received` state (the cards must be marked physically in hand first; the lifecycle is accepted → received → pushed). One intake call per destination location. Per-line idempotency via the request's idempotency_key + line_item_uuid. Re-push of an already-pushed purchase returns the prior result as an idempotent no-op.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushPurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Push succeeded (or idempotent replay of a prior successful push).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushPurchaseResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/credit-issue/retry": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "retryBuylistCreditIssue",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Send (or re-send) a purchase's store credit to the customer's POS account",
        "description": "Retries the store credit recorded for a pushed purchase. Send `pos_customer_id` to credit a customer picked from the Shopify customer search; omit it to find the customer by the purchase's email or phone. An attempt whose outcome was never confirmed is checked against Shopify before crediting again, so the customer is never credited twice. The result is the credit's state; a credit that fails again answers 200 with `status` failed and its `error`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pos_customer_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The credit's state after the attempt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistCreditIssue"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The purchase has no store credit to send (`buylist_credit_issue_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The credit is already issued (`buylist_credit_already_issued`) or another attempt is running (`buylist_credit_issue_in_progress`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/complete": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "completeBuylistWalkIn",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Accept, receive and push a walk-in purchase in one action",
        "description": "Walk-in only (`intake_kind` = walk_in). The customer is at the counter, so there is nothing to wait for between accepting and paying: this locks the agreed prices and per-line cost basis, records the cards as received, pushes them into inventory and records the payout. Body is the same as `push`, including the destination target and `idempotency_key`.\nSafe to retry: an offer already past acceptance resumes at the push, and the push replays on its idempotency key instead of intaking the cards twice. Send If-Match so a stale client loses instead of accepting an offer someone else has edited.\n422 when the offer is not a walk-in (a mailed-in or dropped-off offer must be accepted first and received when the cards actually arrive).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushPurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Offer completed (or idempotent replay of a prior completion).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PushPurchaseResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Create a new draft buylist purchase",
        "description": "Creates a draft buylist purchase with its initial line items (SKU, condition, quantity). Returns 201 with the created purchase.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDraftPurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Draft purchase created",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "operationId": "listBuylistPurchases",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "List buylist purchases for a store",
        "description": "Returns the store's buylist purchases, paginated and filterable by status, creation date range, intake kind, archived flag and creator. Archived offers are left out unless `archived` says otherwise. Set created_by_self=true to return only the caller's purchases. A limit over 250 is capped at 250.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list of statuses to filter by"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_by_self",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Restrict results to purchases the calling user created (derived server-side from the bearer token). Combine with status=draft to fetch the caller's resumable offers."
          },
          {
            "name": "intake_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list of intake kinds (`walk_in`, `mail_in`, `drop_off`) to filter by."
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "exclude",
                "only",
                "include"
              ],
              "default": "exclude"
            },
            "description": "Whether archived offers are left out (`exclude`, the default), returned on their own (`only`), or mixed in (`include`)."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A `limit` below 1 or an `offset` below 0 (`query_param_invalid`). A `limit` over 250 is capped at 250, not refused.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated list of buylist purchases",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistPurchaseList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Get a single buylist purchase",
        "description": "Returns a single buylist purchase with a version ETag for optimistic concurrency.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Buylist purchase details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "alterBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Update line items on a draft purchase",
        "description": "Updates a draft purchase by replacing its line items with the supplied set — lines in the request become authoritative and omitted lines are removed. Draft-only; requires the If- Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlterPurchaseRequest"
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer is no longer a draft (`purchase_not_draft`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Purchase updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/lines": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistPurchaseLines",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "List line items for a buylist purchase",
        "description": "Returns a purchase's line items enriched with catalog data (product name and number, set code, language, finish).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "413": {
            "description": "The lines are too large for one response and the client does not accept gzip (`response_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Line items for the purchase",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines"
                  ],
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BuylistLineItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceDraftPurchaseLines",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Replace a draft purchase's entire line set by SKU",
        "description": "Replaces the draft purchase's entire line set, keyed by SKU. Lines present in the request become the authoritative set; lines omitted are removed; an empty array clears all lines. Draft-only. Duplicate (tcgplayer_sku_id, condition) pairs are rejected with 422. If-Match is required: the draft can gain lines server-side (an import appending to it) while a client holds it, and a replace built from a stale read would delete them. A missing header is 428; a stale one is 412, and the client should reload the draft rather than retry.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatchRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceDraftLinesRequest"
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer is no longer a draft (`purchase_not_draft`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Purchase line set replaced",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/accept": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "acceptBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Accept a draft buylist purchase",
        "description": "Transitions a draft purchase to accepted, locking in the agreed prices and computing per- line cost of goods. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Purchase accepted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "cancelBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Cancel a buylist purchase",
        "description": "Cancels a purchase that isn't finished yet (which statuses depends on its intake kind), preserving its quoted and agreed values as a historical record. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Purchase canceled",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/archive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "archiveBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Archive a finished buylist purchase",
        "description": "Hides a finished offer (pushed, canceled, declined or returned) from the store's offers list. Nothing is deleted: status, totals, lines and audit trail are unchanged, reports still count it, and unarchive restores it. Idempotent; records a `buylist_purchase.archived` audit event.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "409": {
            "description": "The offer isn't finished (`purchase_invalid_state`): only pushed, canceled, declined or returned offers can be archived.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The purchase, with its archived flag updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/unarchive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "unarchiveBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Restore an archived buylist purchase",
        "description": "Returns an archived offer to the store's offers list. Idempotent (an offer that isn't archived is returned unchanged); records a `buylist_purchase.unarchived` audit event.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The purchase, with its archived flag updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/archive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "bulkArchiveBuylistPurchases",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Archive or restore several buylist purchases",
        "description": "Archives (or, with `archived: false`, restores) up to 100 offers. Each offer is handled on its own, so one that isn't finished or isn't in this store is reported in `results` without holding back the others.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "purchase_uuids"
                ],
                "properties": {
                  "purchase_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "archived": {
                    "type": "boolean",
                    "default": true,
                    "description": "true archives, false restores."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-offer outcome",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkArchiveBuylistPurchasesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/decline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "declineBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Decline a buylist purchase",
        "description": "Declines a submitted purchase (allowed from draft or changes_proposed), recording an optional store-provided reason and transitioning the purchase to the terminal `declined` state. Distinct from cancel: decline is the store rejecting the seller's offer (\"not this time\"), cancel is the seller withdrawing. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decline_reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional free-text reason surfaced to the seller."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Purchase declined",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/propose_changes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "proposeChangesBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Send revised buylist terms to the seller for re-confirmation",
        "description": "Sends the store's revised offer to the seller for approval, transitioning the purchase to `changes_proposed`. Allowed from `draft` (initial revised offer) or `received` (adjusted offer after intake reconcile); the origin is remembered so a public confirm returns the offer to the right stage (draft accept → accepted, received accept → received; reject → canceled or returned). Distinct from `alter`/`reconcile` (which edit lines in place). The seller accepts or rejects via the public, token-gated confirm endpoint. Fires the \"changes proposed\" email. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Revised terms sent; purchase is awaiting seller confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/confirm_changes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "confirmChangesBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Store override — resolve proposed changes on the seller's behalf",
        "description": "Resolves a `changes_proposed` offer without the seller using the public, token-gated confirm link — for offers with no way to reach the seller (no email on file) or confirmed by phone/in person. Same transition the public confirm endpoint performs: `accept` returns the offer to `accepted` (draft-origin) or `received` (received-origin); `reject` returns it to `canceled` (draft-origin) or `returned` (received-origin). Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "decision"
                ],
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "reject"
                    ],
                    "description": "The seller's decision, entered by the store on their behalf."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Proposed changes resolved.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/receive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "receiveBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Mark a purchase's cards as physically received",
        "description": "Marks the seller's cards as physically in hand (allowed from accepted only), transitioning the purchase to `received`. This is the gate the subsequent push into inventory requires (the lifecycle is accepted → received → pushed). Fires the \"received\" email. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Purchase marked received.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/reconcile": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "reconcileBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Reconcile a received offer against what physically arrived",
        "description": "Adjusts a `received` offer at intake: reduce or reject declared lines (`adjust`, keyed by line_item_uuid) and add cards that arrived at an undeclared SKU (`add`). Added SKUs are re-priced server-side by the store's buylist rules (a declined SKU is recorded as a rejected line rather than failing the call). accepted_quantity may only be reduced (never above the declared quantity); 0 rejects the line. Touched/added lines carry `edited`/`changes` for the seller diff. Status stays `received`; repeatable. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist_payouts:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adjust": {
                    "type": "array",
                    "description": "Edits to declared lines (line_item_uuid-keyed).",
                    "items": {
                      "type": "object",
                      "required": [
                        "line_item_uuid"
                      ],
                      "properties": {
                        "line_item_uuid": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "accepted_quantity": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "agreed_cash": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Decimal string, price of one card."
                        },
                        "agreed_credit": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Decimal string, price of one card."
                        },
                        "condition": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "add": {
                    "type": "array",
                    "description": "Cards that arrived at a SKU not declared; re-priced by the store's rules.",
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_sku_id",
                        "quantity"
                      ],
                      "properties": {
                        "tcgplayer_sku_id": {
                          "type": "integer",
                          "format": "int64"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "override": {
                          "type": "boolean",
                          "default": false,
                          "description": "Buy this card although the ruleset declines it (without the flag a declined add lands as a rejected line). Requires the caller to hold `overrideBuylistDecline`, else the request fails with 422."
                        },
                        "quoted_cash": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Operator price per card, used only with `override` (the rules priced nothing)."
                        },
                        "quoted_credit": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Operator price per card, used only with `override`."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Offer reconciled.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/return": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "post": {
        "operationId": "returnBuylistPurchase",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Return a received offer's cards to the seller",
        "description": "Sends a `received` offer's cards back to the seller, transitioning to the terminal `returned` state and firing the \"cards on their way back\" email. Requires the If-Match ETag (412 on mismatch).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional free-text reason surfaced to the seller."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Purchase returned.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/receipt.pdf": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistPurchaseReceiptPdf",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Get a printable PDF receipt for an accepted or pushed purchase",
        "description": "Returns a printable PDF receipt for an accepted or pushed purchase. Returns 422 if the purchase is still a draft or was canceled.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "PDF receipt with customer and store copies.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"buylist-receipt-{purchase_uuid}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/trade-offer.pdf": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistPurchaseTradeOfferPdf",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Get a printable trade offer for an offer the seller has not yet accepted",
        "description": "Returns a one-copy PDF of the offer's cash and store-credit breakdown, for a seller to read before deciding. Lines print in the store's buylist sort order, with lines the store is not buying last; the header shows when the prices were quoted (the latest line edit). Available while the offer is `draft` or `changes_proposed`; once it is decided, use the receipt instead.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "PDF trade offer.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"buylist-trade-offer-{purchase_uuid}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The offer has already been accepted, received, pushed, canceled, declined or returned (`purchase_invalid_state`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/purchases/{purchase_uuid}/export.csv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/PurchaseUuid"
        }
      ],
      "get": {
        "operationId": "exportBuylistPurchaseCsv",
        "tags": [
          "Buylist Purchases"
        ],
        "summary": "Export a purchase's bought cards as a TCGplayer-format CSV",
        "description": "Returns the purchase's accepted lines as a CSV in the same TCGplayer export format the inventory export emits: TCGplayer's own sixteen columns, then HippoLink's `Location`, `Buy Price`, and `Buy Credit Price`. One row per accepted line; lines with an accepted quantity of zero are omitted. `TCG Marketplace Price` is deliberately blank -- it is the column TCGplayer's uploader writes listing prices back from, and an offer records what the store paid, not what it asks. Returns 422 if the purchase is still a draft or was canceled.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "409": {
            "description": "The offer's state does not allow this (`purchase_invalid_state`, `purchase_not_draft`, `purchase_not_received`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "CSV of the purchase's accepted lines.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"buylist-offer-{purchase_uuid}.csv\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/import": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createBuylistImport",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Initiate a buylist list import (presigned upload)",
        "description": "Creates an import job and returns a presigned S3 PUT URL for the client to upload a CSV file. After upload, call the start endpoint to enqueue the import worker.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistImportRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The offer to add to is not in this store (`purchase_not_found`). Or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "Storage is unavailable (`s3_unavailable`) or the job queue refused the job (`job_queue_unavailable`). Nothing was started; retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Import job created, presigned upload URL returned",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportCreatedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/import/batch": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createBuylistImportBatch",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Start a multi-file buylist import batch",
        "description": "Mints an empty draft BuylistPurchase for a multi-file import (e.g. a non-foil scan and a separate foil scan that belong to the same offer). Pass the returned purchase_uuid as createBuylistImport's purchase_uuid for each file in the batch; every job's resolved lines merge into this one purchase (matching SKU+condition lines are summed) instead of each file minting its own offer.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Empty draft purchase created for the batch",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportBatchCreatedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/import/url": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createBuylistUrlImport",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Initiate a buylist list import from a deck link",
        "description": "Parses a pasted Archidekt/Scryfall deck, Moxfield deck/binder or TCGplayer collection URL, fetches a live preview of its sections (name + per-section card counts), and creates a URL-driven import job. Call the start endpoint with the chosen sections to enqueue the worker. A TCGplayer collection previews as one \"collection\" section.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistUrlImportRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "A request body that is not JSON, or not a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The offer to add to is no longer a draft (`purchase_not_draft`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "502": {
            "description": "The deck site is unavailable or answered badly (`deck_provider_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Storage is unavailable (`s3_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The deck site took too long (`deck_provider_timeout`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Import job created, deck section preview returned",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistUrlImportPreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the callback URL is not a public https address (`callback_url_not_allowed`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/import/{job_uuid}/start": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "post": {
        "operationId": "startBuylistImport",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Confirm upload and enqueue the import worker",
        "description": "Transitions the job from pending_upload to pending and dispatches an SQS message to the buylist import worker. For an uploaded-file job, first verifies the CSV is present on S3 (422 if not). For a URL job, the optional ``sections`` body limits the import to the chosen deck sections. A job with a ready preview (``requestBuylistImportPreview``) imports the previewed rows rather than reading its file or link again.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistImportStartRequest"
              }
            }
          }
        },
        "responses": {
          "404": {
            "description": "No such import (`import_job_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The import was already started (`import_job_already_started`), or condition overrides were sent without a ready preview (`import_preview_not_ready`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "Storage is unavailable (`s3_unavailable`, `file_storage_unavailable`) or the job queue refused the job (`job_queue_unavailable`). Nothing was started; retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Import job enqueued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportStatus"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/import/{job_uuid}/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "post": {
        "operationId": "requestBuylistImportPreview",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Queue a per-row preview of an import not yet started",
        "description": "Parses and resolves every row of a `pending_upload` job (for a deck link, every section) without drafting anything, and stores the rows as the job's preview. Poll `getBuylistImportPreview` until it is `ready`. `startBuylistImport` then imports exactly the previewed rows (filtered by `sections`), so a `row_number` in `condition_overrides` names the row the preview showed. Requesting again replaces the preview. For an uploaded file, the CSV must already be on S3 (422 if not).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Preview queued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportPreviewRequested"
                }
              }
            }
          },
          "404": {
            "description": "No such import (`import_job_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The import was already started (`import_job_already_started`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Storage is unavailable (`file_storage_unavailable`) or the job queue refused the preview (`job_queue_unavailable`). Retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "operationId": "getBuylistImportPreview",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Get an import's per-row preview",
        "description": "The preview requested with `requestBuylistImportPreview`: `pending` while the worker runs, `ready` with every parsed row, or `failed` with an `error_code` and `error` (`import_preview_failed`, `job_queue_unavailable`, or the import's own source codes such as `import_source_failed`; request it again to retry). A large preview is gzipped when the client accepts it. Keep confirming disabled while it is `pending`: a start with overrides is refused until it is `ready`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The preview",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportPreview"
                }
              }
            }
          },
          "404": {
            "description": "No such import (`import_job_not_found`), or no preview was requested (`import_preview_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "413": {
            "description": "The preview is too large to return without gzip (`response_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Storage is unavailable (`file_storage_unavailable`). Retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/import/{job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/JobUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistImportStatus",
        "tags": [
          "Buylist Import"
        ],
        "summary": "Get the status of a buylist import job",
        "description": "Returns a buylist import job's status — state, row counts, any error detail, and the resulting purchase_uuid once the import succeeds.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Import job status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistImportStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-batches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistScanBatches",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "List the store's Scan & Identify batches",
        "description": "Lists batches on the store's connected TCGplayer account, newest first. By default only batches whose names match the store's batch-name template are returned; pass `all=true` for every batch. Each batch carries its scan review, when one exists.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching batches",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanBatchList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`) or a query value is invalid (`validation_error`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      },
      "post": {
        "operationId": "startBuylistScan",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Start a scan on a Sifter",
        "description": "Names the batch from the store's template, then starts the scan on the chosen Sifter with the given game, condition, printing, language and bins.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanStartRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Scan started",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanStartResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The Sifter can't start a scan right now (`scan_device_unavailable`) or TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`), the Sifter isn't on the account (`scan_device_not_found`), the game isn't supported (`scan_game_unsupported`), or a value is invalid (`validation_error`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-batches/{batch_id}/import": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64"
          }
        }
      ],
      "post": {
        "operationId": "importBuylistScanBatch",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Import a Scan & Identify batch into a scan review",
        "description": "Opens a scan review for the batch (or returns the open one) and queues the import that fills it. Poll the review until it is ready.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Import queued",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanImportResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The batch isn't on the store's TCGplayer account (`scan_batch_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "An import of this batch is already running (`scan_review_importing`) or TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`) or a value is invalid (`validation_error`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "The job queue refused the import (`job_queue_unavailable`) or TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`). Nothing was imported; retry.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-devices": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistScanDevices",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "List the store's Sifters",
        "description": "Lists the Sifters on the store's connected TCGplayer account with whether each can start a scan now and, if not, why.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's Sifters",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanDeviceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-devices/{device_id}/stop": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "device_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "stopBuylistScan",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Stop the scan running on a Sifter",
        "description": "Asks TCGplayer to stop the Sifter's current scan.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stop requested",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanStopResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`) or the Sifter isn't on the account (`scan_device_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-devices/{device_id}/resume": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "device_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "resumeBuylistScan",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Continue a scan that paused on a Sifter",
        "description": "Asks TCGplayer to continue a scan the Sifter paused, for example when its hopper ran out of cards.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Resume requested",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanStopResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`) or the Sifter has no paused scan (`scan_device_not_paused`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`) or the Sifter isn't on the account (`scan_device_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistScanSettings",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "The choices a scan can be started with",
        "description": "Lists the games, printings per game, conditions and languages the Sifter accepts.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Scan choices",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistScanReviews",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "List scan reviews",
        "description": "Lists the store's scan reviews, newest first.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "importing",
                "ready",
                "committed",
                "discarded"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scan reviews",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReviewList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "A filter or page value is invalid (`validation_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getBuylistScanReview",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Get a scan review",
        "description": "Returns the review with its line counts. The `ETag` is the version to send as `If-Match` on every change.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The scan review",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateBuylistScanReview",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Change the seller on a scan review",
        "description": "Sets the seller's name, email or phone on the review; committing the review puts them on the new offer. Send only the fields to change (null clears one) and the review's version as `If-Match`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanReviewCustomerUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated review",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The review is being imported (`scan_review_importing`) or is no longer editable (`scan_review_not_editable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "description": "The review changed since it was loaded (`scan_review_modified`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A value is invalid (`validation_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "No `If-Match` was sent (`if_match_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}/lines": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listBuylistScanReviewLines",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "List the lines of a scan review",
        "description": "Unidentified lines come first, then scan order. Filters combine.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "unresolved",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "corrected",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "excluded",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "bin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of lines",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReviewLineList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A page value is invalid (`validation_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "editBuylistScanReviewLines",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Correct lines of a scan review",
        "description": "Changes up to 1,000 lines at once: pick a different card, change its condition, printing or language, change the quantity, or exclude it. Send the review's version as `If-Match`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanReviewLineEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated review",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The review is being imported (`scan_review_importing`) or is no longer editable (`scan_review_not_editable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "description": "The review changed since it was loaded (`scan_review_modified`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A change is invalid (`validation_error`) or the card doesn't come in that condition, printing or language (`scan_line_variant_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "428": {
            "description": "No `If-Match` was sent (`if_match_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}/lines/bulk": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "bulkEditBuylistScanReviewLines",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Change many lines of a scan review at once",
        "description": "Applies one condition, printing, language or exclusion to every line (optionally one bin), or accepts every suggested card. Lines that can't take the change are listed in `unchanged`. Send the review's version as `If-Match`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanReviewBulkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated review",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReviewBulkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The review is being imported (`scan_review_importing`) or is no longer editable (`scan_review_not_editable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "The review changed since it was loaded (`scan_review_modified`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "The change is invalid or empty (`validation_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "428": {
            "description": "No `If-Match` was sent (`if_match_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}/lines/{line_uuid}/image": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "line_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getBuylistScanReviewLineImage",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "The TCGplayer picture of a scanned card",
        "description": "Streams the scan's thumbnail through HippoLink, using the store's TCGplayer connection. Cached privately for 30 minutes.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The picture",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review or line doesn't exist (`scan_review_not_found`, `scan_review_line_not_found`) or TCGplayer has no picture of the card (`scan_line_image_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "TCGplayer didn't accept the store's connection (`tcgplayer_session_rejected`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "The store isn't connected to TCGplayer (`marketplace_not_connected`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "TCGplayer turned the request down (`tcgplayer_scan_identify_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "TCGplayer Scan & Identify isn't reachable (`tcgplayer_scan_identify_unavailable`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}/commit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "commitBuylistScanReview",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Commit a scan review to a draft offer",
        "description": "Merges the review's identified, non-excluded copies into one line per card and condition, prices them with the store's buylist rules, and adds them to a new draft offer (or to the draft named by `purchase_uuid`). Every line must be identified or excluded first. Send the review's version as `If-Match`; the body may be empty.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanReviewCommitRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The draft offer",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReviewCommitResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The review is being imported (`scan_review_importing`) or is no longer editable (`scan_review_not_editable`), or the target offer isn't a draft (`purchase_not_draft`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "The review changed since it was loaded (`scan_review_modified`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "Some lines aren't identified (`scan_review_unresolved_lines`), every line is excluded (`scan_review_nothing_to_buy`), the offer would be too long (`offer_line_limit_exceeded`), the target offer doesn't exist (`purchase_not_found`) or a value is invalid (`validation_error`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "428": {
            "description": "No `If-Match` was sent (`if_match_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/scan-reviews/{review_uuid}/discard": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "review_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "discardBuylistScanReview",
        "tags": [
          "Buylist Scan & Identify"
        ],
        "summary": "Discard a scan review",
        "description": "Marks a ready review discarded. Its batch is cleaned up on TCGplayer later.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The discarded review",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanReview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The review doesn't exist (`scan_review_not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "The review is being imported (`scan_review_importing`) or is no longer editable (`scan_review_not_editable`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/custom-domains": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistCustomDomains",
        "tags": [
          "Buylist Custom Domains"
        ],
        "summary": "List a store's custom domains",
        "description": "Returns the store's registered custom domains for its public buylist storefront, each with its Cloudflare provisioning + certificate status.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's custom domains",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/custom-domains/{domain_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "domain_uuid",
          "in": "path",
          "required": true,
          "description": "Custom domain identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getBuylistCustomDomain",
        "tags": [
          "Buylist Custom Domains"
        ],
        "summary": "Get a custom domain's status",
        "description": "Returns a single custom domain with its live Cloudflare provisioning + certificate status (refreshed on read) so the UI can poll validation progress. Also re-attaches `dns_instructions` from that same live refresh — it is never persisted, so this (not just the create response) is how the frontend recovers the CNAME/TXT records after a page reload, while `status` is still `pending_dns` or `pending_validation`.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The custom domain",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainProvisioned"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/config": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getStorefrontConfig",
        "tags": [
          "Buylist Storefront Config"
        ],
        "summary": "Get the storefront config",
        "description": "Returns the store's public buylist storefront configuration: branding, checkout options, payment methods, shipping regions, and publishing state. Returns defaults (unpublished row) if the store has not yet configured its storefront. Carries a version ETag for optimistic concurrency on a subsequent PATCH.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The storefront config",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorefrontConfig"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "patchStorefrontConfig",
        "tags": [
          "Buylist Storefront Config"
        ],
        "summary": "Update the storefront config",
        "description": "Partially updates the store's buylist storefront config. Only the fields present in the request body are modified. Setting `is_published: true` makes the storefront publicly visible at the store's public slug (edited via updateStore, not here). An optional If-Match ETag from a prior GET guards against two concurrent PATCHes to different fields silently clobbering each other (412 on mismatch); omitting it patches unconditionally as before.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchStorefrontConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated storefront config",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorefrontConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "description": "A value is invalid (`validation_error`, `storefront_not_publishable`), or the Scan & Identify batch name template isn't valid (`scan_batch_name_template_invalid`, with a `validation_errors` entry on the scan_batch_name_template field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/email-templates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistEmailTemplates",
        "tags": [
          "Buylist Email Templates"
        ],
        "summary": "List this store's customizable buylist emails",
        "description": "Every buylist email this service lets a store customize (only the offer/\"accepted\" email today), each with its platform default copy, its registered $VARIABLE merge variables, and the store's current override (if any). Generic machinery shared across every platform email — see PatchBuylistEmailTemplate for how an override is set.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's customizable email templates",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/email-templates/{template_key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "template_key",
          "in": "path",
          "required": true,
          "description": "The email being customized, e.g. `buylist_offer_accepted`. See listBuylistEmailTemplates for the full set this store may customize.\n",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getBuylistEmailTemplate",
        "tags": [
          "Buylist Email Templates"
        ],
        "summary": "Get one customizable buylist email template",
        "description": "One buylist email the store can customize, by `template_key`: HippoLink's default subject and body, the store's own `subject_template` and `body_template` (`null` where it uses the default), `is_customized`, whether the email is `enabled` for the store, and the merge variables the template may use. Reading it changes nothing. An unknown `template_key` is 404 `email_template_not_found`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "404": {
            "description": "No such email template (`email_template_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The email template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "patchBuylistEmailTemplate",
        "tags": [
          "Buylist Email Templates"
        ],
        "summary": "Customize (or clear) a buylist email's subject/body",
        "description": "Both fields are optional and independently nullable: an absent field leaves that half unchanged, and an explicit `null` (or empty string) clears it back to the platform default. A non-null value is a plain-text template that may reference the email's registered $VARIABLE merge variables (e.g. `$CUSTOMER_FIRST_NAME`) — an unknown variable or malformed `$` syntax is rejected 400. `body_template` paragraphs are separated by a blank line, same as the default copy it replaces; the surrounding branded layout (logo, summary panel, next-steps, CTA button, footer) is never customizable and always renders.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchEmailTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "404": {
            "description": "No such email template (`email_template_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "The template cannot be saved (`email_template_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Updated email template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/email-templates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listKioskEmailTemplates",
        "tags": [
          "Kiosk Email Templates"
        ],
        "summary": "List this store's customizable customer order emails",
        "description": "The customer-facing order emails a store may customize — order placed, ready for pickup, and canceled — each with its platform default copy, its registered $VARIABLE merge variables, and the store's current override (if any). Same shape and machinery as the buylist email templates; see PatchKioskEmailTemplate for how an override is set. Note the ready-for-pickup email is sent for any order marked ready, so customizing it applies to every marketplace, not only kiosk orders.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's customizable email templates",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/kiosk/email-templates/{template_key}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "template_key",
          "in": "path",
          "required": true,
          "description": "The email being customized, e.g. `order_placed`. See listKioskEmailTemplates for the full set this store may customize.\n",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getKioskEmailTemplate",
        "tags": [
          "Kiosk Email Templates"
        ],
        "summary": "Get one customizable customer order email template",
        "description": "One customer order email the store can customize, by `template_key`: HippoLink's default subject and body, the store's own `subject_template` and `body_template` (`null` where it uses the default), `is_customized`, whether the email is `enabled` for the store, and the merge variables the template may use. Reading it changes nothing. An unknown `template_key` is 404 `email_template_not_found`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The email template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "patchKioskEmailTemplate",
        "tags": [
          "Kiosk Email Templates"
        ],
        "summary": "Customize (or clear) a customer order email's subject/body",
        "description": "Both fields are optional and independently nullable: an absent field leaves that half unchanged, and an explicit `null` (or empty string) clears it back to the platform default. A non-null value is a plain-text template that may reference the email's registered $VARIABLE merge variables (e.g. `$CUSTOMER_FIRST_NAME`) — an unknown variable or malformed `$` syntax is rejected 400. `body_template` paragraphs are separated by a blank line and replace the email's intro; the branded layout (logo, order reference, total, pickup instructions, status link, footer) is never customizable and always renders.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `kiosk:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchEmailTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated email template",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistOffers",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Browse the cards this store buys, with per-condition prices.",
        "description": "The operator view of the store's own buy list, read from the materialized offer projection and grouped by product (+ finish) with each available condition's cash/credit price and the copies already on hand. Same query as the public storefront browse (`listPublicBuylistProducts`), so results and prices match what a customer sees, but scoped by `store_uuid` instead of a public slug: no published storefront is required. Supports game / set / rarity / finish / hotlist filters, a name search, sort, and pagination.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "game",
            "schema": {
              "type": "string"
            },
            "description": "Game key; defaults to the store's first enabled game."
          },
          {
            "in": "query",
            "name": "set",
            "schema": {
              "type": "string"
            },
            "description": "Filter by set code."
          },
          {
            "in": "query",
            "name": "rarity",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "color",
            "schema": {
              "type": "string"
            },
            "description": "Color identity (e.g. White/Blue/Black/Red/Green/Colorless)."
          },
          {
            "in": "query",
            "name": "finish",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "hotlist",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            },
            "description": "Card name search plus the inventory list's inline operator grammar (`set:`, `cn:`, `c:`, `r:`, `lang:`, `cond:`, `finish:`, `is:`, `usd`/`buylist_usd`, `game:`, `-` negation, `( a or b )` groups). Same grammar and differences as `listPublicBuylistProducts`'s `q`.\n"
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "enum": [
                "relevance",
                "name_asc",
                "name_desc",
                "price_desc",
                "price_asc"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The search took too long (`offer_search_timeout`). Add a filter and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Page of cards the store buys.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedStoreBuylistOfferList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/price-lists/buylist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistPriceList",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "The prices this store pays for cards, as a flat list.",
        "description": "Every card version the store pays for, one row per SKU in `tcgplayer_sku_id` order, with its cash and store-credit price in the store's `currency`. A card with neither a cash nor a credit price, or capped at a quantity of 0, is left out. Read from the same offer projection as the buylist browse, so prices match what a customer sees; the projection is rebuilt on the store's repricing hours, so a rule edit shows up at the next rebuild. Page forward with the opaque `after` cursor: omit it for the first page, then pass the previous response's `next_cursor` until `has_more` is false. `game` narrows the list to one game the store buys; an unknown or unbought game is 400 `query_param_invalid`. An API key reads it through its grant on this store, which must hold `price_lists` and whose price list options must share the buylist; otherwise it is 403 `api_key_price_list_not_shared`. Needs the store's Pro plan.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `price_lists:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "game",
            "schema": {
              "type": "string"
            },
            "description": "Game key to list; every game the store buys when omitted."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 250
            },
            "description": "Maximum rows to return (1-1000). More is 422."
          },
          {
            "$ref": "#/components/parameters/After"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the store's buy prices.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistPriceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "`after` is not a cursor this list issued (`cursor_invalid`), or `game` is not one the store buys (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "description": "The caller may not read this store's buylist. An API key whose grant on this store doesn't share the buylist gets `api_key_price_list_not_shared`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/price-lists/retail": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getRetailPriceList",
        "tags": [
          "Inventory"
        ],
        "summary": "What each connected marketplace is sent for this store's cards, as a flat list.",
        "description": "One row per in-stock card version the store prices, with what the caller may see of it. `base` is the store's own price for the card, in the store's currency, with the quantity a marketplace that lists the store's visible stock (TCGplayer, for one) is sent before its own caps: the copies visible in sellable bins, capped at the card's drip-listing target. `base` is left out when the card has no base price or a base price of 0, has no copies visible to list (all reserved, or a drip-listing target of 0), or the store tagged it do-not-sell. Each `marketplaces` entry holds the price, currency and quantity the marketplace push sends: an override, a currency conversion at the store's applied rate, a drip-listing target and the marketplace's own caps are all applied, and a card the push leaves off a marketplace (out of stock, unpriced, not listed there, not in a currency it takes, or not mapped to its catalog) has no entry for it. Only marketplaces the store has a working connection to are listed. An entry's quantity is the one the push sends to that marketplace, already net of the store's reserves and of orders HippoLink has ingested. `price_updated_at` is the last time HippoLink changed the card's base price; it dates the base price only, and is sent whenever shared, even when `marketplace=` leaves `base` out. An API key sees only what the price list options of its grant on this store share: `base` only with the base price, `marketplaces` only with at least one marketplace (and then only those), `quantity` and `price_updated_at` only when shared. A field the key doesn't share is absent, not null, and a card none of its sources lists has no row; cards still have to be in stock when quantity isn't shared. A signed-in user sees everything. Rows come in `tcgplayer_sku_id` order, and a page holds at most `limit` rows, fewer when some cards on it are listed nowhere, or none while `has_more` is still true. Send `Accept-Encoding: gzip` to get the body compressed. Page forward with the opaque `after` cursor: omit it for the first page, then pass the previous response's `next_cursor` until `has_more` is false. `marketplace` narrows the list to one marketplace, or to `BASE` for the base price alone (rows then carry no `marketplaces`), and `game` to one game; an unknown value for either is 400 `query_param_invalid`. An API key whose grant on this store doesn't share the retail list, or that names a `marketplace` (including `BASE`) the grant wasn't given, is 403 `api_key_price_list_not_shared`. Needs the store's Pro plan.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `price_lists:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "marketplace",
            "schema": {
              "type": "string",
              "enum": [
                "CARDMARKET",
                "CARD_NEXUS",
                "CARD_TRADER",
                "EBAY",
                "LIGHTSPEED",
                "MANA_POOL",
                "MISPRINT",
                "SHOPIFY",
                "SICK_DEALS",
                "SNAPCASTER",
                "SQUARE",
                "TCGPLAYER",
                "WHATNOT",
                "BASE"
              ]
            },
            "description": "Marketplace to list, or `BASE` for the store's own base price; every shared source when omitted."
          },
          {
            "in": "query",
            "name": "game",
            "schema": {
              "type": "string"
            },
            "description": "Game key to list; every game when omitted."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            },
            "description": "Maximum card versions (SKUs) to return (1-250), one row each. More is 422."
          },
          {
            "$ref": "#/components/parameters/After"
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the store's listed prices.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetailPriceListResponse"
                }
              }
            }
          },
          "400": {
            "description": "`after` is not a cursor this list issued (`cursor_invalid`), or `marketplace` or `game` is not one this list knows (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "description": "The caller may not read this store's retail list. An API key whose grant on this store doesn't share the retail list, or that names a `marketplace` the grant wasn't given (`BASE` included), gets `api_key_price_list_not_shared`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/facets": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getBuylistOfferFacets",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Browse facets: all sets + rarities the store buys.",
        "description": "Every set and rarity with cards on the store's buy list for a game, so the operator browse filters offer options beyond what the current page loaded. `sets[].code` round-trips as `listBuylistOffers`' `?set=` and `rarities[].value` as `?rarity=`. Same query and scope as the storefront's `getPublicBuylistFacets`. Cacheable (changes rarely).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "game",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Defaults to the store's first enabled game (matching the browse)."
          }
        ],
        "responses": {
          "422": {
            "description": "A search the page cannot use (`search_query_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The search took too long (`offer_search_timeout`). Add a filter and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Sets and rarities available for browsing.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistFacets"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/margins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistMarginWarnings",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Buylist offers priced too close to the store's own retail price.",
        "description": "The cards behind the `BUYLIST_MARGIN_THIN` store alert. That banner states how many buy prices sit within the store's configured margin of its sell prices; this lists which ones, worst margin first, with what it takes to act on each: the buylist rule that set the price, the copies already on hand, and whether the offer is price-locked. Same predicate as the banner, so the page and the count it came from can never disagree.\n\nOne row per SKU, not per card -- a margin belongs to a grade, since Near Mint sells for more than Heavily Played. `threshold_pct` defaults to the store's `min_buylist_margin_pct`, so the page opens on exactly the set the banner counted; pass one to widen or narrow the view without retuning the alert.\n\nA SKU the store holds zero copies of is excluded from the predicate itself, not merely shown with `quantity_on_hand: 0` -- there is nothing to act on until the store holds a copy, and the banner's count excludes it too. The set is recomputed when the buylist offers rebuild, so a copy sold or taken in since then is not reflected until the next rebuild.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "game",
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Restrict to one game. All games when omitted."
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            },
            "description": "Search in the buylist browse's grammar (`set:`, `cn:`, `r:`, `c:`, `lang:`, `cond:`, `is:`, `usd`/`buylist_usd` on the cash price, `game:`, negation, `( a or b )` groups). Operators with no meaning for a card being bought (`cogs:`, `tag:`, `bin:`, `qty:`, ...) are a 422. The rest is card-name text (diacritic-folded, so `Lorien` finds `Lórien`); words match independently and a quoted phrase is one word."
          },
          {
            "in": "query",
            "name": "threshold_pct",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 100
            },
            "description": "Margin percent to judge against. An offer trips when `cash > retail_price * (1 - threshold_pct/100)`. Defaults to the store's configured `min_buylist_margin_pct` (itself defaulting to 20).\n"
          },
          {
            "in": "query",
            "name": "include_locked",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "`false` hides price-locked offers (#1175). Default `true`: a locked thin margin is a deliberate choice worth reviewing, not one to hide.\n"
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string",
              "enum": [
                "margin_asc",
                "margin_desc",
                "cash_desc",
                "retail_desc"
              ],
              "default": "margin_asc"
            },
            "description": "`margin_asc` (default) is worst margin first."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The search took too long (`offer_search_timeout`). Add a filter and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Page of thin-margin buylist offers.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistMarginWarningList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/rebuild/history": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listBuylistOfferRebuildHistory",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "List past buylist offer-rebuild runs",
        "description": "The buy-side twin of `reprice/history`: one entry per rebuild of the store's buylist offer projection, newest first, with what triggered it, whether it finished, how long it took, and how many offers it wrote. A rebuild is what makes a rule edit or a platform-price move visible to customers, so this is where \"have my buy prices updated yet?\" is answered.\n\nNote `skipped` is not a failure — a concurrent rebuild already held the store's lock, so that attempt did no work and the winning run's entry is the one that says what landed. `product_refresh` entries are the cheap one-card hotlist path and heavily outnumber whole-catalog `rebuild` entries on a store curating its hotlist; filter by `job_type` rather than paging past them.\n\nA whole-store rebuild is several entries: one `rebuild`, which plans the work and finishes in milliseconds, plus the `rebuild_game` entries it enqueued — one per game, each with its own duration and offer count. Those start together and finish far apart, which is the point of the split.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Defaults to 20.",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 250
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by run status.",
            "schema": {
              "$ref": "#/components/schemas/BuylistOfferRebuildStatus"
            }
          },
          {
            "name": "job_type",
            "in": "query",
            "description": "Filter to whole-catalog rebuilds or one-card refreshes.",
            "schema": {
              "$ref": "#/components/schemas/BuylistOfferRebuildJobType"
            }
          },
          {
            "name": "trigger_source",
            "in": "query",
            "description": "Filter to runs started by one kind of trigger.",
            "schema": {
              "$ref": "#/components/schemas/BuylistOfferRebuildTrigger"
            }
          },
          {
            "name": "created_after",
            "in": "query",
            "description": "Only runs started at or after this timestamp (inclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_before",
            "in": "query",
            "description": "Only runs started before this timestamp (exclusive).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated offer-rebuild run history",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBuylistOfferRebuildHistoryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/skus/{tcgplayer_sku_id}/explain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "get": {
        "operationId": "explainBuylistOfferSku",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Explain the buylist price for one SKU",
        "description": "Answers \"why does this store pay this much for this card?\" for a single SKU — one grade of one printing.\n\nRe-runs the store's entire buylist rule set against the SKU right now, through the same compiled predicates and price expressions the quote and the offer projection use, but without the first-match short-circuit. The response therefore reports every rule's own verdict (matched / shadowed by an earlier match / did not match / undecidable because a price or date it compares has no value for this SKU yet / disabled / other game), the value of every variable those rules read for this SKU, and the stored `store_buylist_offer` row the storefront is actually showing — with any disagreement between the two named in `divergence`. A catalog attribute the catalog has no value for — rarity on sealed product or a token — is decided, not undecidable.\n\nRead-only: nothing is rebuilt, priced, or cached.\n\nOpen to owner/manager (#1010): the same attribution answers an operator's \"why do we pay this?\", and `live.decision` is what lets a client distinguish a grade a DECLINE rule refuses from one no rule matched — two states the storefront renders identically but which have different fixes.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "quantity",
            "in": "query",
            "description": "The seller's ask, in copies. Comes back per SKU as `live.accepted_quantity` — how many of them a matched rule's `MAX_STOCK` cap still leaves room for. Defaults to 1.\n",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "422": {
            "description": "`quantity` out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Buylist price attribution for the SKU",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistOfferExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/products/{tcgplayer_product_id}/explain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "get": {
        "operationId": "explainBuylistOfferProduct",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Explain the buylist price for every grade of one card",
        "description": "The product-wide form of `explainBuylistOfferSku`: same attribution, run over every SKU of the printing rather than one. Use it when the question is \"why is my Near Mint copy worth less than I expected\" — the grades sit side by side, each with the rule it matched and the condition its price actually resolved off.\n\nRead-only. Open to owner/manager (#1010) — it is the per-product read behind the inventory page's Buylist Prices tab, which lists every grade with the rule that priced it, and marks the ones no rule prices.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "quantity",
            "in": "query",
            "description": "The seller's ask, in copies. Comes back per SKU as `live.accepted_quantity` — how many of them a matched rule's `MAX_STOCK` cap still leaves room for. Defaults to 1.\n",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "422": {
            "description": "`quantity` out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Buylist price attribution for every SKU of the product",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistOfferExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/skus/{tcgplayer_sku_id}/price": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "put": {
        "operationId": "setBuylistOfferPrice",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Set a SKU's buylist offer price by hand.",
        "description": "Writes an operator-chosen buy price for one card and locks it, so the rebuild preserves it instead of recomputing it from the rules (#1913). The per-card remedy for a bad price: `price-lock` alone freezes whatever the rule computed, which cannot fix a card the rule priced wrong, and editing the rule reprices every card it matches.\n\nIdempotent, unlike `createBuylistOfferLock` -- re-pricing an already-locked offer is how a typo gets corrected, so it is a 200 rather than a 409. An unlocked offer is locked as a side effect; `removeBuylistOfferLock` is the single way back to rule pricing from either freeze.\n\nCreates the offer when the store has none for the SKU (#1010), which is how a grade the rules decline -- explicitly, or by matching nothing -- gets a price without rewriting the ruleset. The created row is locked like any other write here, and the rebuild deletes only unlocked rows, so it survives even though no rule produces it.\n\nCreating is restricted to owner/manager, while repricing stays open to employees: adjusting a price the rules produced is a pricing chore, but pricing a grade they decline contradicts a rule someone wrote. An employee attempting to create one gets a 403.\n\n404 now means the SKU is not in the catalog at all -- an offer denormalizes that row's product, game, condition and finish, so there is nothing to price for a SKU `global_identifiers` does not know.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuylistOfferPriceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Price written and locked.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistOfferPrice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/skus/{tcgplayer_sku_id}/price-lock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerSkuId"
        }
      ],
      "post": {
        "operationId": "createBuylistOfferLock",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Lock a SKU's buylist offer against the rebuild.",
        "description": "Freezes the store_buylist_offer row's current cash/credit (#1175) so the rebuild (rebuildBuylistOffers, the hourly sweep, and the hotlist-toggle trigger behind it) preserves the row instead of recomputing it. Not idempotent: re-locking an already-locked row is a 409 rather than a silent success, so the caller can tell a lock it created from one that was already there. Use the product-level variant for the idempotent bulk case.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Lock created.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "removeBuylistOfferLock",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Remove a SKU's buylist offer lock.",
        "description": "Unfreezes the offer and enqueues an immediate rebuild so the SKU returns to rule pricing promptly. Returns 204 on success, 404 if the SKU has no offer row, and 409 if it is not currently locked.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Lock removed.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/offers/products/{tcgplayer_product_id}/price-lock": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/TcgplayerProductId"
        }
      ],
      "post": {
        "operationId": "lockBuylistOfferProduct",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Lock every buylist offer of a product against the rebuild.",
        "description": "Bulk-locks the store_buylist_offer rows for all of the store's offered SKUs of the product — every condition of that printing — so the rebuild preserves them. Idempotent: re-locking already-locked rows is not an error.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Offers locked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "locked"
                  ],
                  "properties": {
                    "locked": {
                      "type": "integer",
                      "description": "Number of the store's buylist offers of this product (locked or not)."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "unlockBuylistOfferProduct",
        "tags": [
          "Buylist Rules"
        ],
        "summary": "Remove the buylist offer lock from every SKU of a product.",
        "description": "Bulk-unlocks all of the store's buylist offers of the product and enqueues an immediate rebuild. Idempotent: unlocking offers that are not locked is not an error.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Offers unlocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "unlocked"
                  ],
                  "properties": {
                    "unlocked": {
                      "type": "integer",
                      "description": "Number of offers of this product that were unlocked by this call."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "423": {
            "$ref": "#/components/responses/BuylistUpdating"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/buylist/pickup-locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listPickupLocations",
        "tags": [
          "Buylist Pickup Locations"
        ],
        "summary": "List a store's pickup (drop-off) locations",
        "description": "Returns all pickup locations for the store regardless of `is_active` status, allowing the operator to manage them. The public storefront only shows active locations.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `buylist:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's pickup locations",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickupLocationList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "createPickupLocation",
        "tags": [
          "Buylist Pickup Locations"
        ],
        "summary": "Add a pickup location",
        "description": "Creates a new drop-off location for the public buylist storefront checkout. Immediately visible to customers once the storefront is published.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `buylist:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePickupLocationRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A value in the request was refused (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Pickup location created",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickupLocation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/buylist/pickup-locations/{location_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "location_uuid",
          "in": "path",
          "required": true,
          "description": "Pickup location identifier.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "patch": {
        "operationId": "patchPickupLocation",
        "tags": [
          "Buylist Pickup Locations"
        ],
        "summary": "Update a pickup location",
        "description": "Partially updates a pickup location. Only supplied fields are modified. Set `is_active: false` to hide the location from the public checkout without deleting it.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPickupLocationRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A value in the request was refused (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Updated pickup location",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickupLocation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deletePickupLocation",
        "tags": [
          "Buylist Pickup Locations"
        ],
        "summary": "Delete a pickup location",
        "description": "Permanently removes a pickup location. To temporarily hide it instead, use PATCH with `is_active: false`.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `buylist:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Pickup location deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/buylist/parse": {
      "post": {
        "operationId": "buylistDslParse",
        "tags": [
          "Buylist DSL"
        ],
        "summary": "Parse a buylist DSL rule string into an AST",
        "description": "Tokenizes and parses a single buylist DSL rule string, returning the structured AST on success or a parse error on failure. Stateless -- no store context required.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DslParseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully parsed. A single-string request returns the AST directly; an array request returns a `DslBatchParseResult` with one entry per rule (partial success on individual parse failures).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DslRuleAst"
                    },
                    {
                      "$ref": "#/components/schemas/DslBatchParseResult"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                      "rule": "#/components/schemas/DslRuleAst",
                      "batch_result": "#/components/schemas/DslBatchParseResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/buylist/dsl": {
      "get": {
        "operationId": "buylistDslListVariables",
        "tags": [
          "Buylist DSL"
        ],
        "summary": "List all supported buylist DSL variables and operators",
        "description": "Returns every supported variable name, attribute, operator, and buylist-specific keyword recognized by the buylist DSL parser. Useful for building UI autocomplete or validation on the client side. Stateless -- no store context required. `finish_values` and `rarity_values` are game-specific and follow the `game` query parameter (default `magic`). `condition_values` follows the `region` query parameter (default `usa`): `eu` returns the Cardmarket/MKM grades an EU seller writes rules in, plus `Unopened`, which an EU store's rule write translates to the stored US conditions at parse time (#1152). All other fields are game/region-agnostic, and the stored vocabulary is always the US six.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** any key with a store grant.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Which game's finish/rarity vocabulary to return. Defaults to `magic` when omitted.\n"
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Region"
            },
            "description": "Which seller-facing condition vocabulary `condition_values` should return (#1150/#1151/#1152). `usa` (the default) returns the stored US conditions; `eu` returns the Cardmarket/MKM grades plus `Unopened` (sealed product has no Cardmarket grade), which this region's stores may write rules in.\n"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter that is malformed or not one of its allowed values (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "All supported buylist DSL variables and operators",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuylistDslVariables"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "head": {
        "operationId": "countOrders",
        "tags": [
          "Orders"
        ],
        "summary": "Count orders matching filters",
        "description": "Returns no response body. The total count of matching orders is returned in the `X-Total-Count` response header. Error status codes are signalled via HTTP status only — HEAD responses carry no body.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MarketplaceFilter"
          },
          {
            "$ref": "#/components/parameters/OrderStatusFilter"
          },
          {
            "$ref": "#/components/parameters/OrderedAfter"
          },
          {
            "$ref": "#/components/parameters/OrderedBefore"
          },
          {
            "$ref": "#/components/parameters/OrderSearch"
          },
          {
            "$ref": "#/components/parameters/ProblematicFilter"
          },
          {
            "$ref": "#/components/parameters/ResolvedFilter"
          },
          {
            "$ref": "#/components/parameters/ResolvedAfter"
          },
          {
            "$ref": "#/components/parameters/ResolvedBefore"
          },
          {
            "$ref": "#/components/parameters/ResolutionFilter"
          },
          {
            "$ref": "#/components/parameters/HeldFilter"
          },
          {
            "$ref": "#/components/parameters/KioskFlaggedFilter"
          },
          {
            "$ref": "#/components/parameters/ReadyForPickupFilter"
          },
          {
            "$ref": "#/components/parameters/FulfillmentMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ShippingMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ExpectedShippingClassFilter"
          },
          {
            "$ref": "#/components/parameters/OrderGameFilter"
          },
          {
            "$ref": "#/components/parameters/OrderConditionFilter"
          },
          {
            "$ref": "#/components/parameters/OrderFinishFilter"
          },
          {
            "$ref": "#/components/parameters/OrderLanguageFilter"
          },
          {
            "$ref": "#/components/parameters/ProductTypeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderSetCodeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMin"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMax"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMin"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMax"
          },
          {
            "$ref": "#/components/parameters/OrderUpdatedAfter"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A `total_*` / `item_count_*` bound was negative or its min above its max (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Count returned in headers",
            "headers": {
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Number of matching orders"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "get": {
        "operationId": "listOrders",
        "tags": [
          "Orders"
        ],
        "summary": "List orders with filtering, search, and sorting",
        "description": "Returns a paginated list of orders from all connected marketplaces. Filterable by marketplace, status, date range, and free-text search (order ID, buyer name, product names).\n\nCardTrader Zero's weekly consolidated invoice is never included (and is not counted in `total`). It is a batch rather than a sale — its cards were already reserved and costed when they sold individually as `cardtrader_zero` orders — and it is read and fulfilled through `listCardTraderZeroInvoices` on its own tab. This is why `OrderStatus` has no `cardtrader_zero_invoice` member.\n\nTo sync orders, send `updated_after` (and nothing for `offset`, `sort_by` or `sort_dir`), then pass each page's `next_cursor` back as `after`, keeping `updated_after` and the other filters, until `has_more` is false. Keep the last `next_cursor` and send it as `after` on your next poll to read only what changed since. The pages run by `updated_at` ascending, ties broken by `order_uuid`, so an order changed during the walk moves to the end and is returned again with its new `updated_at`. A change appears only once it is 60 seconds old, so it can take up to a minute to show up; in exchange a change that takes less than that to save is never skipped, and a poll needs no overlap. `total` is the count when the walk started (its first page) and does not change during the walk. `updated_at` moves on every change to the order record itself (status, notes, tracking, holds, resolution, address). It does not move for a change only to the order's line items, shipment or refund records, its CardChaos picking state or its predicted shipping class, nor when a hold date passes; read those with `getOrder`. Offset paging is unchanged when neither `updated_after` nor `after` is sent.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/MarketplaceFilter"
          },
          {
            "$ref": "#/components/parameters/OrderStatusFilter"
          },
          {
            "$ref": "#/components/parameters/OrderedAfter"
          },
          {
            "$ref": "#/components/parameters/OrderedBefore"
          },
          {
            "$ref": "#/components/parameters/OrderSearch"
          },
          {
            "$ref": "#/components/parameters/ProblematicFilter"
          },
          {
            "$ref": "#/components/parameters/ResolvedFilter"
          },
          {
            "$ref": "#/components/parameters/ResolvedAfter"
          },
          {
            "$ref": "#/components/parameters/ResolvedBefore"
          },
          {
            "$ref": "#/components/parameters/ResolutionFilter"
          },
          {
            "$ref": "#/components/parameters/HeldFilter"
          },
          {
            "$ref": "#/components/parameters/KioskFlaggedFilter"
          },
          {
            "$ref": "#/components/parameters/ReadyForPickupFilter"
          },
          {
            "$ref": "#/components/parameters/FulfillmentMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ShippingMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ExpectedShippingClassFilter"
          },
          {
            "$ref": "#/components/parameters/OrderGameFilter"
          },
          {
            "$ref": "#/components/parameters/OrderConditionFilter"
          },
          {
            "$ref": "#/components/parameters/OrderFinishFilter"
          },
          {
            "$ref": "#/components/parameters/OrderLanguageFilter"
          },
          {
            "$ref": "#/components/parameters/ProductTypeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderSetCodeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMin"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMax"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMin"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMax"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/OrderSortBy"
          },
          {
            "$ref": "#/components/parameters/SortDir"
          },
          {
            "$ref": "#/components/parameters/OrderUpdatedAfter"
          },
          {
            "$ref": "#/components/parameters/OrderCursor"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter), including an `updated_after` that is not a timestamp with a time zone. `cursor_invalid`: the `after` page marker is not one this list issued.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`). `cursor_param_conflict`: `offset`, a `sort_by` other than `updated_at`, or a `sort_dir` other than `asc` was sent with `updated_after` or `after`; `validation_errors` names the parameter.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated order list",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedOrderList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "bulkUpdateOrderStatus",
        "tags": [
          "Orders"
        ],
        "summary": "Bulk update order status (max 100)",
        "description": "Advances up to 100 orders to the same target status. Validates status transitions for each order individually. Returns per-item results with successes and failures. A held order (hold_until in the future, not overridden) fails its shipped transition (a per-item failure) until the date passes or the hold is overridden via .../hold-override. An order shipped untracked because of `override_tracking_required` has the reason recorded in its history row (`override_tracking_required: <reason>`); see `warnings` on its `updated` entry. Likewise an order CardChaos is picking (a line queued or on a CardChaos picklist, including after picking is turned off until CardChaos accepts the recall) fails its shipped transition per item; the rest of the batch still applies.\nCanceling an unshipped Mana Pool order first reports its cards to Mana Pool, one order at a time, as the single-order PATCH does. A refusal comes back as that order's `failed` entry with Mana Pool's code (`marketplace_report_conflict`, `manapool_cancel_report_open`, `marketplace_report_rejected`, `marketplace_unavailable`) and the order is not canceled; the rest of the batch continues. If the request runs out of time first, the remaining Mana Pool orders fail with `manapool_cancel_not_attempted` and nothing is sent for them; cancel them again. Cards Mana Pool can't take are named in `manapool_unreported` on that order's `updated` entry.\nAn API key also needs `refunds: write` on the store when the batch cancels an order whose marketplace refunds the buyer on a cancel (Mana Pool, Snapcaster, eBay, CardTrader, CardNexus); without it the whole request is refused with 403 `api_key_scope_insufficient` and no order changes.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids",
                  "status"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "status": {
                    "$ref": "#/components/schemas/OrderStatus"
                  },
                  "override_tracking_required": {
                    "type": "boolean",
                    "default": false,
                    "description": "Applies to every order in this batch: mark shipped without tracking an order that requires it — TCGplayer at $50 and above, a ManaPool order whose buyer bought a tracked tier (#2238), or a Snapcaster order on a tracked shipping option. Same semantics and authorization as the single-order override. On TCGplayer and Snapcaster the local status still flips while the outbound sync fails, since the marketplace rejects the untracked ship. **On ManaPool it does not fail anywhere**: ManaPool accepts the untracked fulfillment, so overriding genuinely ships the order untracked. Not needed where nothing requires tracking, and does not bypass the hold or substitution-ack gates.\n"
                  },
                  "restock": {
                    "type": "boolean",
                    "default": true,
                    "description": "Applies to every order in this batch, and only accepted when status is `canceled` (400 otherwise). **False permanently reduces the store's on-hand count** for every order in the batch: the copies are not returned to the sellable pool and the physical count is written down for what each order's shelf still owes. Same semantics, and the same must-be-a-real-boolean rule, as the single-order `restock`.\n"
                  },
                  "cancel_reason": {
                    "type": "string",
                    "enum": [
                      "buyer_requested",
                      "address_issue",
                      "out_of_stock"
                    ],
                    "description": "Applies to every order in this batch. Required alongside status: canceled for any EBAY order in the batch — same semantics as the single-order `cancel_reason`, never guessed. Ignored for every other marketplace in the batch, so a mixed-marketplace cancel batch is fine.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Bulk update results",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "updated",
                    "failed"
                  ],
                  "properties": {
                    "updated": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "order_uuid",
                          "status"
                        ],
                        "properties": {
                          "order_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "$ref": "#/components/schemas/OrderStatus"
                          },
                          "manapool_unreported": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Mana Pool cancel only: the cards that could not be sent to Mana Pool. Ask Mana Pool support to refund them. Absent otherwise."
                          },
                          "warnings": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/Warning"
                            },
                            "description": "`tcgplayer_tracking_required_override` when the batch's `override_tracking_required` shipped this TCGplayer order without tracking that TCGplayer requires. A cancel on a marketplace HippoLink cannot cancel on carries one `marketplace_update_manual` warning; the order's `marketplace_sync_status` is `manual`. Absent otherwise."
                          }
                        }
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "order_uuid",
                          "error"
                        ],
                        "properties": {
                          "order_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "error": {
                            "type": "string",
                            "description": "Reason the status transition failed. For an order CardChaos is picking: \"This order is being picked in CardChaos. Pick it there, or use Pick in HippoLink instead first.\"\n"
                          },
                          "code": {
                            "type": "string",
                            "enum": [
                              "at_cardchaos"
                            ],
                            "description": "Machine-readable failure kind. Present only for `at_cardchaos`; other failures carry only `error`.\n"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Get full order details",
        "description": "Returns a full order: line items, status history, marketplace metadata, and COGS. Includes an ETag for optimistic concurrency on subsequent updates.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Order details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Update order status or notes",
        "description": "Validates status transitions: unfulfilled → processing → shipped. Canceled can be reached from unfulfilled or processing. Uses If-Match / ETag for optimistic concurrency control. A held order (hold_until in the future, not overridden) is rejected with 409 on a transition to shipped until the date passes or the hold is overridden via .../hold-override. An order that requires tracking is rejected with 409 (`tracking_required`) on a transition to shipped with no tracking_number — either already stored or supplied in this same request alongside status: this is how a seller who shipped outside HippoLink's label flow can manually enter real tracking and ship in one call. Three rules decide that. TCGplayer requires tracking at $50 and above; below it an untracked ship is the ordinary case and syncs normally, since TCGplayer does not accept USPS first-class letter tracking and a plain-white-envelope order is marked shipped with none. ManaPool instead keys on the tier the buyer bought (#2238): anything but their `first_class` letter rate was sold to the buyer as tracked, at any order value. Snapcaster says outright whether the buyer's shipping option was tracked (the order's `is_tracked`): a tracked one needs tracking at any order value, and one not yet known does not. A tracked Snapcaster order that has a tracking number but no carrier (`tracking_company`, in this request or already stored) is refused with 409 `tracking_company_required`, since Snapcaster rejects the ship without one. The gate can be bypassed by setting override_tracking_required: true, for a seller who wants to mark an over-threshold order shipped without tracking (e.g. it isn't known yet). On TCGplayer the local status still flips but the outbound sync fails, since TCGplayer rejects an untracked ship at that value — surfaced as marketplace_sync_status: failed like any other sync failure. On ManaPool it does not fail anywhere: ManaPool accepts the untracked fulfillment, so overriding genuinely ships the order untracked. On Snapcaster the local status flips and the outbound sync fails with `TRACKING_NUMBER_REQUIRED` or `TRACKING_COMPANY_REQUIRED`, leaving the order unshipped there. A ship also records shipping_class (tracked vs untracked), derived from the effective tracking number unless the request states it explicitly. That field is a fact about the shipment and is independent of override_tracking_required, which is a permission. A transition to shipped is refused with 409 `at_cardchaos` while CardChaos is picking the order (a hand-made ship records no bin pulls); other edits, including cancel, are not.\n\nSending `tracking_number` and/or `tracking_company` (no `status`) on an already-shipped order corrects hand-entered tracking. Mana Pool is sent the new number; other marketplaces treat a second ship as done, so the correction stays in HippoLink only. Tracking that came from a label bought in HippoLink is refused with 409 `order_tracking_label_managed` (void the label and buy a new one).\n\nCanceling an unshipped Mana Pool order first reports every card still on it to Mana Pool (as `POST .../marketplace-reports` would, with `return_to_stock` taken from `restock`), and cancels it in HippoLink only once Mana Pool accepts. Mana Pool refunds those cards to the buyer, and the report records an issued refund for them. A refusal changes nothing: 409 `marketplace_report_conflict` (Mana Pool already has an open report), 409 `manapool_cancel_report_open` (the same, after an earlier HippoLink report on this order that Mana Pool accepted: Mana Pool takes one open seller report per shipment, so ask Mana Pool support to refund the rest, or cancel again once that report has settled), 422 `marketplace_report_rejected` (Mana Pool refused it), 502 `marketplace_unavailable` (Mana Pool failed or did not answer), 409 `report_in_progress` (another report is being sent), or 412 `marketplace_not_connected`. If-Match is checked before Mana Pool is called. Cards Mana Pool can't take through its API are not sent; the order is still canceled, and the response names them in `manapool_unreported` (also written to the order history) so the store asks Mana Pool support to refund them. Only `status` and `restock` act on Mana Pool; no `marketplace_cancellation` hint is returned for it. A `MISPRINT` order can't be canceled through Misprint's API: a cancel answers 422 `misprint_cancel_unsupported` until Misprint's own refunds (recorded from its webhook) reach the order total, so cancel it on Misprint first. A `shipped` PATCH needs a tracking number (`tracking_required`, unless `override_tracking_required`), and it, or a corrected number, is sent to Misprint; a USPS Intelligent Mail barcode (letter mail) is not sent, and the sync is marked failed. Canceling a `SNAPCASTER` order cancels the whole order on Snapcaster first, and only then in HippoLink (Snapcaster refunds the buyer and restores its own listing). A refusal changes nothing: 409 `snapcaster_cancel_after_shipment` (it has shipped there; refund it instead), 409 `snapcaster_reconnect_required`, 409 `snapcaster_subscription_excludes_orders`, 422 `snapcaster_request_rejected`, or 503 `snapcaster_unavailable` (no answer; sending the cancel again can't cancel twice). If-Match is checked before Snapcaster is called. No `marketplace_cancellation` hint is returned for it. An API key also needs `refunds: write` on the store to cancel an order whose marketplace refunds the buyer on a cancel (Mana Pool, Snapcaster, eBay, CardTrader, CardNexus), or the request is refused with 403 `api_key_scope_insufficient` before anything changes.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "status": {
                    "$ref": "#/components/schemas/OrderStatus"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Free-form notes about the order"
                  },
                  "expected_notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The notes the client loaded (null if none), only accepted alongside `notes` (400 otherwise). A mismatch with the stored notes returns 412 and writes nothing, unless the order already holds the requested notes (a retried save). Prefer this over If-Match for notes: the order ETag moves on every marketplace sync and fulfillment write (#3278).\n"
                  },
                  "tracking_number": {
                    "type": "string",
                    "description": "Shipment tracking number"
                  },
                  "tracking_company": {
                    "type": "string",
                    "description": "Shipping carrier name (e.g. USPS, UPS, FedEx)"
                  },
                  "override_tracking_required": {
                    "type": "boolean",
                    "description": "Mark shipped without tracking an order over its marketplace's tracking rule (TCGplayer at $50 and above; ManaPool on a tracked tier; Snapcaster on a tracked shipping option). On TCGplayer and Snapcaster the local status still flips while the outbound sync fails, since the marketplace rejects the untracked ship. **On ManaPool it does not fail anywhere**: ManaPool accepts the untracked fulfillment, so overriding genuinely ships the order untracked. Not needed where nothing requires tracking, where an untracked ship is accepted normally.\n"
                  },
                  "restock": {
                    "type": "boolean",
                    "default": true,
                    "description": "Whether cancelling returns the ordered copies to stock. **False permanently reduces the store's on-hand count** — it does not merely skip the restock. Use it for an oversell, where the cards were never on the shelf: restocking those would relist stock that oversells again. False makes the sale's inventory effects permanent instead of undoing them. The physical on-hand count (total_quantity) is written DOWN for whatever this order's shelf still owes, so the phantom copy is removed rather than left to be found at the next count; COGS is left allocated; and the sellable count stays where the sale left it. A line a completed pick run already pulled is skipped, since that pull already did the write-down. The write-down is recorded in the inventory ledger as shrinkage_miscount, valued at the line's cost basis so it appears in the shrinkage report, and does not raise the usual oversell alert. True (the default) is the ordinary cancel: reverse COGS, restock anything a pick run already pulled, and put the copies back in the sellable pool. Must be a real boolean — a string or number is rejected with 400, since either misreading of this field silently moves stock the wrong way. Only accepted alongside status: canceled — sending it on any other update is rejected with 400. The cancel is recorded on the order timeline as \"canceled without restocking inventory\".\n"
                  },
                  "notify_customer": {
                    "type": "boolean",
                    "default": false,
                    "description": "Email the buyer that their order was canceled. Only accepted alongside status: canceled — sending it on any other update is rejected with 400 — and must be a real boolean, like restock. An email is only actually sent for a kiosk order (marketplace KIOSK): every other marketplace owns the buyer relationship and has no cancellation template here, so the flag is a silent no-op there rather than an error. The send is best-effort and happens after the cancel commits, so a mail failure never fails the cancel.\n"
                  },
                  "kiosk_flag_snooze": {
                    "type": "boolean",
                    "default": false,
                    "description": "Defer a kiosk stale-order flag the store has already looked at, instead of acting on it. Sets kiosk_flag_snoozed_until to the store's configured stale-flag window from now and clears kiosk_flagged_at; the daily sweep re-flags the order a window after the snooze expires. A standalone action: it cannot be combined with a status change (400), and it is rejected with 400 for a non-kiosk order or for a store with no kiosk stale-flag window configured — neither has a flag to defer. Must be a real boolean.\n"
                  },
                  "cancel_reason": {
                    "type": "string",
                    "enum": [
                      "buyer_requested",
                      "address_issue",
                      "out_of_stock"
                    ],
                    "description": "Required alongside status: canceled for an EBAY order — eBay's own cancel API needs a reason and HippoLink never guesses one. Ignored for every other marketplace. A canceled EBAY order with no (or an unrecognized) reason still cancels locally, but the outbound eBay sync fails permanently rather than defaulting to a reason nobody confirmed; resend the same PATCH with a valid reason to retry. eBay auto-refunds the buyer on a successful paid cancellation — HippoLink never issues a second refund for it, and records the local refund as pending until that confirms.\n"
                  },
                  "cancel_note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500,
                    "description": "Optional message for the buyer when canceling a direct CardTrader order (marketplace CARD_TRADER). HippoLink sends CardTrader's cancellation request with a fixed explanation and appends this note to it. Only accepted alongside status: canceled (400 otherwise); ignored for every other marketplace. Longer than 500 characters is a 422.\n"
                  },
                  "fulfillment_method": {
                    "type": "string",
                    "enum": [
                      "ship",
                      "pickup",
                      "in_store"
                    ],
                    "description": "Manually override the buyer's fulfillment method. Accepts a value only; clearing an order back to null/unknown is not supported.\n"
                  },
                  "expected_fulfillment_method": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "ship",
                      "pickup",
                      "in_store",
                      null
                    ],
                    "description": "The fulfillment method the client loaded, only accepted alongside `fulfillment_method`. Same 412 and retry rules as `expected_notes`.\n"
                  },
                  "shipping_class": {
                    "type": "string",
                    "enum": [
                      "tracked",
                      "untracked"
                    ],
                    "description": "Record how the order shipped. Set alongside status: shipped, or on an already-shipped order to correct it; rejected with 400 on an order that is neither. Omitted, the server derives it from the effective tracking number (a pickup or in_store order records null — nothing was mailed). Independent of override_tracking_required: this states a fact, that one bypasses the tracking gate, so an over-threshold TCGplayer order shipping untracked needs both.\n"
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "alternate_copy_fulfilled",
                      "partially_fulfilled",
                      "unable_to_fulfill",
                      "reopened",
                      "flagged_in_error"
                    ],
                    "description": "Set when an operator resolves a problematic order. Server enforces that resolution, resolved_by, resolved_at are set atomically. alternate_copy_fulfilled means a substitute covered every line, partially_fulfilled that some of the order went out and some did not, unable_to_fulfill that none of it could be. flagged_in_error records that the flag itself was wrong rather than an outcome the operator produced -- the order needed nothing done to it. is_problematic stays true for all of them; it is never cleared. **No resolution changes the order's status** (#2334, replacing #2159's automatic canceled/shipped): recording one states what happened and nothing more, and the operator sends their own status: shipped or status: canceled -- in this request or a later one -- when they have decided how the order ends. reopened is different in kind: it clears resolution/resolution_notes/ resolved_by/resolved_at instead of being stored as one (is_problematic is untouched, so this alone is what returns the order to the needs-attention view) and is never a value read back on OrderDetail/OrderSummary.resolution.\n"
                  },
                  "resolution_notes": {
                    "type": "string",
                    "description": "Operator notes on how the problem was resolved."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict: a held order (`order_held`), an unacknowledged substitution, missing tracking (`tracking_required`), or `at_cardchaos` when the order has a line queued or on a CardChaos picklist (also after picking is turned off, until CardChaos accepts the recall): pick it in CardChaos, or recall it first with Pick in HippoLink instead (`POST .../orders/{order_uuid}/cardchaos-recall`). On a Mana Pool cancel, also `marketplace_report_conflict` (with the failed `report`) or `report_in_progress`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "order_uuids": {
                          "type": "array",
                          "description": "The order, present with `error` `at_cardchaos`.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "`marketplace_unavailable`: canceling a Mana Pool order, Mana Pool failed or did not answer. Nothing changed; cancel again.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/substitution-ack": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "acknowledgeSubstitution",
        "tags": [
          "Orders"
        ],
        "summary": "Acknowledge an order's auto-substitution",
        "description": "Clears the blocking substitution-acknowledge gate on an order whose exact SKU was exhausted and auto-substituted to a lower condition by the reallocation engine (#884). Until acknowledged, the order cannot be marked shipped (409 on any ship/label-purchase attempt). Idempotent — a repeat call leaves the original acknowledgement timestamp and actor untouched. It is a seller decision, so only owners and managers may call it.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Substitution acknowledged; the gate is cleared.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/hold-override": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "overrideOrderHold",
        "tags": [
          "Orders"
        ],
        "summary": "Override an order's presale hold",
        "description": "Marks the order's presale hold as overridden so it can be marked shipped before its hold_until date (#1157). Until the date passes or the hold is overridden, a held order cannot be marked shipped (409 on any ship attempt). Idempotent: a repeat call, or a call on an order that is not held, succeeds and returns the current state, and only the first override records the timestamp, the acting user, and an order history row. It is a seller decision, so only owners and managers may call it.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Hold overridden; the order may be shipped before hold_until.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/cardchaos-recall": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "recallOrderFromCardChaos",
        "tags": [
          "Orders"
        ],
        "summary": "Pick an order in HippoLink instead of CardChaos",
        "description": "For a store that picks with CardChaos: takes an order's queued lines back out of CardChaos's pick queue so a HippoLink run can pick it. Asynchronous. The request is queued and sent within about a minute; the order's `cardchaos.recall_pending` is true until CardChaos confirms, after which its `cardchaos.state` is `recalled` and it appears among the orders available to pick. 409 `on_picklist` while any line is on a CardChaos picklist (delete that picklist in CardChaos first); 409 `not_at_cardchaos` when nothing of the order is queued there.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Recall queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosRecallAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`on_picklist` or `not_at_cardchaos`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/cardchaos-release": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "releaseCardChaosOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Release an order stuck at CardChaos back to HippoLink",
        "description": "The escape for an order CardChaos cannot give back (CardChaos is gone, its key was revoked, or a picklist was lost). Without waiting for CardChaos, the order's lines that are queued or on a picklist there turn `recalled`, their unsent sends are dropped, and a recall is queued to CardChaos on a best effort. Afterwards the order's manual ship, label purchase and mark-ready are allowed and a HippoLink run can pick it. Idempotent: an order with nothing at CardChaos answers 200 with `released_lines` 0. 409 `run_at_cardchaos` while the order is on a CardChaos run that is still picking: delete the picklist in CardChaos first, or cancel the run.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Order released.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosReleaseResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/ready-for-pickup": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "markOrderReadyForPickup",
        "tags": [
          "Orders"
        ],
        "summary": "Mark an order ready for customer pickup",
        "description": "Stages the order for customer collection: stamps ready_for_pickup_at while the order status stays processing. Idempotent: re-marking an already-ready order returns the current state without writing a second audit row. Rejected on terminal statuses (shipped, canceled, refunded). Refused with 409 `at_cardchaos` while CardChaos is picking the order: a mark records no bin pulls. The mark a completed HippoLink run makes on its own is not affected. The action is audited (actor, timestamp, and an order history row). Once the ready-for-pickup email (#1174) ships, the first mark also triggers the customer notification.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Order marked ready for pickup.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The order status is terminal (shipped, canceled or refunded), or `at_cardchaos` when the order has a line queued or on a CardChaos picklist (also after picking is turned off, until CardChaos accepts the recall): pick it in CardChaos, or recall it first with Pick in HippoLink instead (`POST .../orders/{order_uuid}/cardchaos-recall`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "order_uuids": {
                          "type": "array",
                          "description": "The order, present with `error` `at_cardchaos`.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "operationId": "clearOrderReadyForPickup",
        "tags": [
          "Orders"
        ],
        "summary": "Clear an order's ready-for-pickup state",
        "description": "Clears the ready state, so the order is no longer awaiting customer collection. Idempotent: clearing an order that is not ready is a no-op success. Does not clear pickup_notified_at, so a notification that was already sent stays recorded. Rejected on terminal statuses (shipped, canceled, refunded). A genuine clear is audited (actor, timestamp, and an order history row).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "409": {
            "description": "`order_status_terminal` (the order is canceled or refunded) or `at_cardchaos`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Ready-for-pickup state cleared.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/marketplace-reports": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "reportOrderIssue",
        "tags": [
          "Orders"
        ],
        "summary": "Report order lines the store cannot fulfill to the marketplace",
        "description": "Tells the order's marketplace that the store cannot send some of the order's cards (damaged, missing). Mana Pool, Square and Shopify orders; any other marketplace is 422 `marketplace_report_unsupported`. The marketplace is the order's own, so the path does not name it.\n\nThe store lists the affected lines (`order_item_uuid`) and how many copies of each; only those items are sent. Lines left out are not reported and ship as normal. On Mana Pool each line is sent as Mana Pool's own product id for that SKU, so a line with no SKU or no Mana Pool id in the catalog, or whose product sits on more than one line of the order, is 422 `item_not_reportable` (report it from the Mana Pool website). On Square and Shopify any line is refundable, including one HippoLink doesn't stock. A quantity above what the line has left to report (ordered, minus earlier sent reports) is 422 `quantity_exceeds_line`.\n\nMana Pool then replaces or refunds the reported lines for the buyer and does not pay the seller for them. So a sent report also records a refund for the reported lines (`refund_uuid`, `refund_status: issued`, `report_uuid` set) and adds an order history row naming the cards. It does not flag the order problematic: Mana Pool already settles those lines with the buyer, and a flag set for another reason is left as it was. A sent report's copies stop counting toward the HippoLink fee and the sales, profit and COGS-margin reports, whether or not a refund was recorded (none is when the order was already refunded or canceled, or the lines total $0); the order's billing day is repriced unless an invoice already claimed it (`billing_reprice`). It leaves the resolution alone; the status changes only as any refund changes it (a refund covering the whole order total marks it refunded).\n\nOn an order that has not shipped (and is not canceled or refunded), a sent report or Square or Shopify refund takes the card copies off the order: they leave the pick list and stop being reserved, the line's quantity is lowered (a line refunded in full is kept at $0 with no SKU), and the order subtotal drops by those copies' prices; the order total is unchanged. `return_to_stock` says whether the cards are in stock: true releases them to sell again (copies already pulled go back on the shelf); false writes copies still on the shelf off the count, never below zero. If that fails, the report and refund still stand, the order is flagged problematic (\"Refunded cards not taken off the order: ...\") and `restock_error` says why. On a shipped order `return_to_stock` puts the copies back on the shelf; without it no inventory moves.\n\nA marketplace refusal is recorded as a `failed` report and returned with it: 409 `marketplace_report_conflict` (Mana Pool already has an open report on this order or these items), 422 `marketplace_report_rejected` (Mana Pool refused the request as sent), 502 `marketplace_unavailable` (Mana Pool failed or did not answer; report again). Nothing else changes, and the store may report again.\n\nOn a Square order this refunds the chosen copies through Square's RefundPayment instead of reporting them (`kind: refund`). The amount is Square's own after-tax line total prorated to the copies, or price plus tax share when the line can't be matched (see the quote). The order must have exactly one tender (else 422 `square_split_tender`). With `return_to_stock` the copies go back to stock, except lines HippoLink doesn't stock (no SKU: sleeves, sealed, a custom amount), which are refunded but never restocked; if the restock fails the refund still stands and `restock_error` says why. A Square refund whose answer was lost stays `pending`, and the next send finishes that refund under the same idempotency key (`resumed: true`) rather than starting another. A refused refund is `failed` (422 `marketplace_report_rejected`).\n\nSquare refunds every chosen line, and the report's `amount_usd` is that whole Square amount. HippoLink records its own refund (`refund_uuid`) for the card lines only: lines HippoLink doesn't stock are refunded on Square only and are never recorded as a HippoLink refund. A refund of only such lines is `sent` with `refund_uuid: null`. Because the refund row leaves those lines out, a whole-order refund that includes them doesn't reach the order total and doesn't mark the order refunded.\n\nOn a Shopify order this refunds the chosen copies through Shopify's `refundCreate` (`kind: refund`), to the order's original payment transaction. Each card line matches a Shopify line item by its `sku:HL-<id>` SKU; the amount is Shopify's own suggested refund for the matched lines (subtotal plus tax), or a prorated estimate when a line can't be matched (see the quote). Shopify is told not to restock and shipping is never refunded here. The request carries an idempotency key derived from the report, so a send whose answer was lost stays `pending` and the next send finishes that same refund (`resumed: true`). An order in a different currency than the store's is 422, and an order Shopify doesn't return (older than 60 days without `read_all_orders`) is 404. `tender_type` is the payment gateway of the refunded transaction (`shopify_payments`, `manual`, ...).\n\nOn a CardNexus order this refunds the chosen copies through CardNexus's refund call (`kind: refund`), which takes an amount only: each line's price times the copies, with no shipping. CardNexus takes only refunds below the sale's total, so a request reaching what is left of it is 422 `cardnexus_refund_must_be_partial` (cancel an unshipped order instead). A lost answer leaves the report `pending`, and the next send finishes it under the same key (`resumed: true`).\n\nOn a TCGplayer order this refunds the chosen copies through the seller portal's own refund calls (`kind: refund`), under the store's TCGplayer session. A request that covers every card copy still on the order (each line with a SKU) is sent as TCGplayer's full refund, which also returns the shipping; its `amount_usd` is the order total less the refunds HippoLink already holds, and the whole of it is recorded as the HippoLink refund. Any other request is a partial refund of each line's price times the copies, with no shipping. A line with no TCGplayer SKU can't be named in a partial refund (422 `item_not_refundable`), and a partial refund larger than what is left of the order total is 422 `refund_exceeds_order_total`. `buyer_note` is the text TCGplayer shows the buyer. TCGplayer takes no idempotency key and returns no refund id, so a refund whose answer was lost stays `pending` (502 `marketplace_unavailable`) and is never resent: until the store says what TCGplayer shows (`resolveMarketplaceReport`), another refund on the order is 409 `tcgplayer_refund_unconfirmed` (`params.report_uuid` names it). TCGplayer refusing the session (401, 403 or a redirect to its login page) is 412 `marketplace_not_connected` with the row `failed`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `refunds:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceReportRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The marketplace accepted the report.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`report_in_progress` (another report on this order is being sent), `order_status_terminal` (the order is canceled or refunded), `tcgplayer_refund_unconfirmed` (an earlier TCGplayer refund on this order was never confirmed; settle it with `resolveMarketplaceReport` first), or `marketplace_report_conflict` (the marketplace refused it as a duplicate; `report` is the failed row).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReportError"
                }
              }
            }
          },
          "412": {
            "description": "`marketplace_not_connected`: the store has no credentials for the order's marketplace, or Square, Shopify or TCGplayer refused its token or session; reconnect.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "`validation_error` (naming the field), `marketplace_report_unsupported`, `marketplace_order_id_missing`, `refund_amount_zero`, `square_split_tender` (a Square sale paid with more than one tender; nothing is sent), `item_not_on_order`, `item_not_reportable`, `item_not_refundable`, `quantity_exceeds_line` (each naming `order_item_uuid` where one line is at fault), `refund_exceeds_order_total` (TCGplayer), the Shopify refund codes (`shopify_currency_mismatch`, `shopify_paid_currency_mismatch`, `shopify_suggestion_missing`, `shopify_suggestion_quantity_mismatch`, `shopify_refund_unavailable`, `shopify_refund_exceeds_refundable`; nothing is sent), or `marketplace_report_rejected` (with the failed `report`; also Shopify refusing to return the order or the refund).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReportError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "`marketplace_unavailable`: the marketplace failed or did not answer. On Mana Pool `report` is the failed row. On Square `report` stays `pending` (Square may already have refunded), and the next send on the order finishes that same refund under the same idempotency key. On Shopify a refund already sent with different cards or amounts is `marketplace_report_rejected` (422) with a \"reload the order\" detail. On TCGplayer `report` stays `pending` and is never resent; settle it with `resolveMarketplaceReport` once the store has checked TCGplayer.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReportError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/marketplace-reports/quote": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "quoteMarketplaceReport",
        "tags": [
          "Orders"
        ],
        "summary": "Price a Square, Shopify, TCGplayer or CardNexus card refund without sending it",
        "description": "Square, Shopify, TCGplayer and CardNexus orders. On CardNexus each line is its price times the copies (`exact`) and `full_refund` is always false. On TCGplayer each line is its price times the copies (`exact`), `full_refund` says the send will use TCGplayer's full refund (the request covers every card copy left), and then `total_usd` is what is left of the order total, `shipping_usd` included. Prices the same body `reportOrderIssue` takes, line by line, from the live Square or Shopify order, and writes nothing. On Shopify `exact` lines use Shopify's suggested refund for the line and `estimated` lines a prorated share of it, and `tender_type` is the gateway of the first transaction Shopify would refund to. On Square `exact` lines use Square's own after-discount, after-tax line total; `estimated` lines use the line price plus its share of the order's tax less its discount. A card line matches its Square line by SKU; a line HippoLink doesn't stock (no SKU) matches by Square's item name and variation. Any line may be quoted. The send recomputes the amount itself. `total_usd` is what Square refunds; `hippolink_total_usd` is the card lines' part, the only part recorded as a HippoLink refund.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceReportRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The refund's price.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReportQuote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`order_status_terminal`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "description": "`marketplace_not_connected` (no Square or Shopify credentials, or the marketplace refused the token; reconnect).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`validation_error` (naming the field), `marketplace_report_unsupported`, `marketplace_order_id_missing`, `refund_amount_zero`, `square_split_tender`, `item_not_on_order`, `item_not_refundable`, `quantity_exceeds_line`, `refund_exceeds_order_total`, the Shopify refund codes (`shopify_currency_mismatch`, `shopify_paid_currency_mismatch`, `shopify_suggestion_missing`, `shopify_suggestion_quantity_mismatch`, `shopify_refund_unavailable`, `shopify_refund_exceeds_refundable`), or `marketplace_report_rejected` (Square has no such order, or Shopify refused to return it).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReportError"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "`marketplace_unavailable`: Square or Shopify did not answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/marketplace-reports/{report_uuid}/resolve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        },
        {
          "name": "report_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "resolveMarketplaceReport",
        "tags": [
          "Orders"
        ],
        "summary": "Settle a TCGplayer refund whose answer was lost",
        "description": "A TCGplayer refund TCGplayer never answered stays `pending`, because TCGplayer takes no idempotency key and a resend could refund twice. The store checks the order in the TCGplayer seller portal and says what it shows. `refunded` records the refund exactly as a confirmed send would (the refund row, the stock effect from the report's own `return_to_stock`, history, billing reprice); `not_refunded` marks the report `failed`, after which the store may refund again. Only a pending TCGplayer refund older than 45 seconds can be settled.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `refunds:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveMarketplaceReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settled report.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`order_not_found` or `marketplace_report_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "`report_not_pending` (already sent or failed; reload the order) or `report_in_progress` (the send may still be answered; wait a minute).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "`validation_error` (`outcome`), or `marketplace_report_unsupported` (the report is not a TCGplayer refund).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "description": "`refund_unrecorded`: TCGplayer has the refund but HippoLink couldn't record it; the report stays pending, so settle it again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/refunds": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "createOrderRefund",
        "tags": [
          "Orders"
        ],
        "summary": "Record a manual refund against an order",
        "description": "Records a manual refund with an amount, a reason (oversell, damaged, customer_request, carrier_loss, other), and an optional return-to-stock flag that restores inventory via FIFO reversal. Advances the order to refunded once the refund covers the full order total. The Idempotency-Key header is required; a request without it is rejected with 400 (#1485). Refunds on one order are serialized, and a refund that would take the order's cumulative refunds (every refund not marked failed) above its total is refused with 409, whatever its key (#3112). On a direct CardTrader order (marketplace CARD_TRADER) a refund is a cancellation: CardTrader has no refund API, so HippoLink sends its cancellation request (or accepts the buyer's, when the buyer asked first) with `notes` appended to the message the buyer sees, and CardTrader refunds the buyer once the cancellation is accepted. It must therefore be the whole refundable amount (422 `cardtrader_refund_must_be_full`) and the order must still be `paid` or `sent` on CardTrader (409 `cardtrader_order_not_cancelable`; see `cardtrader_cancellation` on the order detail). The refund stays `pending` until CardTrader reports the order canceled. CardTrader Zero orders cannot be cancelled through the API and are recorded `not_applicable` as before. A `MANA_POOL` order answers 422 `manapool_refund_requires_lines`: Mana Pool takes a report of the lines you can't fulfill, not an amount, so use `reportOrderIssue` instead. A `CARD_NEXUS` refund is sent to CardNexus at once and cannot be undone there. CardNexus only takes refunds that stay below the sale's total, so one reaching what is left answers 422 `cardnexus_refund_must_be_partial`; cancel an order awaiting dispatch to refund it in full. A `MISPRINT` order answers 422 `misprint_refund_unsupported`: Misprint has no refund API, so refund it on Misprint, and HippoLink records the refund from Misprint's webhook. A `SNAPCASTER` order is refunded by card, not by amount: send `items` (the lines and how many of each) and `return_to_stock` (required, true or false: whether the cards came back); `amount_usd` and `returned_items` are not used, the amount recorded is the cards' line prices until Snapcaster reports what it paid back (shipping and fee share included, so it can pass the order total), and a restock returns exactly the refunded cards. The refund is sent to Snapcaster first and recorded only once Snapcaster takes it, with Snapcaster's refund status (`pending` until the money settles, then `issued`, or `failed`). Only a shipped order can be refunded (409 `snapcaster_refund_before_shipment`; cancel the cards instead), and an order can be refunded more than once. Other refusals change nothing: 422 `snapcaster_line_unknown` (a line HippoLink can't name to Snapcaster), 409 `snapcaster_reconnect_required`, 409 `snapcaster_subscription_excludes_orders`, 422 `snapcaster_request_rejected`, 503 `snapcaster_unavailable` (no answer; a retry with the same Idempotency-Key can't refund twice). 502 `snapcaster_change_unconfirmed` means Snapcaster took the refund but HippoLink couldn't match it in the answer; it is recorded when Snapcaster's notice arrives, so don't send it again.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `refunds:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason",
                  "return_to_stock"
                ],
                "properties": {
                  "amount_usd": {
                    "type": "string",
                    "description": "Refund amount in USD as a decimal string. Must be greater than zero. Required for every marketplace except SNAPCASTER, which refunds the cards in `items` instead.\n",
                    "example": "5.99"
                  },
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "description": "SNAPCASTER only, and required there: the cards to refund, each a line of the order and how many of its units. Ignored for other marketplaces.\n",
                    "items": {
                      "type": "object",
                      "required": [
                        "order_item_uuid",
                        "quantity"
                      ],
                      "properties": {
                        "order_item_uuid": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Units of the line to refund; at most what the line has."
                        }
                      }
                    }
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "oversell",
                      "damaged",
                      "customer_request",
                      "carrier_loss",
                      "other"
                    ]
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Free-form notes about the refund. On a CARD_TRADER order these are sent to the buyer as part of the cancellation message, and are limited to 500 characters (422 `validation_error` on `notes`).\n"
                  },
                  "return_to_stock": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, returned_items must be provided and inventory will be restored via the FIFO reversal path.\n"
                  },
                  "returned_items": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "description": "Required when return_to_stock is true. Lists SKUs and quantities being returned to inventory.\n",
                    "items": {
                      "type": "object",
                      "required": [
                        "tcgplayer_sku_id",
                        "quantity"
                      ],
                      "properties": {
                        "tcgplayer_sku_id": {
                          "type": "integer"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Refund recorded",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay; existing refund returned",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/address-correction": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "correctOrderAddress",
        "tags": [
          "Orders"
        ],
        "summary": "Correct a Snapcaster order's ship-to address",
        "description": "Sends the corrected recipient name and address to Snapcaster, which emails the buyer, and only when Snapcaster accepts it changes the order's shipping address here (the address labels, packing slips and carrier calls print from). Snapcaster allows it while the order is not yet shipped, and never lets the province or country change. When the address is the one Snapcaster suggested, it is sent as accepting that suggestion. Answers with the updated order detail. Only Snapcaster orders are accepted (422 `address_correction_unsupported_marketplace`). Refusals leave the order untouched: 409 `address_correction_not_allowed` (the order is shipped, canceled, or past the point Snapcaster allows), 422 `address_correction_invalid` (Snapcaster rejected the address), `address_correction_region_change` (the province or country differs), `address_correction_unchanged` (Snapcaster already has this address), 412 `marketplace_not_connected` (reconnect Snapcaster) and 502 `marketplace_unavailable` (Snapcaster did not answer; try again).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderAddressCorrectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address was corrected; the updated order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "Snapcaster did not answer (`marketplace_unavailable`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/address-verification/retry": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "retryOrderAddressVerification",
        "tags": [
          "Orders"
        ],
        "summary": "Ask Snapcaster to verify a Snapcaster order's address again",
        "description": "Asks Snapcaster to run its address check again while the verdict is `pending` or `failed`. Nothing is changed here: the new verdict arrives from Snapcaster as an update and then shows in `address_verification` on the order detail. Verification never blocks shipping. Snapcaster allows one retry a minute after a failed check (429 `address_verification_retry_too_soon`), and refuses one when the check already has a verdict (409 `address_verification_not_retryable`). Only Snapcaster orders are accepted (422 `address_verification_unsupported_marketplace`); 412 `marketplace_not_connected` means reconnect Snapcaster and 502 `marketplace_unavailable` means it did not answer.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Snapcaster ran the check; the order as stored here",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "description": "Snapcaster allows one retry a minute after a failed check (`address_verification_retry_too_soon`). There is no `Retry-After`; try again in a minute.\n\nA key whose request budget is spent is also answered 429 `api_rate_limited`, with `Retry-After`. The gateway's own throttle answers `{\"message\":\"Too Many Requests\"}` with no `Retry-After`.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying. Sent with `api_rate_limited` only.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayMessage"
                    }
                  ]
                }
              }
            }
          },
          "502": {
            "description": "Snapcaster did not answer (`marketplace_unavailable`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/cancel-items": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "cancelOrderItems",
        "tags": [
          "Orders"
        ],
        "summary": "Cancel some units of a Kiosk or Snapcaster order's lines and return them to inventory",
        "description": "For cards coming off a Kiosk order: a customer declining some of the cards pulled for it, or the store being unable to fill them (`cause`). Each listed line loses `quantity` units: copies a completed pick run already pulled are restocked onto a shelf (into the store's canceled-order bin when it has one) and the rest are returned to sale; COGS lots are restored and the order's totals are reduced. With `in_stock: false` the cards are missing instead: unpulled copies are written off the shelf count, pulled ones are not restocked, and nothing is returned to sale. The order stays open for the remaining units. A line cancelled in full is shown as \"(removed from order)\"; what was dropped is in `canceled_items` on the order detail. A request that drops every stocked unit is a whole-order cancel instead (`order_canceled: true`), and `notify_customer` then emails the buyer as it does on `updateOrder`. Only KIOSK orders in `unfulfilled`/`processing` are accepted (422 `not_kiosk_order`, 409 `order_not_open`). An order on a pick run still in progress is refused (409 `order_on_active_run`), as is one whose pulled quantity cannot be trusted (409 `restock_untrusted`). The Idempotency-Key header is required, and a refusal is replayed for the same key: after fixing its cause (finishing the run, say), retry with a new key. A Kiosk order carries no tax or discount, so totals shrink by the line prices. A `SNAPCASTER` order is accepted too: the lines are cancelled on Snapcaster first (named by Snapcaster's own line reference) and only then here, and a request covering every unit Snapcaster still has on the order cancels the whole order there (`order_canceled: true`). Snapcaster refunds the buyer. A refusal changes nothing: 409 `snapcaster_cancel_after_shipment` (it has shipped; refund it instead), 422 `snapcaster_line_unknown` (a line HippoLink can't name to Snapcaster), 409 `snapcaster_reconnect_required`, 409 `snapcaster_subscription_excludes_orders`, 422 `snapcaster_request_rejected`. 503 `snapcaster_unavailable` (no answer) and 502 `snapcaster_change_unconfirmed` (Snapcaster took it but its answer didn't show which change was ours; it applies when Snapcaster's notice arrives) are not replayed for the key, and retrying with the same key can't cancel twice. Because Snapcaster refunds the buyer, an API key also needs `refunds: write` on the store to cancel a Snapcaster order's items (403 `api_key_scope_insufficient` otherwise, which is not replayed for the key).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "order_item_uuid",
                        "quantity"
                      ],
                      "properties": {
                        "order_item_uuid": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Units to drop from the line; at most what the line has left."
                        }
                      }
                    }
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Free-form note recorded with the cancellation."
                  },
                  "cause": {
                    "$ref": "#/components/schemas/OrderItemCancellationCause"
                  },
                  "notify_customer": {
                    "type": "boolean",
                    "default": false,
                    "description": "Only acted on when the request cancels the whole order."
                  },
                  "in_stock": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Whether the cards are on the shelf, for every line in the request. Absent or null is today's behavior (the same as true): unpulled copies return to sale and pulled ones are restocked. False takes them off the count: unpulled copies are written off the shelf count (`shrinkage_miscount`, valued at the line's cost, never below zero), pulled copies are not restocked, none is returned to sale, and their lots drop to match. A request that cancels the whole order sends it as `restock: false` on that cancel. Recorded as `in_stock` on `canceled_items`. Anything but a boolean is 422 `validation_error` on `in_stock`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Items canceled (or the whole order, see `order_canceled`)",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "order_canceled",
                    "order"
                  ],
                  "properties": {
                    "order_canceled": {
                      "type": "boolean"
                    },
                    "canceled": {
                      "type": "array",
                      "description": "Absent when the whole order was canceled.",
                      "items": {
                        "type": "object",
                        "required": [
                          "cancellation_uuid",
                          "order_item_uuid",
                          "tcgplayer_sku_id",
                          "quantity",
                          "physical_quantity"
                        ],
                        "properties": {
                          "cancellation_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "order_item_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "tcgplayer_sku_id": {
                            "type": "integer"
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "physical_quantity": {
                            "type": "integer",
                            "description": "How many of the units had already been pulled, and so were restocked onto a shelf (not when `in_stock` was false)."
                          }
                        }
                      }
                    },
                    "order": {
                      "$ref": "#/components/schemas/OrderDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/cancellation-requests/{request_id}/decline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        },
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Snapcaster's id for the buyer's request (`cnr_...`), from `cancellation_request.request_id` on the order.",
          "schema": {
            "type": "string",
            "maxLength": 64
          }
        }
      ],
      "post": {
        "operationId": "declineCancellationRequest",
        "tags": [
          "Orders"
        ],
        "summary": "Decline a Snapcaster buyer's cancellation request",
        "description": "Refuses a buyer's pending request to cancel a `SNAPCASTER` order, so the order ships as sold. Snapcaster is told first and emails the buyer the `reason`; the request is then recorded as `declined` on the order (`cancellation_request` on the order detail). Nothing else changes, and a refusal or no answer from Snapcaster changes nothing here. To honor a request, cancel the order or the lines it names (`updateOrder` with `status: canceled`, or `cancelOrderItems`): Snapcaster resolves the request with that cancel, and it shows as `accepted` once Snapcaster says so. No Idempotency-Key is needed: sending the same decline again is answered with the order as it is. Errors: 422 `not_snapcaster_order`; 404 `snapcaster_cancellation_request_unknown`; 409 `snapcaster_cancellation_request_resolved` (answered or withdrawn already, `params.request_status`); 409 `snapcaster_reconnect_required`, 409 `snapcaster_subscription_excludes_orders`, 422 `snapcaster_request_rejected` (Snapcaster refused); 503 `snapcaster_unavailable` (no answer).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000,
                    "description": "Why the request is declined. Snapcaster emails it to the buyer."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request is declined, or already was with this reason.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "order"
                  ],
                  "properties": {
                    "order": {
                      "$ref": "#/components/schemas/OrderDetail"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`). Nothing changed; try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/change-requests": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "createSnapcasterChangeRequest",
        "tags": [
          "Orders"
        ],
        "summary": "Report cards a Snapcaster order can't send, removing them or substituting another printing",
        "description": "When a picker can't find a card on a `SNAPCASTER` order, the seller reports it to Snapcaster before shipping instead of cancelling. Each line removes `quantity` units (`action: remove`) or substitutes another printing of the same product (`action: substitute`, with `substitute_sku_id`); the buyer answers on Snapcaster. `credit_cents` is the per-unit credit offered on substituted lines (0 to the line's unit price). Lines are named to Snapcaster by their own line reference. The request is checked here first and refused with its own code: 422 `snapcaster_change_line_invalid`, `snapcaster_line_unknown`, `snapcaster_change_quantity_invalid`, `snapcaster_substitute_invalid` (not another SKU of the same product), `snapcaster_credit_invalid`, `snapcaster_note_too_long`, 422 `snapcaster_change_removes_everything` (it would remove every card left; cancel the order instead), 422 `snapcaster_order_required`, 409 `snapcaster_change_after_shipment` and 409 `order_not_open` (only `unfulfilled` and `processing` orders). Snapcaster allows one waiting request per order: 409 `snapcaster_change_request_pending`. Also 409 `snapcaster_reconnect_required`, 409 `snapcaster_subscription_excludes_orders` and 422 `snapcaster_request_rejected`. 503 `snapcaster_unavailable` and 502 `snapcaster_change_unconfirmed` are not replayed for the Idempotency-Key. **Filing moves no stock.** Stock moves only when the buyer answers and Snapcaster notifies HippoLink (a substitution swaps the original for the substitute; a removal or a cancelled order returns the cards), once each. The pending request is on `OrderDetail.change_request`. The Idempotency-Key header is required; a retry replays Snapcaster's first answer.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `refunds:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "lines"
                ],
                "properties": {
                  "lines": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "order_item_uuid",
                        "quantity",
                        "action"
                      ],
                      "properties": {
                        "order_item_uuid": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Units to report; at most what the line has left."
                        },
                        "action": {
                          "type": "string",
                          "enum": [
                            "remove",
                            "substitute"
                          ]
                        },
                        "substitute_sku_id": {
                          "type": "integer",
                          "description": "Required for `substitute`, absent for `remove`. Another SKU of the same product."
                        }
                      }
                    }
                  },
                  "credit_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Credit per unit offered to the buyer for each substituted line, at most the line's unit price. Only with a substituted line. Defaults to 0.\n"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Shown to the buyer with the report."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Filed with Snapcaster and pending the buyer's answer",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapcasterChangeRequestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "Snapcaster took the report but its answer was unusable (`snapcaster_change_unconfirmed`). It shows on the order when Snapcaster's notice arrives; don't send it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`). Nothing changed here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/change-requests/{request_id}/withdraw": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        },
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Snapcaster's id for the request, `change_request.request_id` on the order.",
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        }
      ],
      "post": {
        "operationId": "withdrawSnapcasterChangeRequest",
        "tags": [
          "Orders"
        ],
        "summary": "Withdraw a pending report on a Snapcaster order",
        "description": "Takes back the seller's pending report before the buyer answers it. The order is unchanged and no stock moves; the request reads `withdrawn`. 404 `snapcaster_change_request_not_found`, 409 `snapcaster_change_request_not_pending` (already answered, withdrawn or closed), 422 `snapcaster_request_rejected` (the buyer raised it, so only the buyer can withdraw it), 422 `snapcaster_order_required`, 409 `snapcaster_reconnect_required`. 503 `snapcaster_unavailable` is not replayed for the Idempotency-Key. The Idempotency-Key header is required.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawn",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapcasterChangeRequestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`). Nothing changed here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/change-requests/{request_id}/accept": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        },
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Snapcaster's id for the request, `change_request.request_id` on the order.",
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        }
      ],
      "post": {
        "operationId": "acceptSnapcasterChangeRequest",
        "tags": [
          "Orders"
        ],
        "summary": "Accept a buyer's request on a Snapcaster order",
        "description": "Accepts the buyer's pending `cancel_lines` or `address_change` request on Snapcaster, which applies it: a `cancel_lines` request cancels those lines (`order.cancelled`, or `order.refunded` once the order has shipped) and an `address_change` request moves the shipping address (`order.updated` `address_corrected`). The request reads `accepted`. The optional body field `return_to_stock` is required to accept a `cancel_lines` request on an order that has shipped (Snapcaster then refunds the cards and needs to know whether they came back; sent as its `restock`), and ignored before shipping and for an `address_change`. There is no Idempotency-Key: the key sent to Snapcaster comes from the order, the request and `return_to_stock`, so sending it again replays Snapcaster's first answer. Nothing moves here: stock and the address change only when Snapcaster's own event for the answer arrives. 404 `snapcaster_change_request_not_found` (the order's request is another one), 409 `snapcaster_change_request_not_pending` (already answered, withdrawn or closed), 422 `snapcaster_request_not_from_buyer` (a report you filed is withdrawn instead), 422 `snapcaster_change_kind_unsupported`, 422 `snapcaster_request_rejected` (Snapcaster won't take the answer), 422 `snapcaster_return_to_stock_required` (shipped order, no `return_to_stock`), 422 `validation_error` (`return_to_stock` isn't true or false), 422 `snapcaster_order_required`, 409 `snapcaster_reconnect_required`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `refunds:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "return_to_stock": {
                    "type": "boolean",
                    "description": "Whether the refunded cards came back to stock. Required for a `cancel_lines` request on a shipped order; ignored otherwise.\n"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Answered",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapcasterChangeRequestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`). Nothing changed here; send it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/change-requests/{request_id}/decline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        },
        {
          "name": "request_id",
          "in": "path",
          "required": true,
          "description": "Snapcaster's id for the request, `change_request.request_id` on the order.",
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        }
      ],
      "post": {
        "operationId": "declineSnapcasterChangeRequest",
        "tags": [
          "Orders"
        ],
        "summary": "Decline a buyer's request on a Snapcaster order",
        "description": "Declines the buyer's pending `cancel_lines` or `address_change` request on Snapcaster: nothing on the order changes and Snapcaster emails the buyer. The request reads `declined`. Takes no body and no Idempotency-Key: the key sent to Snapcaster comes from the order and the request, so sending it again replays Snapcaster's first answer. Nothing moves here: stock and the address change only when Snapcaster's own event for the answer arrives. 404 `snapcaster_change_request_not_found` (the order's request is another one), 409 `snapcaster_change_request_not_pending` (already answered, withdrawn or closed), 422 `snapcaster_request_not_from_buyer` (a report you filed is withdrawn instead), 422 `snapcaster_change_kind_unsupported`, 422 `snapcaster_request_rejected` (Snapcaster won't take the answer), 422 `snapcaster_order_required`, 409 `snapcaster_reconnect_required`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Answered",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapcasterChangeRequestResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`). Nothing changed here; send it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/change-requests/substitute-candidates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "listSnapcasterSubstituteCandidates",
        "tags": [
          "Orders"
        ],
        "summary": "List printings that could replace a line of a Snapcaster order",
        "description": "Asks Snapcaster for the other SKUs of the line's product that the store has listed live with enough stock for the whole line, cheapest first, in HippoLink's identifiers. Each carries `store_quantity`, the copies HippoLink counts on the store's shelves, since a substitute the buyer accepts is taken from that stock. Snapcaster's `available` is provisional: nothing is held until the buyer accepts. 422 `snapcaster_order_required`, `snapcaster_change_line_invalid`, `snapcaster_line_unknown`; 503 `snapcaster_unavailable`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "order_item_uuid",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Substitute candidates",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SnapcasterSubstituteCandidate"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Snapcaster didn't answer (`snapcaster_unavailable`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shelf-shortfalls": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "listOrderShelfShortfalls",
        "tags": [
          "Orders"
        ],
        "summary": "List the lines of a shipped order the shelf came up short on",
        "description": "For a shipped order flagged because the shelf could not cover a line, each line whose physical pulls (handover, ship or pick, less reversals, plus earlier pulls from another variant) fall short of its quantity, with the in-stock variants (condition, finish, language) of the same card and their on-hand and listed counts. Empty for any other order. Use it before resolving the flag: when the copy that left was a different variant, pull it with `pullOrderShelfShortfall`, or that variant stays listed for a card the store no longer has.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Shelf shortfalls",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderShelfShortfalls"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shelf-shortfalls/pull": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "pullOrderShelfShortfall",
        "tags": [
          "Orders"
        ],
        "summary": "Take a line's missing copies off the variant that actually left",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "description": "Pulls `quantity` copies of `tcgplayer_sku_id`, another variant of the line's card, for a line the shelf came up short on: off the shelf (front first) and out of the listed count, with physical-pull ledger rows (the order's handover reason) naming the order line, and the line's cost moved onto that variant's lots. Re-pushes the variant to the marketplaces. Changes nothing on the order itself; resolve its flag as usual. Answers the order's shortfalls as they now stand. The Idempotency-Key header is required (400 `missing_idempotency_key`), and a refusal is cached under it. Never offered for TCGplayer Direct or CardTrader Zero orders. 409 `order_line_no_shortfall` (nothing missing on that line, including a second pull of a settled shortfall), `shortfall_quantity_exceeded`, `shortfall_variant_out_of_stock`, `shortfall_cogs_conflict`; 422 `shortfall_variant_invalid` (not another variant of the same card).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "order_item_uuid",
                  "tcgplayer_sku_id",
                  "quantity"
                ],
                "properties": {
                  "order_item_uuid": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "tcgplayer_sku_id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "The variant that actually left the store."
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order's shelf shortfalls after the pull",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderShelfShortfalls"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/orders": {
      "get": {
        "operationId": "listAvailableOrders",
        "summary": "List orders available for fulfillment (not locked in any active run)",
        "description": "Lists unfulfilled orders not already locked in an active (picking or ready_to_pack) run, oldest-first. Each row carries the order total, buyer name, item count, marketplace, and compact inline line items (product name, set, condition, finish, and quantity per line). Accepts the same shipping-type and product-parameter filters as listOrders (#1180) — they share one filter builder, so behavior is identical on both endpoints. The one listOrders filter deliberately not offered here is `status`: this endpoint is already scoped to unfulfilled orders, so any other value would only ever return nothing. Sorting is fixed (oldest-first) and `sort_by`/`sort_dir` are not honored.\nAn order already marked **ready for pickup** is excluded too: its cards are off the shelf and waiting at the counter, so it is not available to pick again. A pickup run has no terminal flip to remove it — it stays `unfulfilled` until the customer collects — so this exclusion is what keeps it out. `ready_for_pickup=true` therefore returns nothing here, the same way `status` would. Clearing the mark (`DELETE .../orders/{order_uuid}/ready-for-pickup`) puts the order back in the list.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "$ref": "#/components/parameters/MarketplaceFilter"
          },
          {
            "$ref": "#/components/parameters/OrderedAfter"
          },
          {
            "$ref": "#/components/parameters/OrderedBefore"
          },
          {
            "$ref": "#/components/parameters/OrderSearch"
          },
          {
            "$ref": "#/components/parameters/ProblematicFilter"
          },
          {
            "$ref": "#/components/parameters/ResolvedFilter"
          },
          {
            "$ref": "#/components/parameters/HeldFilter"
          },
          {
            "$ref": "#/components/parameters/KioskFlaggedFilter"
          },
          {
            "$ref": "#/components/parameters/ReadyForPickupFilter"
          },
          {
            "$ref": "#/components/parameters/FulfillmentMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ShippingMethodFilter"
          },
          {
            "$ref": "#/components/parameters/ExpectedShippingClassFilter"
          },
          {
            "$ref": "#/components/parameters/OrderGameFilter"
          },
          {
            "$ref": "#/components/parameters/OrderConditionFilter"
          },
          {
            "$ref": "#/components/parameters/OrderFinishFilter"
          },
          {
            "$ref": "#/components/parameters/OrderLanguageFilter"
          },
          {
            "$ref": "#/components/parameters/ProductTypeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderSetCodeFilter"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMin"
          },
          {
            "$ref": "#/components/parameters/OrderTotalMax"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMin"
          },
          {
            "$ref": "#/components/parameters/OrderItemCountMax"
          },
          {
            "name": "group",
            "in": "query",
            "required": false,
            "description": "Run-builder group. `orders` returns ordinary orders (held orders of a program whose holding is turned on are left out); `prepull_direct` / `prepull_ct_zero` return that program's held orders that still have cards to pre-pull. Omitted returns every group, each row tagged with its `group`. An unknown value is a 422 `query_param_invalid`.\n",
            "schema": {
              "type": "string",
              "enum": [
                "orders",
                "prepull_direct",
                "prepull_ct_zero"
              ]
            }
          },
          {
            "name": "root_location_uuid",
            "in": "query",
            "required": false,
            "description": "Location picking: list only the orders this top-level location can start on -- an order with a remaining (not yet pulled) card that has spare here, exact or a permitted substitute under the store's substitute mode -- and badge each with `location_coverage`. Every listed order is one `createFulfillmentRun` with this `root_location_uuid` accepts. `total` counts a slightly wider candidate set and can exceed the orders paged through by the few the final check drops. Held pre-pull orders are never scoped. Must be one of the store's live top-level locations (422 `run_location_invalid`); a value that is not a UUID is a 400 `query_param_invalid`. Ignored when the store has location picking off.\n",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` or `offset` was below its minimum (`query_param_invalid`), or a `total_*` / `item_count_*` bound was negative or its min above its max. A `limit` above 250 is not refused: it is capped at 250. `run_location_invalid` when the location filter is not one of the store's top-level locations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Available orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AvailableOrderSummary"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs": {
      "get": {
        "operationId": "listActiveRuns",
        "summary": "List in-progress runs (picking + unassigned)",
        "description": "Returns the store's active fulfillment runs — those being picked and those released back to the unassigned pool waiting to be claimed — with picker, progress (picked / total cards), order count, and total value. Powers the Active Runs board so staff and managers can see who is picking what and resume or claim a run. Unassigned runs are listed first.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ActiveRun"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createFulfillmentRun",
        "summary": "Create a fulfillment run and lock orders",
        "description": "Creates a fulfillment run in picking status, locks the supplied orders, and builds the pick list (resolving each item to the highest-stock SKU and location). The strategy (by_order, by_game_set_alpha, by_location) sets the pick order. Returns 409 if any order is already locked in another run, or `at_cardchaos` if any order is queued in CardChaos (CardChaos picks those; recall them first). Held orders of an enabled holding program make a pre-pull run, refused with 409 `prepull_invoice_run_open` while an RI pick run (Direct) or a CardTrader Zero invoice pick run (Zero) is open and unsettled (`params.run_uuid` names it).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids",
                  "strategy"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "strategy": {
                    "type": "string",
                    "enum": [
                      "by_order",
                      "by_game_set_alpha",
                      "by_location"
                    ]
                  },
                  "split": {
                    "type": "boolean",
                    "default": false,
                    "description": "Make the run a pool several pickers share as stretches of whole boxes. Only valid with `strategy: by_location` (any other strategy is a 400); the split-aware app sends it. Omitted or false creates a single-picker run.\n"
                  },
                  "root_location_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Location picking: the top-level location this run picks from. Required when the store has location picking on (422 `run_location_required`), and must be one of the store's live top-level locations (422 `run_location_invalid`); a value that is not a UUID is a 422 `validation_error` on this field. The run routes only through bins under it and plans each order's remaining cards only; a card free at another location is left for that location rather than flagged as missing. An order with nothing left this location can supply is left out of the run (it stays in the order list) and named in the response's `left_out_order_uuids`; when every order would be left out nothing is created and the answer is 422 `run_location_nothing_here`. Ignored, and the run is store-wide, when the store has location picking off or the batch is a pre-pull run.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Run created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "409": {
            "description": "One or more orders already locked in another run (`conflicting_order_uuids`), or queued in CardChaos (`error: \"at_cardchaos\"`, with the offending `order_uuids`), or, for a pre-pull run, an invoice pick run of the program is open and unsettled (`error: \"prepull_invoice_run_open\"`), or an ordinary run includes an order on an active presale hold (`error: \"order_held\"`, with the held `order_uuids`; override the hold or wait for its date, early-ship rules included).\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "conflicting_order_uuids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "order_uuids": {
                      "type": "array",
                      "description": "Present with `error` `at_cardchaos` or `order_held`; the orders refused.",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The batch mixes in-store pickup orders with orders that ship (`error: \"mixed_fulfillment_methods\"`). A pickup order is finished the moment its cards come off the shelf — the run stamps it ready for pickup and emails the customer — while a mailed order still has to be packed and labelled, so the two cannot share a run. Both sides are named so the client can say which orders to drop rather than making the picker bisect their selection. Start a separate run for each.\nAlso `error: \"prepull_mixed\"`: the batch mixes held orders of a holding program (a pre-pull run) with ordinary orders, or held orders of two programs. Pre-pull orders go on their own run, one program per run.\nLocation picking: `error: \"run_location_required\"` when the store picks by location and no root location was sent, `error: \"run_location_invalid\"` when it is not one of the store's live top-level locations, `error: \"run_location_nothing_here\"` when none of the selected orders has cards at the root location.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "mixed_fulfillment_methods",
                        "prepull_mixed",
                        "run_location_required",
                        "run_location_invalid",
                        "run_location_nothing_here"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    },
                    "pickup_order_uuids": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "shipping_order_uuids": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "404": {
            "description": "`order_not_found`: an order in the batch is not one of this store's orders. The whole batch is refused and nothing is locked.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}": {
      "get": {
        "operationId": "getFulfillmentRun",
        "summary": "Get a run with all pick items (used to resume)",
        "description": "Returns a run's header (picker, strategy, status, timestamps) and all of its pick items with card metadata and bin hints. Used to resume an in-progress run.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Run detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "renameFulfillmentRun",
        "summary": "Rename a fulfillment run",
        "description": "Sets the run's name. New runs are named `LABEL - YYMMDD - N` when created (LABEL is the marketplace, `Mixed`, or the program, such as `TCGplayer RI`; YYMMDD is the store-local day; N counts that label's runs that day); this replaces it. Any status, history included. Names are trimmed, 1 to 80 characters, and need not be unique. A rename never changes the numbering of later runs. 409 run_name_cardchaos_owned on a CardChaos run, whose name comes from its CardChaos picklist.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillmentRunRenameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run's new name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRunName"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_name_cardchaos_owned`: the run mirrors a CardChaos picklist and takes its name from it; rename the picklist in CardChaos.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/bins/{location_uuid}/positions": {
      "get": {
        "operationId": "getFulfillmentBinPositions",
        "summary": "Live copy positions for a run's pick items in one bin",
        "description": "Returns copies_ahead / bin_copies for every pick item of the run in this bin, net of copies other active runs have picked but not yet pulled. The visual picker polls it while the picker stands at the bin. Read-only. An empty list when the run has no items in the bin.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "location_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Live positions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentBinPositions"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/pick-list": {
      "get": {
        "operationId": "generatePickList",
        "summary": "Generate a run's pick list as a PDF",
        "description": "Returns a run-scoped picking aid as a PDF download: every pending pick item across every order on the run, in the physical order a picker walks the shop (the same order `getFulfillmentRun` returns them in). Distinct from an Order Document (`generateOrderDocument`) -- a pick list is one walk covering many orders, not one page per order, so it renders as its own document rather than a third order-document section. A run with no pending pick items still renders, with an empty items table.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pick list PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"pick-list-{run_uuid}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`pick_list_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/pick-list.csv": {
      "get": {
        "operationId": "generatePickListRocaCsv",
        "summary": "Export a run's pick list as a ROCA CSV",
        "description": "Returns the same stops as the PDF pick list (`generatePickList`) -- every pending, not-missing pick item on the run, in the physical order a picker walks the shop -- as a CSV download in the ROCA format the ROCA tool reads. One row per stop, with neighbouring stops for the same SKU in the same box and bin merged into one row. Columns: Product Line (box and bin), Product Name, Condition (with the finish, e.g. \"Near Mint Foil\"), Number, Set, Rarity (the line's price), Quantity, Main Photo URL (the running total of Quantity), Set Release Date (the tray slot each copy goes to, e.g. \"1 A(2): 1 B(1)\", blank when the run has no slots), SkuId and Order Quantity (\"order number:copies\", joined with \" | \"). A final row lists the orders on the run in slot order; it is left off a run with no orders (a reimbursement-invoice run). A run with no pending pick items returns just the header row.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pick list CSV",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"pick-list-{run_uuid}-roca.csv\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "The CSV is too large to download as one file (`pick_list_csv_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/pick": {
      "post": {
        "operationId": "pickPickItems",
        "summary": "Mark many pick items picked at once",
        "description": "Marks every listed pick item that is pending and not missing as picked, and records their place in the pile in route order (whatever order they are sent in), so a \"mark all found\" stacks the way the walk does. Items already picked, or missing, are skipped and left as they were. 422 `validation_error` on `pick_item_uuids` when the list is empty, over 250, holds a malformed id, or names an item not on this run (nothing is written). 409 `run_already_pulled` when the run left picking/unassigned.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickPickItemsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Which items this call picked and which it skipped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickPickItemsResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist still being picked. `run_already_pulled`: the run left `picking` / `unassigned`. `fulfillment_run_cancelled`: the run was cancelled; nothing was written.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}": {
      "patch": {
        "operationId": "updatePickItemStatus",
        "summary": "Toggle a pick item between pending and picked",
        "description": "Toggles a pick item between pending and picked and returns the updated item. Picking a card marked missing clears the mark, and records `flagged_in_error` on its order when the flag was only that mark and no other card on the run is still missing. Refused 409: `pick_item_missing_locked` for a missing holding stop or manual substitute stop, `run_already_pulled` once the run is past picking, `pick_item_is_substitution` when un-picking a legacy substitution, `pick_item_changed` when the card was marked missing mid-request.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "picked"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Updated item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pick_item_uuid": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `pick_item_is_substitution`: `pending` was sent for a legacy substituted item (substitution_sku_id set, not missing). Un-picking it would leave the order line on the substitute; undo it with `revertPickItemSubstitution` instead. Nothing changed. `fulfillment_run_cancelled`: the run was cancelled, so neither move is accepted. Nothing changed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/complete": {
      "post": {
        "operationId": "completeFulfillmentRun",
        "summary": "Transition run to ready_to_pack (send to packer queue)",
        "description": "Moves a run from picking to ready_to_pack, signalling the cards are picked and the run is ready for the packer queue. Valid only from picking. On a split run, 409 stretches_active while anyone holds a stretch and pool_not_empty while cards are unpicked; completing records the caller as the run's picker.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Updated run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`fulfillment_run_invalid_state`: the run is not being picked any more (it is already ready to pack, complete or cancelled); refresh to see where it stands. `run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). On a split run, `stretches_active` while anyone holds a stretch and `pool_not_empty` while cards are unpicked. A run that does not exist in the store is the 404 `fulfillment_run_not_found`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/cancel": {
      "post": {
        "operationId": "cancelFulfillmentRun",
        "summary": "Cancel a run (soft) with a reason",
        "description": "Cancels an active run (picking, unassigned or ready_to_pack), releasing its order locks so the orders return to the available queue. Unlike the old hard delete, the run and its pick items are kept for history along with who cancelled and why. A reason is required. On a picking or unassigned run, employees may cancel only a run assigned to them; managers and owners may cancel any run, including unassigned ones.\n\nCancelling a ready_to_pack run dismisses it from the packer queue, and any store user may do it. Its picked cards were already pulled off the shelf when picking finished, so `restock` is required and says where they went: `true` if they went back on the shelf (the pull is reversed for every order the run still holds, and those orders become pickable again), `false` if they left the building (stock stays pulled; a released order that is still unfulfilled goes back to the pick queue, so mark it shipped if it was fulfilled by hand). `restock: true` is refused on a reimbursement-invoice or CardTrader Zero invoice run.\nA ready_to_pack holding pre-pull run (`prepull_program` set) never pulled its cards at picking, so they are all still counted on their shelf rows. Dismissing it with `restock: false` (the cards left) performs the put-away the run skipped, exactly as `completeFulfillmentPrepull` does: each picked copy comes off the row it was picked from into its set's holding bin and is committed to its held line, and the run ends `complete`, not `cancelled`, with `cancel_reason` holding the reason sent. The response then carries `put_into_holding: true` plus `moved`, `return_to_shelf` and `created_bins`, and that endpoint's refusals (409 `prepull_invoice_run_open`, `holding_not_enabled`, `holding_move_refused`, 422 `bin_slot_limit_exceeded`) are this call's answer, leaving the run ready_to_pack. `restock: true` or omitted, and any picking or unassigned pre-pull run, just cancel the run and write no stock.\nA consolidation run (location picking) restocks nothing: its cards were pulled by the runs that picked them and are still staged for its orders. `restock` may be omitted, and `true` is refused with 409 `consolidation_run_restock_refused` (cancel the orders themselves to restock). Its unshipped orders go back to the consolidation queue keeping their staging slots; an order shipped while the run was open has its staging slot freed.\nRefuses with 409 `unpulled_shipped_orders` when the run holds a picked line for an order that already shipped out of band without anything having pulled that card off the shelf: cancelling instead would silently and permanently overstate the shelf by exactly the cards that already left. `lines` names the affected orders/SKUs. Complete the run instead (the correct action — it is what actually pulls the stock), or re-send with `pull_shipped: true` to pull the shelf for those lines and cancel anyway, or (owners, managers and sys-admins only) with `shelf_already_pulled: true` when those cards are already off the count and the run should cancel without pulling them. Expect this to be rare: an out-of-band ship normally pulls the shelf at the moment it is recorded, which takes its lines out of this check, and a CardTrader Zero invoice another settle already covered is never reported.\nDismissing a ready_to_pack run that still owes marketplace notifications is refused with 409 `unsent_shipment_notifications`: labels bought in its Ship Review did not tell the marketplace the order shipped (`shipFulfillmentRun` does, for the whole run), and dismissing would leave those buyers un-notified. `order_uuids` names them. Re-send with `notify_marketplaces: true` to dismiss and send those notifications as part of it.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the run was cancelled (shown to managers in run history)."
                  },
                  "pull_shipped": {
                    "type": "boolean",
                    "default": false,
                    "description": "Pull the shelf for any picked line belonging to an already-shipped order before cancelling, instead of refusing with 409 `unpulled_shipped_orders`. Picking/unassigned runs only.\n"
                  },
                  "shelf_already_pulled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Cancel without pulling the shelf for picked lines of already-shipped orders, instead of refusing with 409 `unpulled_shipped_orders`, because those cards are already off the count (a settle, a recount). Store owners, managers and sys-admins only (403 `fulfillment_run_shelf_override_not_allowed` otherwise). Sending it with `pull_shipped: true` is a 422. Only an exact `true` counts. Picking/unassigned runs only.\n"
                  },
                  "restock": {
                    "type": "boolean",
                    "description": "Required when the run is ready_to_pack (a packer-queue dismissal), ignored otherwise. `true` gives the picked cards back to the shelf; `false` keeps them pulled because they left the building. On a ready_to_pack holding pre-pull run, `false` puts its cards into holding and completes it (see the operation description). Optional on a consolidation run, where `true` is refused (409 `consolidation_run_restock_refused`).\n"
                  },
                  "notify_marketplaces": {
                    "type": "boolean",
                    "default": false,
                    "description": "Dismiss a ready_to_pack run that still owes marketplace notifications (`FulfillmentRun.pending_marketplace_notifications` > 0) and send them, instead of refusing with 409 `unsent_shipment_notifications`. Only an exact `true` counts.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Cancelled run. A ready_to_pack pre-pull run dismissed with `restock: false` comes back `complete` with the put-away summary added.\n",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/FulfillmentRun"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "put_into_holding": {
                          "type": "boolean",
                          "description": "Present and true only when the dismissal put the run's cards into holding."
                        },
                        "moved": {
                          "type": "array",
                          "description": "With `put_into_holding`; as in `FulfillmentPrepullComplete.moved`.",
                          "items": {
                            "$ref": "#/components/schemas/FulfillmentPrepullComplete/properties/moved/items"
                          }
                        },
                        "return_to_shelf": {
                          "type": "array",
                          "description": "With `put_into_holding`; cards left on the shelf (order canceled since, copies past a line's cap).",
                          "items": {
                            "$ref": "#/components/schemas/PrepullReturnToShelfItem"
                          }
                        },
                        "created_bins": {
                          "type": "array",
                          "description": "With `put_into_holding`; holding bins the put-away created.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`unpulled_shipped_orders` — the run holds a picked line for an already-shipped order; `lines` names the affected orders/SKUs. Re-send with `pull_shipped: true` to pull the shelf for those lines and cancel anyway. `unsent_shipment_notifications` — a ready_to_pack run holds labels whose marketplaces have not been told the order shipped; `order_uuids` names the orders. Re-send with `notify_marketplaces: true` to dismiss the run and send them. `run_at_cardchaos` — the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `consolidation_run_restock_refused` — `restock: true` on a consolidation run, whose cards are still staged for its orders; dismiss it without restocking, or cancel the orders to restock them. A ready_to_pack pre-pull run dismissed with `restock: false` also answers `prepull_invoice_run_open`, `holding_not_enabled` and `holding_move_refused` as `completeFulfillmentPrepull` does.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "lines": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CancelRunUnpulledShippedLine"
                          }
                        },
                        "order_uuids": {
                          "type": "array",
                          "description": "For `unsent_shipment_notifications`: the orders whose shipped + tracking notification the run still owes.\n",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/release": {
      "post": {
        "operationId": "releaseFulfillmentRun",
        "summary": "Release a run back to the unassigned pool",
        "description": "Hands a picking run back so someone else can pick it up. The picker is cleared and the run becomes unassigned, but its order locks and per-item picked/pending progress are preserved so the next picker resumes where this one stopped. Employees may release only a run assigned to them; managers and owners may release any picking run. 409 run_is_split on a split run (hand back or request a stretch instead).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Released run (now unassigned)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `run_is_split`: the run is split; hand back your stretch instead.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/orders/{order_uuid}/release": {
      "post": {
        "operationId": "releaseFulfillmentRunOrder",
        "summary": "Take one order out of a Package Sort run",
        "description": "Takes a single order out of a `ready_to_pack` run, so a picked order that will not get a label (a card missing from the pile, a buyer who canceled by message) stops blocking Mark all as shipped. The run's other orders are untouched. The order's lock on the run is deleted, so it leaves the pile and its tray slot, and it returns to the available queue with its status unchanged. A history row on the order records who released it.\n`restock` is required and says where the picked cards went. The run already pulled them off the shelf when picking finished. `true` puts them back on the bins they came from (this order's copies only, `total_quantity` only), and an `inventory.updated` event goes out for those SKUs; an order whose pulled quantity cannot be trusted (a voided label already pulled it, or it was oversold at pick time) restocks nothing, and the history row says the cards could not be returned automatically. `false` leaves the stock pulled (the card is missing, or left the building). Either way a later out-of-band ship of the order will not pull the same cards a second time.\nRefused with 409 `run_not_ready_to_pack` when the run is not at Package Sort, `order_not_in_run` when the order holds no lock on this run, and `order_already_shipped` when the order already has a label or has shipped (`label_purchased`, `shipped`, `refunded`; a canceled order holds no lock), and `order_ready_for_pickup` when a pickup order was already marked ready (the customer was emailed; hand it over or cancel it). 422 `run_order_release_unsupported` on a reimbursement-invoice, CardTrader Zero invoice, pre-pull, consolidation or location-scoped run: dismiss the run instead. Returns the updated run in the same shape as `getFulfillmentRun`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/OrderUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "restock"
                ],
                "properties": {
                  "restock": {
                    "type": "boolean",
                    "description": "`true` puts this order's picked cards back on the shelf; `false` keeps them pulled because they are missing or left the building.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run after the order left it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_not_ready_to_pack`: the run is not at Package Sort (the response names its current status). `order_not_in_run`: the order holds no lock on this run. `order_already_shipped`: the order has a label or has shipped (the response names its current status). `order_ready_for_pickup`: the order was already marked ready for pickup and the customer emailed. `run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "`validation_error`: `restock` is missing or not a boolean. `run_order_release_unsupported`: this kind of run cannot release one order.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/claim": {
      "post": {
        "operationId": "claimFulfillmentRun",
        "summary": "Claim an unassigned run and resume picking",
        "description": "Assigns an unassigned run to the calling user and returns it to picking, preserving the existing pick progress. Any store role may claim. Returns 400 if the run is no longer available (e.g. another picker claimed it first). 409 run_is_split on a split run (hand back or request a stretch instead).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Claimed run (now picking, assigned to caller)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `run_is_split`: the run is split; request a stretch instead.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/stretches/preview": {
      "get": {
        "operationId": "previewFulfillmentRunStretch",
        "summary": "Preview what a stretch request would get",
        "description": "For a split (Walk Path) run, the cards and boxes a request for `cards` would get right now: whole boxes from the pool until they hold at least that many. Advisory; the request itself decides. 409 run_not_split for a run that is not split.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cards",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentStretchPreview"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/stretches": {
      "post": {
        "operationId": "requestFulfillmentRunStretch",
        "summary": "Request the next stretch of a split run",
        "description": "Gives the caller the next whole boxes of the run's pool until they hold at least `cards` cards: handed-back boxes first, then untouched ones, then stragglers, each in walk order. 409 with error run_not_split, run_not_pickable, stretch_active (one at a time per person), nothing_left, or stretch_conflict (retry). Returns the run.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillmentStretchRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The run, with the new stretch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/stretches/{stretch_uuid}/finish": {
      "post": {
        "operationId": "finishFulfillmentRunStretch",
        "summary": "Finish a stretch",
        "description": "Marks a stretch done once none of its cards are open, and says what the picker can do next: take_more (the pool has cards), wait (others are still picking) or complete (the run is fully picked; call completeFulfillmentRun). The stretch's picker, or a store owner/manager. 409 stretch_not_active or stretch_has_open_cards.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stretch_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Finished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentStretchFinish"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/stretches/{stretch_uuid}/release": {
      "post": {
        "operationId": "releaseFulfillmentRunStretch",
        "summary": "Hand back a stretch",
        "description": "Ends a stretch early. Boxes it finished stay done; boxes with unpicked cards return to the front of the pool. Picked cards stay picked. The stretch's picker, or a store owner/manager. 409 stretch_not_active. Returns the run.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stretch_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/sort": {
      "get": {
        "operationId": "getFulfillmentRunSort",
        "summary": "Read the picked pile in the order it was stacked, with each card's package",
        "description": "The un-sorting step between picking and shipping. A run that reaches ready_to_pack leaves the packer holding one pile of cards drawn from every order in the run; this returns that pile in the exact order it was picked, with the package each card belongs to, so the cards are dealt rather than searched for.\n\nThe array matches the physical stack. Each picker's stretch of a split run is a stack (stacks[]), earliest stretch on top; within a stack cards are in the order they were picked. A run that isn't split is one stack. The planned route only breaks ties, which is the whole order for cards picked before pick order was recorded. Rows are one per pick task (a 3-of line is one row, one motion), while pile_index counts physical cards, so pile_fraction stays an honest \"you are ~37% down the pile\" cue for a packer who loses their place.\n\nPackage numbers follow first appearance in the pile, so the packing table fills left to right. That makes this endpoint the authority on package order: feed packages[].order_uuid in this array order to POST /v1/stores/{store_uuid}/orders/documents, which prints in caller order, and the slips come out matching the piles. That endpoint accepts at most 250 order_uuids per call, so a whole run (up to 100 orders) prints as one PDF; only a batch bigger than that needs sequential calls in this same order.\n\nA package whose order was cancelled after the run was packed comes back with disposition set_aside: its cards are still physically in the pile (the stock was already pulled) but no slip will print for them, so they go to restock instead of onto a pile.\n\nValid only while the run is ready_to_pack — before that the pile does not physically exist yet, and after shipping it is gone.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of pick tasks to return. Counted in tasks, not physical cards.\n",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The pile in route order, with package assignments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRunSort"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "setFulfillmentRunSortCursor",
        "summary": "Move the pack-sort resume anchor",
        "description": "Records the last card the packer dealt into a package, so a refresh, a locked phone, or a handover to another device resumes in the same place. Send null to clear it and start the pile over. The pick item must belong to this run.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cursor_pick_item_uuid"
                ],
                "properties": {
                  "cursor_pick_item_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The last pick task dealt, or null to clear the anchor.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Anchor updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentPackSortCursor"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/sort/placed": {
      "post": {
        "operationId": "setFulfillmentRunPlaced",
        "summary": "Mark cards of the pile placed in their order slots",
        "description": "On a run with order slots, records that the packer dropped these cards into their tray slots (placed true) or takes the mark back (placed false). Every id must be a placeable card: in this run's pile, as the sort read returns it, and not set aside (a set-aside card goes back to stock and is in no placement). If any id is not, the request is refused with a 422 naming it, and nothing is written. Idempotent: marking a card placed again keeps its first mark.\n\nThe response carries placed_count, placeable_total and pile_total as the next sort read reports them, so a client can update its progress (placed_count / placeable_total) without re-reading.\n\n409 when the run is not ready_to_pack or was created without order slots.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "pick_item_uuids",
                  "placed"
                ],
                "properties": {
                  "pick_item_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Pick tasks in this run's pile, e.g. a placement's pick_item_uuids. Duplicates are ignored.\n"
                  },
                  "placed": {
                    "type": "boolean",
                    "description": "True to mark the cards placed, false to clear the mark."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Marks recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRunPlaced"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/putaway": {
      "get": {
        "operationId": "getFulfillmentRunPutaway",
        "summary": "Where a picked pre-pull run's cards go in holding",
        "description": "The put-away plan of a pre-pull run that is `ready_to_pack`: one row per set slot, in slot order, with the set, the set's holding bin (null when complete-prepull will create it) and the picked cards in that slot whose order is still held, capped per line at what the line still owes holding. `return_to_shelf` lists picked cards whose order was canceled since the run was built, and copies past a line's quantity (a refund after picking); the picker returns those to the bin they came from and nothing is written for them. 409 `prepull_run_required` when the run is not a pre-pull run, 409 `holding_not_enabled` when the program's holding has been turned off, 400 `fulfillment_run_not_ready_to_pack` before picking is finished.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The put-away plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRunPutaway"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/complete-prepull": {
      "post": {
        "operationId": "completeFulfillmentPrepull",
        "summary": "Move a picked pre-pull run's cards into holding",
        "description": "Completes a `ready_to_pack` pre-pull run in one transaction: each card whose order is still held comes off the shelf row it was picked from, lands in its set's holding bin (created when new) and is committed to its order line. The run turns `complete` and lets go of its orders, which stay held. Each line moves at most what it still owes holding. Cards whose order was canceled since the run was built, and copies past a line's quantity (a refund after picking), are listed in `return_to_shelf`, as the put-away plan lists them, and nothing is written for them. Send an empty body. 409 `prepull_run_required` when the run is not a pre-pull run, 409 `holding_not_enabled` when the program's holding is off, 409 `holding_move_refused` when a holding write is refused, 409 `prepull_invoice_run_open` while an RI pick run (Direct) or a CardTrader Zero invoice pick run (Zero) of the program is open and unsettled (`params.run_uuid` names it; nothing is written), 422 `bin_slot_limit_exceeded` when a holding bin has no free position left for the copies, 400 `fulfillment_run_not_ready_to_pack` otherwise.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The run is complete and its cards are in holding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentPrepullComplete"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/holding/returns": {
      "get": {
        "operationId": "listHoldingReturns",
        "summary": "Canceled orders' copies still waiting in holding",
        "description": "The store's canceled holding commitments that have not been walked back to a shelf yet, oldest release first, each with the bin Return from holding will put it in (`return_location_*`; null when the origin bin is gone and the store has no default intake location). The list is bounded by canceled-not-returned copies, so it is not paginated.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Pending returns",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldingReturnList"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "returnFromHolding",
        "summary": "Walk canceled orders' copies from holding back to the shelf",
        "description": "One transaction for the named commitments: each canceled, not-yet-returned commitment's copies come out of holding and are restocked at the commitment's return location. 409 `holding_return_not_pending` (`params.commitment_uuids`) when any commitment is not this store's, not canceled, already returned, or the holding container is short of it; 409 `holding_return_no_destination` (`params.commitment_uuids`) when any has no return location. Nothing is written on a refusal.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "commitment_uuids"
                ],
                "properties": {
                  "commitment_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Commitments from listHoldingReturns. Duplicates are ignored."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The commitments returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldingReturnResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/status": {
      "get": {
        "operationId": "getStoreStatus",
        "summary": "Get the store's badge counts",
        "description": "Counts the platform re-reads on a timer for its navigation badges, one cheap read in place of a poll per list. Each field matches the list it stands for and is `null` when the caller could not call that list (role, permission or plan): `fulfillment.orders_to_pick` is listAvailableOrders' `total` with `group=orders`, `fulfillment.my_active_runs` is the listActiveRuns rows that need the caller, `fulfillment.ready_to_pack` is the length of getPackerQueue, and `pull_alerts.pending` is listPullAlerts' `total` (pro). `recounts.open_flags` is listRecountFlags' `total` with `status=open` and its default `min_flags_per_bin` (the store's threshold).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `store_settings:read`.",
        "tags": [
          "Stores"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Store status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/queue": {
      "get": {
        "operationId": "getPackerQueue",
        "summary": "List runs ready for packing",
        "description": "Lists the store's ready_to_pack runs with picker, order count, card count, and total value, for packers to claim.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Packer queue",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PackerQueueItem"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/order-transfers": {
      "get": {
        "operationId": "listOrderTransfers",
        "summary": "List order transfers between locations",
        "description": "Location picking: the bundles of picked cards travelling from another top-level location to each order's ship location, one per order per pick run, oldest first. Each lists the cards it carries (the source run's picked, non-missing pick items for the order). `status` defaults to `in_transit`, the receiving screen's list; any other value outside `in_transit`, `received`, `short` and `cancelled` is a 400 `query_param_invalid`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "in_transit",
                "received",
                "short",
                "cancelled"
              ],
              "default": "in_transit"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Order transfers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OrderTransfer"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/order-transfers/{transfer_uuid}/receive": {
      "post": {
        "operationId": "receiveOrderTransfer",
        "summary": "Receive an order transfer in full",
        "description": "Marks an `in_transit` transfer `received` at its ship location and re-checks the order: it becomes `ready_to_consolidate` once nothing else is in transit and no location still holds any of what is left of it, else it stays `awaiting_parts`. Moves no inventory (the cards were taken off stock when they were picked). 404 `order_transfer_not_found` for a transfer not in this store; 409 `transfer_already_received` for one that is no longer in transit (for a transfer cancelled with its order, the `detail` says to return the cards to the shelf).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "$ref": "#/components/parameters/OrderTransferUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The received transfer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`transfer_already_received`: the transfer was already received (in full or short) or cancelled. Refresh to see its current state.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/order-transfers/{transfer_uuid}/receive-short": {
      "post": {
        "operationId": "receiveOrderTransferShort",
        "summary": "Receive an order transfer with cards missing",
        "description": "Receives an `in_transit` transfer as `short`: the named pick items did not arrive. Each is marked missing (`is_missing`, `resolution_notes` `transfer_short`) and counts as not yet picked again, so the order goes back to waiting on it wherever a copy is in stock (any condition). A missing card no location has in stock flags the order problematic (\"... did not arrive in the transfer and is not in stock at any location\"), appended to any reason it already carries. The order's consolidation state is then re-checked as in `receiveOrderTransfer`. Moves no inventory. Every named card must be in the transfer's bundle, else a 422 on `missing_pick_item_uuids` and nothing changes. 404 `order_transfer_not_found`; 409 `transfer_already_received`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "$ref": "#/components/parameters/OrderTransferUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReceiveOrderTransferShortRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The transfer, received short",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderTransfer"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`transfer_already_received`: the transfer was already received (in full or short) or cancelled. Refresh to see its current state.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/run-locations/preview": {
      "post": {
        "operationId": "previewRunLocations",
        "summary": "Preview where selected orders can be picked",
        "description": "Location picking: the run builder's location step. For each of the store's top-level locations, each selected order's coverage of its remaining cards: `complete` when the location's exact copies cover every remaining line, `partial` when it can start on some, `none` when it can supply nothing (a substitute here counts only when the exact card is not free elsewhere). It says what the location can supply, not where the order ships. An order `none` at a location is left out of a run created there. 404 `order_not_found` when an order is not in this store; 409 `location_picking_disabled` when the store has location picking off. Reads only.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRunLocationsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Coverage per top-level location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunLocationsPreview"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`location_picking_disabled`: the store does not pick by location.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A missing, empty, oversized or malformed `order_uuids` is a 422 `validation_error` on it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/consolidation": {
      "get": {
        "operationId": "listConsolidationQueue",
        "summary": "List orders ready to consolidate",
        "description": "Location picking: the orders split across top-level locations whose every part now waits at its ship location (`ready_to_consolidate`) and that are not in a run yet, by staging slot. Each names its ship location (orders of different ship locations go in separate consolidation runs), its staging slot (where the part picked here waits), the transfers it received from other locations, and how many cards its runs pulled for it. Select some to `createConsolidationRun`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Orders ready to consolidate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConsolidationQueueItem"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/consolidation/runs": {
      "post": {
        "operationId": "createConsolidationRun",
        "summary": "Create a consolidation run",
        "description": "Location picking: makes a `consolidation` run of orders from the consolidation queue. It picks nothing: it starts at `ready_to_pack`, and its `pick_items` are the cards the orders' earlier runs pulled for them (on those runs' `pick_item_uuid`s, already `picked`), so it goes straight to Ship Review, labels and Mark all as shipped, which tells the marketplaces once (#3812). A label bought in its Ship Review keeps the order on the run until then. `missing` lists any card no earlier run pulled. A pickup batch is marked ready for pickup here instead (an order flagged problematic is not). Each order keeps its staging slot until it ships. Moves no inventory. The run's `root_location_uuid` is the orders' shared ship location.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConsolidationRunRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The consolidation run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`consolidation_order_not_ready`: some orders are still waiting on a transfer or on cards from another location (`params.order_uuids` names them); or `orders_already_in_run`: some are already in another run (`conflicting_order_uuids`). Refresh the queue and choose again; or `consolidation_location_mixed`: the orders are packed at different locations (start one run per location).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "`mixed_fulfillment_methods`: the batch mixes in-store pickup orders with orders that ship (both lists are named in the body); consolidate each kind separately. A missing, empty or malformed `order_uuids` is a 422 `validation_error` on it.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/staging-returns": {
      "get": {
        "operationId": "listStagingReturns",
        "summary": "List staging slots held by cancelled orders",
        "description": "Location picking (#4276): a split order cancelled while cards waited for it at its ship location keeps its staging slot, because the cards are still in it; the slot is not handed to another order until staff put them back and `releaseStagingSlot` frees it. One item per held slot, by slot number, with the cards physically in it: what was picked at its ship location and what arrived on a received (or short) transfer, never a card received short or a bundle cancelled in transit. Each names the location the slot is in. `restocked` says whether the cancel already gave the copy back to its bin's stock; a card not restocked (a no-restock cancel) needs its stock adjusted if it goes back on the shelf. A slot with no such cards is listed with `cards: []` so it can still be released. Moves no inventory.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Staging slots held by cancelled orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StagingReturn"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/staging-returns/{order_uuid}/release": {
      "post": {
        "operationId": "releaseStagingSlot",
        "summary": "Free a cancelled order's staging slot",
        "description": "Location picking (#4276): once staff have put a cancelled order's cards back on the shelf, frees its staging slot so the next split order can use the number. Moves no inventory (the cancel already restocked what it was asked to). 404 `order_not_found` for an order not in this store; 409 `staging_return_not_held` for one that is not holding a slot (already released, or not cancelled).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "$ref": "#/components/parameters/OrderUuid"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The freed slot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StagingSlotReleased"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`staging_return_not_held`: the order is not holding a staging slot. It may already have been cleared; refresh the list.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/ship": {
      "post": {
        "operationId": "shipFulfillmentRun",
        "summary": "Mark run complete and trigger shipping for all orders",
        "description": "Marks a ready_to_pack run complete, releases its order locks, and triggers shipping and fulfillment for each order. Valid only from ready_to_pack.\nThis is where the marketplaces hear about labels bought in the run's Ship Review: buying one does not notify the marketplace, and shipping the run pushes shipped + tracking for each such label that was not voided. `pending_marketplace_notifications` on the run is how many. Labels bought for orders that are not on a ready_to_pack run still notify the marketplace immediately. Returns 409 `run_not_ready_to_pack` if the run has already moved on (already shipped, or still being picked) since the caller last read it. Returns 409 if any order in the run has an unacknowledged auto-substitution (acknowledge each via .../substitution-ack first). Also returns 409 if any order in the run is held (hold_until in the future, not overridden) until the date passes or each hold is overridden via .../hold-override.\nFor a **CardTrader Zero invoice run** this is also where the invoice itself ships and CardTrader is told, with the hub-leg tracking from the optional request body — pick-complete settled the covered sales but left the invoice open, because the parcel is not sealed and has no tracking before this point. The body is ignored for every other run, whose per-order tracking is bought through the shipping routes.\nThe hub leg can also go on a real bought label rather than a typed-in number: rate and buy against the **invoice's own** order_uuid through `getShippingRates` / `purchaseShippingLabel` (they rate to the invoice's ship-to, which is CardTrader's hub), then send that shipment's uuid as `shipment_uuid` here — or send nothing, and the invoice's live label is used.\nA pre-pull run is never shipped: 409 `prepull_not_allowed` (complete it with `completeFulfillmentPrepull` instead).\nIf the pick did not cover every line, this returns 409 `zero_invoice_not_settled` with the per-SKU shortfall in `uncovered_lines`, and ships nothing — the run stays `ready_to_pack` so the same call can be retried. Re-send with `allow_uncovered: true` to ship the parcel short: an invoice is one parcel, so a line the pick could not cover will never be covered for it, and the shortfall is recorded on the invoice's status history. The uncovered held sales stay held — those cards were not in the box.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardTraderZeroFulfillRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Completed run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "description": "The request named the hub parcel's label in a way that cannot be honoured: `hub_tracking_conflict` (both `shipment_uuid` and `tracking_number` sent) or `hub_label_not_found` (the named shipment is voided, or is not this invoice's).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/candidates": {
      "get": {
        "operationId": "getSubstitutionCandidates",
        "summary": "List fulfillment candidates for a pick item",
        "description": "Returns a single `candidates` list, each row tagged by `kind`. `kind=\"substitute\"` rows are up to five different SKUs the seller can send instead — same product, language, finish, and game, any condition (Unopened matches only Unopened) — ranked by condition then quantity; selecting one is a real substitution that moves stock and COGS. `kind=\"same_sku\"` rows are other bins in the store holding the *same* ordered SKU (excluding the assigned bin), an \"also available here\" list for the picker, not a substitution. Bins where the run still has another pending stop are listed too and tagged `on_route`; those rows come first (the picker is walking there anyway), then best-stocked first. On a split run a row in a box the card's stretch does not hold is not listed, since a relocate would refuse it. Substitutes lead, then same-SKU bins. All rows carry location and bin hints. 409 `prepull_not_allowed` on a pre-pull run, which never substitutes.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Fulfillment candidates for the pick item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "candidates"
                  ],
                  "properties": {
                    "candidates": {
                      "type": "array",
                      "description": "Substitute SKUs (`kind=\"substitute\"`) followed by same-SKU bins (`kind=\"same_sku\"`). See `FulfillmentCandidate`.\n",
                      "items": {
                        "$ref": "#/components/schemas/FulfillmentCandidate"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/substitute": {
      "post": {
        "operationId": "substitutePickItem",
        "summary": "Substitute a pick item with an eligible candidate copy",
        "description": "Tombstones the pick item and adds a pending stop for the substitute at the chosen row (in place if that bin is still ahead of the picker, otherwise at the end of the route), moving COGS and sellable stock to the substitute and flagging the order for acknowledgement. Returns the refreshed run. 400 when `location_uuid` is not a UUID, `slot` is not a non-negative integer, or `slot` is given without `location_uuid`. 409 when the item was already substituted, marked missing or picked (`pick item already resolved` / `pick item already picked`, or `pick_item_resolved` when a concurrent request resolved it first), the run has left picking/unassigned (`run_already_pulled`), or the chosen row no longer has enough unreserved or sellable copies (`substitute_row_unavailable`), or the run is a pre-pull run (`prepull_not_allowed`: a pre-pull run never substitutes).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubstituteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refreshed run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `pick item already resolved` / `pick item already picked`: the stop is a tombstone or already picked. `pick_item_resolved`: a concurrent request resolved it first. `run_already_pulled`: the run left `picking` / `unassigned`. `substitute_row_unavailable`: the chosen row (or every row) has no spare or sellable copies. `condition substitution is not offered on a reimbursement invoice pick run`: an RI pick task. `prepull_not_allowed`: the run is a pre-pull run, which never substitutes (`params.action` names the refused action).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/missing": {
      "post": {
        "operationId": "markPickItemMissing",
        "summary": "Mark a pick item as missing and flag the order problematic",
        "description": "Marks a pick item as missing and flags its order as problematic. Always takes effect: re-marking an already-missing item overwrites the prior reason, and a prior substitution is reversed (the substitute returns to stock and the original is re-allocated) before the item is flagged missing. Returns 422 if the substitution cannot be reversed (e.g. the original SKU can no longer be re-allocated). 409 for a resolved item the run no longer shows (`pick item already resolved`, e.g. the original of a manual substitution, whose substitute stop owns the swap), and for a manual substitute stop or a holding stop when the run has left picking/unassigned (`run_already_pulled`), or when a concurrent request resolved the stop first (`pick_item_resolved`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkMissingRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "Updated pick item after marking missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentPickItem"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `pick item already resolved`: the stop is a tombstone. `pick_item_resolved`: a concurrent request resolved it first. `run_already_pulled`: the run left `picking` / `unassigned` (a manual substitute's swap could not be reversed, or a holding stop's copy was already pulled at settle and cannot be written off).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/found": {
      "post": {
        "operationId": "reportPickItemFound",
        "summary": "Report how many were found at a stop; auto-reallocate the shortfall",
        "description": "The picker reports how many copies they actually found at this stop. The reallocation engine keeps the found copies (marking the stop picked), removes the stop entirely if none were found, and auto-re-sources the shortfall onto the route — reusing an upcoming stop, else appending a new one, else backtracking; exact condition first, then substitutes. The bin the picker searched empty is excluded from re-sourcing. Returns the refreshed run. At a manual substitute stop the copies not found are swapped back to the ordered card first (422 if that cannot be done). 409 for a resolved item the run no longer shows (`pick item already resolved`), and at a manual substitute stop or a holding stop when the run has left picking/unassigned (`run_already_pulled`), or when a concurrent request resolved the stop first (`pick_item_resolved`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FoundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run after the found-count was applied and the shortfall re-sourced",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `pick item already resolved`: the stop is a tombstone. `pick_item_resolved`: a concurrent request resolved it first. `run_already_pulled`: the run left `picking` / `unassigned` (a manual substitute's swap could not be reversed, or a holding stop's copy was already pulled at settle and cannot be written off).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/split": {
      "post": {
        "operationId": "splitPickItem",
        "summary": "Split copies off a pending pick item onto a new one",
        "description": "Moves `quantity` copies of a pending pick item onto a new pending pick item that copies every other field (order line, SKU, bin, slot, route position), so it keeps the original's place on the walk and in its stretch. The original keeps the rest. Used when the picker found some, not all, of a card's copies: the found part is picked and the split-off part goes through mark-missing or find-another-copy. Returns the new pick item. 422 `invalid_split_quantity` unless 1 <= quantity <= the item's quantity - 1. 409 `run_already_pulled` when the run left picking/unassigned, `pick_item_resolved` when the item is no longer pending or is missing, `split_unsupported` for a manual substitute stop or a legacy substituted row. When `expected_quantity` is sent and is not the item's current quantity the split is refused with 409 `pick_item_changed` (checked before the range, so a retried split that already applied is a recognisable no-op).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitPickItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new pick item holding the split-off copies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentPickItem"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist still being picked. `run_already_pulled`: the run left `picking` / `unassigned`. `pick_item_resolved`: the item is no longer pending, or is missing. `split_unsupported`: a substituted item. `pick_item_changed`: the item's quantity no longer matches the expected_quantity sent, e.g. a retried split that already applied; reload the run.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/relocate": {
      "post": {
        "operationId": "relocatePickItem",
        "summary": "Take a pending pick item from another bin holding the same card",
        "description": "Moves a pending pick item to another row of the same SKU, one the candidates list (`kind: same_sku`) offered. When the run still has a pending stop at that bin the card joins that stop (takes its phase), so it is picked on reaching the bin; otherwise it is appended to the end of the walk (a new phase after everything planned). The pick then comes from that bin, so `complete_run` decrements it. No substitution and no COGS move. Returns the refreshed run. 409 `run_already_pulled` when the run left picking/unassigned, `pick_item_resolved` when the item is no longer pending or is missing, `relocate_row_unavailable` when the row isn't offered or has fewer free copies than the item needs, and on a split run `relocate_other_stretch` when the target box is held by another picker or is still in the pool.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelocatePickItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refreshed run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist still being picked. `run_already_pulled`: the run left `picking` / `unassigned`. `pick_item_resolved`: the item is no longer pending, or is missing. `relocate_row_unavailable`: the row isn't a same-SKU candidate or holds too few free copies. `relocate_other_stretch`: split run, and the target box isn't held by the picker holding this card.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/fulfillment/runs/{run_uuid}/items/{pick_item_uuid}/revert-substitution": {
      "post": {
        "operationId": "revertPickItemSubstitution",
        "summary": "Undo a manual substitution",
        "description": "Reverses a manual substitution's COGS and sellable-stock swap, removes the substitute stop and restores the original pick item to pending. Also undoes a legacy substitution recorded on the item itself. 409 when the run has left picking/unassigned (run_already_pulled), the item is not a substitution (not_a_substitution), or part of the substitute was already re-sourced (substitution_partially_resolved).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "tags": [
          "Fulfillment"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/StoreUuid"
          },
          {
            "name": "run_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pick_item_uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Refreshed run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`run_at_cardchaos`: the run mirrors a CardChaos picklist that is still being picked; act on it in CardChaos (execute or delete the picklist). `not_a_substitution`: the item is not a live substitution (or is an RI pick task). `substitution_partially_resolved`: part of the substitute was already re-sourced. `run_already_pulled`: the run left `picking` / `unassigned`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shipping/rates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "getShippingRates",
        "tags": [
          "Shipping"
        ],
        "summary": "Get shipping rates for a bubble mailer shipment",
        "description": "Rate-shops the order server-side and returns the available carrier rates. Defaults to the store address as the from_address.\nWith no `parcel` in the body the parcel is resolved server-side: a saved sealed size for that many units of one sealed product alone; else the package of the first enabled shipping rule (by priority) whose conditions match and that sets one (`then.parcel`, resolved before the shop like the add-ons); else a built-in 3 oz package. Sealed product is not forced into a package. A rule's package and the built-in carry no size, so a resolved package is refused 422 `parcel_required` (reason package_size, with `params.suggested_parcel` and the order's `sealed_lines`) until the request sends a `parcel` with its dimensions; a letter or flat is quoted straight away. With a label add-on in force, or on an order its marketplace says must be tracked, a letter or flat becomes a package of the same weight, and a `letter` or `flat` override is refused 422 on `parcel.package_type`. An explicit `parcel` is a per-order override (`source: manual`). `machinable` (top level) overrides the quoted parcel's USPS machinable flag, whatever its source; left out (or null), the rule package's flag applies, and true for a manual parcel, a saved sealed size and the built-in. The response `parcel` says which parcel was quoted and why. Every carrier `rate_id` carries that parcel and its machinable flag, as it carries the add-ons, so buying it buys the quoted shape: pass the `rate_id` back unmodified. When a shop with only defaulted add-ons is re-rated without them (below), the parcel is re-resolved for that shop too, and the response `parcel` is the one actually quoted.\nThe rates list also includes synthetic options: one estimate-only stamp option (`hippolink_pkg_physical_postage`, $0.00 — the seller applies postage by hand, no label is bought), the legacy `hippolink_pwe` alias resolving to it, and a free Local Pickup option (`hippolink_pickup`, $0.00). The per-tier stamp ids `hippolink_pkg_pwe_1oz` / `_pwe_2oz` / `_large_letter` are retired from the list but still purchase, resolving to the same option, so a client holding an older cached rate list keeps working. Each synthetic stamp option carries a `packaging` key. Select any and pass its rate_id to purchaseShippingLabel. `recommended_packaging` echoes the matched rule's tier for the pack-page instruction.\nA **kiosk** order is refused 422 (`marketplace_shipping_unsupported`) instead: it was placed from inside the shop and carries no shipping address, so there is nothing to rate. It is marked ready for pickup when its cards come off the shelf (`completeFulfillmentRun`) and handed over at the counter.\n**CardTrader Zero hub parcel.** Passing a CardTrader Zero *invoice*'s order_uuid rates the parcel going to CardTrader's hub: the invoice is an ordinary order row whose ship-to address is the hub, so nothing extra is supplied. Two caveats for that case — shipping rules' packages do not apply to it and the built-in package has no size, so send an explicit `parcel` with the real weight and dimensions; and the synthetic stamp/pickup options in the list are not buyable for it (`purchaseShippingLabel` refuses them 422).\n**Add-ons (signature confirmation, insurance).** These are asked for *here*, not at purchase: a carrier prices and binds them when it quotes, so every carrier rate in the response is quoted with the add-ons in force and buying its `rate_id` buys a label that carries them. To change an add-on, call this again. Left out of the body, each takes the order's default — what the store's shipping rules require (`ShippingAction.signature_confirmation` / `insure`), and for a signature also what the marketplace requires (`signature_required`, e.g. TCGplayer at $250+). Sending a value overrides the default, including `signature_confirmation: none` and `insured_value: 0` to opt out -- except that a signature the marketplace requires cannot be opted out of (422 `signature_required`, as when the store's provider cannot buy one), and is never dropped by the re-rate described below. The response's `signature_confirmation` / `insured_value` say what the rates were actually quoted with. Asking for an add-on the store's provider cannot buy is refused 422 (`add_on_unsupported`); a *default* the provider cannot buy is dropped instead, and the response fields show that it was. The same applies when the carrier errors on, or quotes nothing for, a shipment carrying only defaulted add-ons: the order is re-rated without them rather than left with no rates. A CardTrader Zero hub parcel takes no defaults at all. The synthetic stamp and pickup options buy no label and carry neither. One exception to \"the quote is the price\": EasyPost bills its insurance fee at purchase, on top of the quoted rate.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parcel": {
                    "$ref": "#/components/schemas/Parcel"
                  },
                  "from_address": {
                    "$ref": "#/components/schemas/Address"
                  },
                  "signature_confirmation": {
                    "$ref": "#/components/schemas/SignatureConfirmationRequest"
                  },
                  "insured_value": {
                    "$ref": "#/components/schemas/InsuredValueRequest"
                  },
                  "machinable": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "USPS machinable for this label. Overrides the quoted parcel's flag (the matching shipping rule package's, or true for a manual parcel, a saved sealed size or the built-in); left out or null, theirs applies. False declares a non-machinable piece: EasyPost and ShipStation pass it to the carrier, Pitney Bowes ignores it (Shipping 360 has no machinable field, and its `NMLETTER` parcel type is not yet mapped). Applies only to a letter: a flat or package is always machinable, nothing is sent to the carrier for it, and this is ignored for it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Available shipping rates",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingRatesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "Validation failed, or the order needs a package size (`parcel_required`): it resolved to a package (from a shipping rule, the built-in default, or a letter or flat forced up by an add-on or tracking), which carries no size. `params` suggests a parcel and lists the order's sealed lines; send an explicit `parcel`. `customs_required` when the order ships to an APO/FPO/DPO military address and its customs form cannot be filed (not raised for a Pitney Bowes store): `params.reasons` lists why (`phone`, `signer`, `value`, `value_over_limit`, `weight`) and `params.order_uuid` names the order. Other 422 codes are as for any request (`marketplace_shipping_unsupported`, `add_on_unsupported`, `request_body_invalid`). `signature_required` when the order's marketplace requires a signature (TCGplayer at $250+) and the request would quote or buy without one.\n",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "params": {
                          "$ref": "#/components/schemas/ParcelRequiredParams"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/shipping/rate-batches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createRateBatch",
        "tags": [
          "Shipping"
        ],
        "summary": "Rate-shop many orders in one EasyPost batch (max 100)",
        "description": "Submits many orders as a single EasyPost batch instead of one rate request per order — rating N orders individually can trip EasyPost's per-key rate limiter when many are requested in a short window. Returns immediately with a rate_batch_uuid; poll getRateBatch until its status is `ready`. EasyPost-only — ShipStation stores rate-shop one order at a time via getShippingRates.\n`signature_confirmation` / `insured_value` behave as on getShippingRates, with one difference in scope: a value in the body applies to **every** order in the batch, and left out, each order takes its own default. Each order's result says what it was rated with.\nEach order's parcel is resolved as for getShippingRates (saved sealed size, then the shipping rules' package, then the built-in) unless the body carries an explicit `parcel`, which applies to every order. Any order that resolves to a package with no size refuses the whole batch 422 `parcel_required`, with `params.order_uuids` naming every such order. To change one order's USPS machinable flag, rate it through getShippingRates.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "parcel": {
                    "$ref": "#/components/schemas/Parcel"
                  },
                  "from_address": {
                    "$ref": "#/components/schemas/Address"
                  },
                  "signature_confirmation": {
                    "$ref": "#/components/schemas/SignatureConfirmationRequest"
                  },
                  "insured_value": {
                    "$ref": "#/components/schemas/InsuredValueRequest"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Batch submitted; not yet rated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateBatchStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`order_not_found`: some of the requested orders are not this store's orders. The whole batch is refused, and `missing` lists every requested id that was not found.\n",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "Validation failed, or an order needs a package size (`parcel_required`, with `params.order_uuids` naming every such order): send an explicit `parcel`. `customs_required` when an order ships to an APO/FPO/DPO military address and its customs form cannot be filed, with `params.reasons` for the first such order and `params.order_uuids` naming every one; `parcel_required` is answered first when both apply. `signature_required` when the order's marketplace requires a signature (TCGplayer at $250+) and the request would quote or buy without one.\n",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "params": {
                          "$ref": "#/components/schemas/ParcelRequiredParams"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/orders/shipping/rate-batches/{rate_batch_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "rate_batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getRateBatch",
        "tags": [
          "Shipping"
        ],
        "summary": "Poll a bulk rate batch",
        "description": "Returns the batch's current status. While EasyPost is still rating, `status` reflects EasyPost's own batch state (e.g. `creating`) and `rates` is absent; once rated, `status` is `ready` and `rates` carries one entry per order with its EasyPost shipment id and available rates (same shape as getShippingRates). Cached after the first ready poll, so repeat polls don't re-hit EasyPost. Each entry's `parcel` is the parcel that order was quoted in, and each of its carrier `rate_id`s carries it to the buy, as on getShippingRates.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Rate batch status (and rates, once ready)",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateBatchStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/label-batch": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "createLabelBatch",
        "tags": [
          "Shipping"
        ],
        "summary": "Buy many orders' shipping labels as one server-side job (max 100)",
        "description": "Moves what used to be N client-orchestrated `POST .../orders/{order_uuid}/shipping/label` calls, paced in the browser, into one async job: the server loops the batch itself and survives the tab being closed mid-run. Each order in the batch is purchased through the exact same logic as the single-order route — same order lock, TOCTOU re-check, substitution-ack/hold/tracking gates, and persistence — so a purchase made through this route is indistinguishable from one made through the single-order route, except that partial failures here don't abort the rest of the batch.\n\nReturns immediately with a `label_batch_uuid`; poll `getLabelBatch` for progress and per-order outcomes. This endpoint only validates the request shape (non-empty, under the cap, every order exists in this store) — the purchasability of each individual order (status, holds, acks, tracking) is checked for real when the job actually buys it, and a refusal there is reported per-order in `results`, not as a 4xx on this call.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "orders"
                ],
                "properties": {
                  "orders": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "$ref": "#/components/schemas/LabelBatchOrderEntry"
                    }
                  },
                  "run_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional correlation id (e.g. a fulfillment run) so a reopened Ship Review can find the in-flight batch for its run. Not validated against `fulfillment_runs` — a bare correlation id, not a foreign key.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "503": {
            "description": "`label_batch_queue_unavailable`: the batch was saved but couldn't be started. Retry with the same Idempotency-Key.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Batch accepted; not yet purchased",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelBatchStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "One or more `order_uuid`s were not found in this store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/label-batch/{label_batch_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "label_batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getLabelBatch",
        "tags": [
          "Shipping"
        ],
        "summary": "Poll a bulk label-purchase batch",
        "description": "Returns the batch's live status, progress counters, and per-order `results` as purchased so far — the response IS the live job row, unlike the rate batch there is no external state to re-fetch. A result's `outcome` is `purchased` (with `shipment_uuid` — fetch that shipment's `label_url` the normal way) or `failed` (with `error`).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Label batch status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelBatchStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/label-batch/{label_batch_uuid}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "label_batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "cancelLabelBatch",
        "tags": [
          "Shipping"
        ],
        "summary": "Cancel a pending or running label-purchase batch",
        "description": "Cooperative only — the worker checks between orders and stops as soon as it notices, but a purchase call already in flight always finishes (no forced mid-purchase abort). 409 if the batch already reached a terminal state.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Batch cancelled",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelBatchStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/shipping/scan-forms/eligible": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listScanFormEligibleOrders",
        "tags": [
          "Shipping"
        ],
        "summary": "Orders whose labels can go on a USPS SCAN form",
        "description": "One entry per label bought since `since` that can still go on a SCAN form: bought through ShipStation (any carrier) or through EasyPost or Shippo with USPS, tracked as a package, not voided and not on another form. An order with two such labels appears twice. `untracked_count` counts the store's other live labels since `since` that have no package tracking (letters and stamps, including a USPS letter whose only number is its Intelligent Mail barcode); they can't go on a form and don't need one. A label on a carrier its provider can't put on a form (e.g. UPS through EasyPost) is neither listed nor counted. `since` is the client's local midnight, since a form is made on its labels' own day.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": true,
            "description": "ISO-8601 time with a UTC offset, at most 7 days ago (e.g. `2026-10-30T00:00:00-04:00`).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The labels that can go on a form",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanFormEligibleList"
                }
              }
            }
          },
          "400": {
            "description": "`since` is missing or not a time with an offset (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`since` is more than 7 days ago (`query_param_invalid`); carriers refuse labels that old.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/scan-forms": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listScanForms",
        "tags": [
          "Shipping"
        ],
        "summary": "The store's USPS SCAN forms, newest first",
        "description": "Every form the store has made through HippoLink, with its orders. Never asks the carrier, so a form still `creating` reads as it was last seen; read it with `getScanForm` to refresh it.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of forms",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedScanFormList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createScanForms",
        "tags": [
          "Shipping"
        ],
        "summary": "Make USPS SCAN forms from the chosen orders' labels",
        "description": "Each named order (or RI, for a TCGplayer Direct hub parcel) resolves to its live, tracked package labels a SCAN form takes (ShipStation, or EasyPost or Shippo with USPS), and those go on new forms made through the store's own carrier account. A SCAN form is one barcode the post office scans to accept every label on it. Free on both providers.\n\nOne form per provider per chunk (500 labels for ShipStation, 1,000 for EasyPost); ShipStation may split a chunk further, by carrier, ship-from address or ship date, and each piece is its own form. A label goes on at most one form. A form comes back `ready` (with `document_url`, a short-lived PDF link; read the form again for a fresh one), `creating` (poll `getScanForm`), or `failed` with `error_code` / `error_detail`, its orders free to go on another.\n\nBoth carriers want a form made on its labels' own day, and USPS before 9 pm local time. Not atomic across providers: when one provider refuses and the other makes its form, the answer is 200 with the refused form `failed`. When nothing was made, the first refusal is the answer. A carrier 5xx or a lost connection is not a refusal: the carrier may have made the form anyway, so that form stays `pending` with its orders held (`error_code` scan_form_outcome_unknown) until the carrier's own list settles it; `getScanForm` and `listScanFormEligibleOrders` do that.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScanFormsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The forms made, being made, or refused",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanFormList"
                }
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON or a JSON object (`request_body_invalid_json`, `request_body_invalid`), or the Idempotency-Key header is missing (`missing_idempotency_key`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`scan_form_order_taken`: another request put some of these orders' labels on a form a moment ago; `params.orders` names them. Reload the list and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "Nothing was made because the carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`validation_error` for the body. `scan_form_order_ineligible` when an order has nothing to put on a form: `params.orders` lists each with its `reason` (on_form, untracked, provider_unsupported, carrier_unsupported, voided, no_label or not_found) and nothing is made. `scan_form_rejected` when the carrier refused and nothing was made; `detail` is the carrier's own sentence when it sent one.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/scan-forms/{scan_form_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "scan_form_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getScanForm",
        "tags": [
          "Shipping"
        ],
        "summary": "One USPS SCAN form, refreshed from the carrier while it is being made",
        "description": "A form still `creating` is re-read from the carrier, so poll this every few seconds until it is `ready` or `failed`. A form whose create answer was lost is looked up in the carrier's own list and either adopted or failed with `scan_form_not_created`. `document_url` is a short-lived link; read the form again for a fresh one. `voided_count` counts the labels on the form voided since it was made: keep those parcels out of the pile, because the post office looks for every label on it.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The form",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`scan_form_not_found`: no such form in this store.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shipping/label": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "purchaseShippingLabel",
        "tags": [
          "Shipping"
        ],
        "summary": "Purchase a bubble mailer shipping label",
        "description": "Purchases a shipping label for the selected rate from a prior getShippingRates call. Used for bubble mailer shipments where the user rate-shops before purchasing (bubble_mailer is the only tier that buys a real tracked label). Auto-advances order to shipped if currently processing, or to `label_purchased` when the order's fulfillment run is at Package Sort (the marketplace is told at the run's Mark all as shipped). Idempotent — returns 409 if a label has already been purchased for this order. rate_id may also be one of the synthetic options from getShippingRates: the stamp option (`hippolink_pkg_physical_postage`, the retired `hippolink_pkg_pwe_1oz` / `_pwe_2oz` / `_large_letter`, or the legacy `hippolink_pwe` alias — all resolve to the same tier) records an estimate-only, label-less shipment at $0.00 (the seller applies physical postage — no EasyPost call, no tracking), and `hippolink_pickup` records a $0.00 local-pickup fulfillment. For all synthetic options, easypost_shipment_id is ignored.\nSignature confirmation and insurance are not requested here. The `rate_id` carries whatever add-ons its rate was quoted with (see getShippingRates), so pass it back unmodified; the returned Shipment reports what the label was bought with.\nNeither label-less option can fulfil an order that requires tracking (TCGplayer at $50+, or a ManaPool order whose buyer bought a tracked tier — #2238): both are rejected 422 (`tracking_required`), naming which one was tried. Pickup is gated on that rule as well as on the stamp path because it would otherwise be the way around it — the same order, the same end state of shipped-with-no-tracking, reached through a different rate_id.\nSeparately, `hippolink_pickup` on a TCGplayer order is rejected 422 (`marketplace_pickup_unsupported`) at any value. That one is about the handover rather than the tracking — the buyer is never walking in — so entering tracking does not resolve it, and it is reported in preference to the tracking refusal when both apply.\nA CardTrader Zero invoice's order_uuid buys its hub parcel's label (#1926) — the one case where this does **not** ship the order: it records the shipment and the hub tracking, and the parcel ships when the invoice settles. See `CardTraderZeroFulfillRequest.shipment_uuid`.\nThe parcel bought is the one the rate was quoted in: every carrier `rate_id` from getShippingRates or getRateBatch carries it and its USPS machinable flag (#3537), and it wins over a body `parcel` and over the store's shipping rules as they stand now. The shipment records it with its `source` and `machinable`, and a `manual` parcel on an order that is one sealed product alone is remembered for that product and quantity. Only a `rate_id` issued before the parcel travelled with it falls back to resolving the parcel as getShippingRates does, from the optional body `parcel`; for that one an order that needs a package size and sent no `parcel` is refused 422 `parcel_required`, and a `letter` or `flat` `parcel` under an add-on is refused 422 on `parcel.package_type`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rate_id"
                ],
                "properties": {
                  "rate_id": {
                    "type": "string",
                    "description": "The selected rate_id from the getShippingRates (or getRateBatch) response, unmodified. Opaque for every carrier: it carries the add-ons and the parcel it was quoted with.\n"
                  },
                  "shipping_provider": {
                    "type": "string",
                    "enum": [
                      "easypost",
                      "shipstation",
                      "pitneybowes",
                      "shippo",
                      "clickship"
                    ],
                    "default": "easypost",
                    "description": "The carrier the rate was shopped under, echoed from the getShippingRates response. Defaults to easypost.\n"
                  },
                  "easypost_shipment_id": {
                    "type": "string",
                    "description": "EasyPost shipment id from getShippingRates. Only consulted when the rate_id carries no shipment of its own (a rate list fetched before rate ids became composite); a composite EasyPost rate_id is authoritative over it. Omit for ShipStation and Pitney Bowes.\n"
                  },
                  "label_format": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/LabelFormat"
                      }
                    ],
                    "default": "PNG",
                    "description": "Desired label image format (EasyPost only; ShipStation returns a PDF).\n"
                  },
                  "parcel": {
                    "description": "Only read when `rate_id` carries no parcel of its own (a rate list fetched before the parcel travelled in the rate id); ignored otherwise.\n",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Parcel"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "201": {
            "description": "Label purchased",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A shipment already exists for this order, or `at_cardchaos` when the order has a line queued or on a CardChaos picklist (also after picking is turned off, until CardChaos accepts the recall): pick it in CardChaos, or recall it first with Pick in HippoLink instead (`POST .../orders/{order_uuid}/cardchaos-recall`). The `at_cardchaos` check runs before the carrier is charged and again when the purchase is recorded; a race with enabling picking can still refuse after the label is bought, as the other in-transaction checks can.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "order_uuids": {
                          "type": "array",
                          "description": "The order, present with `error` `at_cardchaos`.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable. Beyond the ordinary validation and status refusals, three coded ones: `tracking_required` (a stamp tier on an order over its marketplace's tracking threshold), `marketplace_shipping_unsupported` (a **kiosk** order, which was placed from inside the shop and carries no shipping address — every rate is refused except `hippolink_pickup`, which is how it is handed over), and `parcel_required` (a rate id carrying no parcel, on an order that needs a package size and sent no body `parcel`). Neither of the first two is resolved by entering a tracking number. `signature_required` when the order's marketplace requires a signature (TCGplayer at $250+) and the request would quote or buy without one.\n",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "params": {
                          "$ref": "#/components/schemas/ParcelRequiredParams"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/shipping/labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "generateBatchShippingLabels",
        "tags": [
          "Shipping"
        ],
        "summary": "Merge many orders' shipping labels into one printable PDF (max 200)",
        "description": "Merges one label per requested order into a single PDF and returns a link to it, in request order. An order that bought a carrier label contributes that label, downloaded from the carrier and merged at its own page size; an order with a label-less shipment (stamp/PWE, local pickup) contributes the same 4x6 envelope address label `generateBatchEnvelopeLabels` renders. Orders with no live shipment -- never bought postage, or had the label voided -- contribute nothing.\n\nThe merge is server-side because a browser cannot do it. Carrier label URLs are cross-origin and send no `Access-Control-Allow-Origin`, so page script cannot read the bytes; and a PDF displayed in an iframe is not painted into the parent document's print output, so a print window full of label iframes prints one blank page per label.\n\nThe result is a presigned link rather than a response body because a print run outgrows what API Gateway will carry: 200 image-format labels (EasyPost returns PNGs) merge to roughly 20 MB against a 6 MB response cap. The object expires after a day, and the link after an hour.\n\nDownloading is time-boxed to fit inside the request. Any order whose carrier label has not arrived when the budget runs out is left out and named in `skipped`, alongside any whose label could not be downloaded at all -- a seller with 200 labels to print should get the 190 that answered plus the names of the 10 that did not, not a timeout. Orders not in this store are a 404 for the whole request.\n\n**Ask again for the same run rather than for the leftovers.** Every label that downloads is cached under its shipment for a day, so repeating the request re-merges the whole run from cache and only pays for what is still missing. That returns one complete document with the pages still in the requested order, which a partial reprint of just the stragglers cannot do -- labels are picked in run order, and a straggler printed on its own lands out of sequence. A `skipped` entry with reason `timed_out` is worth repeating for; `unavailable` means the link is dead and repeating will not help.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "`label_download_unavailable`: the labels couldn't be prepared for download. Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Merged shipping label PDF, ready to download",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingLabelBatch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shipping/envelope": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "purchaseEnvelopeLabel",
        "tags": [
          "Shipping"
        ],
        "summary": "Fulfill as a plain white envelope (one-shot, estimate-only)",
        "description": "Records a plain white envelope fulfillment in a single round trip — no rate shopping step required. As of #1015 this is the estimate-only `physical_postage` stamp tier: it marks the order shipped at $0.00 with NO tracked label (the seller applies physical postage); it does not call EasyPost. Auto-advances order to shipped if currently processing, or to `label_purchased` when the order's fulfillment run is at Package Sort. Idempotent — returns 409 if a shipment already exists. Rejected with 422 (`tracking_required`) only when the order requires tracking: TCGplayer at $50 and above, where a stamp has nothing to attach and the marketplace would refuse the ship, or a ManaPool order whose buyer bought a tracked tier (#2238), where the marketplace accepts the untracked ship and nothing but this refusal ever notices. Buy a carrier label or enter tracking manually instead. That is the same error code updateOrder returns for the same refusal, so a client can offer manual tracking entry off one code. Otherwise this is the ordinary path for a TCGplayer or ManaPool letter order, which is marked shipped with no tracking at all.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label_format": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/LabelFormat"
                      }
                    ],
                    "default": "PNG",
                    "description": "Desired label image format"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Envelope label purchased",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A shipment already exists for this order, or `at_cardchaos` when the order has a line queued or on a CardChaos picklist (also after picking is turned off, until CardChaos accepts the recall): pick it in CardChaos, or recall it first with Pick in HippoLink instead (`POST .../orders/{order_uuid}/cardchaos-recall`).\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "order_uuids": {
                          "type": "array",
                          "description": "The order, present with `error` `at_cardchaos`.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shipping": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "getShipment",
        "tags": [
          "Shipping"
        ],
        "summary": "Get shipment details and tracking",
        "description": "Returns shipment details including tracking status and event history from EasyPost.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Shipment details with tracking",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/shipping/void": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "post": {
        "operationId": "voidShippingLabel",
        "tags": [
          "Shipping"
        ],
        "summary": "Void a shipping label",
        "description": "Refunds the shipping label at the carrier that sold it, then reverts the order to `processing` so it can be re-shipped. A label-less shipment (local pickup, or an estimate-only stamp tier) has no carrier behind it and is voided locally.\n\nReturns 409 when the shipment is already in transit (`shipment_already_shipped`, or a plain in-transit message from the local pre-check) or when the carrier refuses the refund outright (`carrier_void_refused`). Only `carrier_void_refused` is recoverable: some postage is non-refundable by nature — a USPS digital stamp bought as `usps_first_class_mail` on an untracked letter or flat — so the carrier will never take it back and the order would otherwise be stuck behind a label it can never ship past. Retry with `force: true` to discard the label locally and free the order. The postage is forfeited; say so before offering the retry.\n\nThe void is recorded on the order's history, and makes no marketplace call. When the marketplace was already told the order shipped, `marketplace_still_shipped` says so; show its `detail` to the seller.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoidShippingLabelRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Label voided",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoidShippingLabelResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/shipping/easypost": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getEasyPostConnectionStatus",
        "tags": [
          "Shipping"
        ],
        "summary": "Get this store's EasyPost connection status.",
        "description": "Returns whether the store has an active EasyPost connection. No credential material is included in the response.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EasyPostConnectionStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/shippo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShippoConnectionStatus",
        "tags": [
          "Shipping"
        ],
        "summary": "Get this store's Shippo connection status.",
        "description": "Returns whether the store has an active Shippo connection, and whether its token is a Shippo test token. No credential material is included in the response.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippoConnectionStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/clickship": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getClickShipConnectionStatus",
        "tags": [
          "Shipping"
        ],
        "summary": "Get this store's ClickShip connection status.",
        "description": "Returns whether the store has an active ClickShip (Freightcom) connection and which payment method its labels are bought with. Reads only the stored row; no Freightcom call.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClickShipConnectionStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/shipstation": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShipStationConnectionStatus",
        "tags": [
          "Shipping"
        ],
        "summary": "Get this store's ShipStation connection status.",
        "description": "Returns whether the store has an active ShipStation connection. No credential material is included in the response.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShipStationConnectionStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/integrations/cardchaos": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getCardChaosConnection",
        "tags": [
          "Integrations"
        ],
        "summary": "Get this store's CardChaos connection.",
        "description": "Whether the store is linked to a CardChaos account, and which account. No credential material is included. `cutover_enabled` reports whether cutover is switched on for this environment.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosConnection"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardchaos/sync": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "startCardChaosSync",
        "tags": [
          "Integrations"
        ],
        "summary": "Start a CardChaos sync.",
        "description": "Pulls a snapshot of the linked CardChaos account (inventory, box/bin layout and cost) and applies it according to `mode`. `{store_uuid}` is the store that holds the CardChaos connection, and the job's only store.\n\n- `preview` writes nothing and reports what a cutover would do, including\n  anything that would block it.\n\n- `cutover` writes CardChaos's inventory, layout and cost into the store. It\n  runs once, and only into an empty store: any stock, open cost lot or order\n  blocks it (`store_not_empty`). Starting one is limited to the store owner\n , and only while cutover is enabled for the environment (403 otherwise).\n  An API key can never start one (403 `cardchaos_cutover_web_only`); run it from\n  the web app.\n\n- `test_import` writes the same inventory, layout and cost as `cutover` from a\n  CardChaos preview export, for checking the result in HippoLink. CardChaos is\n  never frozen or locked, the store is not marked cut over, and nothing is\n  pushed to marketplaces. Starting one is limited to administrator\n  users, and only where `test_import_enabled` is true (403 `cardchaos_test_import_disabled`\n  otherwise). It needs an empty store, like a cutover, so repeating one takes a\n  new store.\n\n\n`cutover` and `test_import` take an optional `target` naming where the CardChaos boxes go. It is checked before the job exists: a malformed or unusable target is a 422 `invalid_target`, and so is a target sent with `preview`.\n\nThe job runs asynchronously; poll `getCardChaosSyncJob`. Only one sync runs per store at a time (409), unless the running one has made no progress for 20 minutes, in which case it is failed and replaced.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardChaosSyncRequest"
              }
            }
          }
        },
        "responses": {
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Job queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosSyncJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller may not start this sync: `cardchaos_cutover_web_only` for a cutover asked for with an API key, `cardchaos_cutover_disabled` for a cutover while the environment has it switched off, `permission_denied` for a cutover by anyone but the store owner or a sys admin, or `cardchaos_test_import_disabled` for a test import (not a sys admin, or the environment has it switched off). Otherwise the store access check refused it.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The store is not connected to CardChaos, or already has a sync running.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "The request failed validation. `invalid_target` (field `target`, `target.location_uuid` or `target.new_location_name`) means the import target is malformed, names a location that is not a live container in this store, or was sent with a `preview`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "operationId": "listCardChaosSyncJobs",
        "tags": [
          "Integrations"
        ],
        "summary": "List this store's CardChaos syncs, newest first.",
        "description": "Every sync started from this store.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of sync jobs.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosSyncJobList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardchaos/sync/{job_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "job_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getCardChaosSyncJob",
        "tags": [
          "Integrations"
        ],
        "summary": "Get one CardChaos sync job.",
        "description": "Progress, counts, the preview (for `preview` jobs and blocked cutovers) and any error. 404 unless the job was started from this store.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosSyncJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardchaos/push": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "startCardChaosPush",
        "tags": [
          "Integrations"
        ],
        "summary": "Push bins to CardChaos.",
        "description": "Writes HippoLink bins into CardChaos as whole-bin contents: each bin's box (its container, or a per-store `HippoLink` box) and bin are created in CardChaos when missing, then the bin's contents are replaced with HippoLink's rows in shelf order. No cost is sent.\n\n- `import_job`: the bins a completed import wrote to (`import_job_uuid`).\n- `all`: every bin with stock, plus every bin already linked to CardChaos.\n- `locations`: the listed bins (`location_uuids`, up to 500).\n\nRuns asynchronously; poll `getCardChaosPushJob`. Bins CardChaos cannot take right now (a copy on a picklist) are retried up to three times, five minutes apart, and then reported in `errors`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:write`.\n\n**Cost:** 10 rate-limit tokens.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardChaosPushRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field), or the request breaks a rule of this route (named by its `error` code, for example `import_mode_unsupported`, `sync_columns_fixed`, `invalid_bin_name_template`, `scope_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "Push queued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosPushJob"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The store is not connected to CardChaos, or the import has not completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cardchaos/push/{push_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "push_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getCardChaosPushJob",
        "tags": [
          "Integrations"
        ],
        "summary": "Get one CardChaos push.",
        "description": "Status, counts and per-bin errors. 404 unless the push belongs to this store.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The push.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardChaosPushJob"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listCostBatches",
        "tags": [
          "Inventory"
        ],
        "summary": "List the store's cost batches, newest first.",
        "description": "A cost batch is a purchase bought for one total whose cards are added over time. While a batch is `open` its cards carry a provisional cost; finishing it spreads the total across every card it ever held. Each row reports the batch's copies (received and still on hand), their provisional total, and any external units (cards sold before they reached HippoLink, which weight the spread but get no cost). Store-configurable (`inventory.view_cost_batches`): managers and owners by default; a store owner can grant it to employees.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "finishing",
                "finished"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of cost batches.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "post": {
        "operationId": "createCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Create a cost batch.",
        "description": "Creates an `open` batch. Add cards to it from an inventory import (`cost_batch_uuid` on `importInventory`), from a completed import (`assignImportToCostBatch`), or by manual intake (`cost_batch_uuid` on an intake item).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCostBatchRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new batch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Get one cost batch.",
        "description": "Status, copies, provisional total, opened sealed product (`sealed_pool`, `sealed_units`, `sealed_sources`), external units, the total prefill (`total_cost`: CardChaos's total for a migrated batch, null when it was encrypted), and the finish's progress (`finish_started_at`, `finish_error`). Store-configurable (`inventory.view_cost_batches`): managers and owners by default; a store owner can grant it to employees.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The batch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "patch": {
        "operationId": "updateCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Rename a cost batch, or edit its notes or what you paid.",
        "description": "Only while the batch is `open` (409 `cost_batch_not_open` otherwise). While an import or revert into the batch is running it holds the batch, and after a 3-second wait this is a 409 with `error: \"cost_batch_busy\"`; try again shortly. 422 `total_below_sealed_pool` (`params.sealed_pool`) when `total_cost` is below the opened sealed cost.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCostBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated batch.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatch"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "delete": {
        "operationId": "deleteCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Delete an empty cost batch.",
        "description": "Only an `open` batch with no cards, no external units, no opened sealed product and no import still running into it (409 otherwise: it holds cards or opened sealed product). While an import or revert into the batch is running it holds the batch, and after a 3-second wait this is a 409 with `error: \"cost_batch_busy\"`; try again shortly.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/cards": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listCostBatchCards",
        "tags": [
          "Inventory"
        ],
        "summary": "List the cards in a cost batch.",
        "description": "One row per inventory lot in the batch, ordered by card name (a SKU the catalog cannot name sorts last), then `tcgplayer_sku_id`, then the date the lot was received, then `lot_id`, with each lot's copies (received and still on hand), its current unit cost and where that cost came from (`cost_basis_source`: `batch_pending` while the batch is open, `cost_batch` once it is finished). `unit_cost` is provisional while the batch is open, may be mid-rewrite while it is `finishing`, and is final once it is `finished`. External units (cards sold before they reached HippoLink) are not listed here and not counted in `total`; `external_units_total` says how many there are, and `listCostBatchExternalUnits` pages them. Works for any batch status. 404 `cost_batch_not_found` for a batch that is not this store's. Store-configurable (`inventory.view_cost_batches`): managers and owners by default; a store owner can grant it to employees.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of the batch's cards, and how many external units it has.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchCardList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/cards/remove": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "removeCostBatchCards",
        "tags": [
          "Inventory"
        ],
        "summary": "Take cards out of an open cost batch.",
        "description": "\"Remove from batch\" (#4163): each named lot (`lot_id` from `listCostBatchCards`) leaves the batch whole, so the finish no longer gives it a share of the total, and the cards left in the batch are re-spread. A lot with copies still on hand takes `unit_cost` (default 0) as its cost, with `cost_basis_source` `manual`. A lot with nothing left takes `unit_cost` (source `manual`) when one is sent (0 counts). Without one, a lot with nothing left that has sold copies is refused (its sales need a cost), and one that never sold keeps the cost and source it has. Copies already sold from a removed lot are costed at the lot's resulting cost now, the way the finish would have costed them, unless the sale also drew from a lot still in an unfinished batch. All or nothing. 404 `cost_batch_not_found` for a batch that is not this store's; 409 `cost_batch_not_open` when the batch is `finishing` or `finished`, `cost_batch_busy` when an import, a revert or an order holds the batch or its cards (try again shortly); 422 `cost_batch_lot_not_member` (`params.lot_ids`: the lots not in this batch), `cost_batch_lot_cost_required` (`params.lot_ids`: lots with nothing left and sold copies, sent without `unit_cost`; send the cost those sold copies should carry) and `validation_error` for a malformed body (including a `lot_id` above 2147483647).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CostBatchRemoveCardsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many lots left the batch, and the batch as it now stands.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchRemoveCardsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/external-units": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "listCostBatchExternalUnits",
        "tags": [
          "Inventory"
        ],
        "summary": "List the external units of a cost batch.",
        "description": "Copies of the batch's cards sold before they reached HippoLink (CardChaos sales). They weigh in the finish but are never stocked. CardChaos writes one row per sold SKU, so a large batch can have thousands; they are paged like the cards, ordered by card name (a SKU the catalog cannot name sorts last), then `tcgplayer_sku_id`. Works for any batch status. 404 `cost_batch_not_found` for a batch that is not this store's. Store-configurable (`inventory.view_cost_batches`): managers and owners by default; a store owner can grant it to employees.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of the batch's external units.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchExternalUnitList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/finish/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "previewCostBatchFinish",
        "tags": [
          "Inventory"
        ],
        "summary": "Preview finishing a cost batch.",
        "description": "Read-only. Spreads `total_cost` across every unit the batch ever held -- its cards and the cards sold before they reached HippoLink -- by TCGplayer market price (Near Mint for a Near Mint card, Lightly Played otherwise; an unpriced card takes the batch's average, and with nothing priced every copy weighs the same). Returns the totals, the first 500 cards with their new unit cost, how many cards fell back to the average or an equal split, the share the sold-before-HippoLink cards absorb, and how many past orders the finish would re-cost and by how much their gross profit would change. The preview is a snapshot: it reflects prices and cards as of now, and a finish run later can differ when prices refresh (every 12 hours) or cards are added to the batch in between. Also returns `sealed_pool` (the cost of opened sealed product), `extra_cost` (`total_cost` less the pool) and the live `sealed_sources`; `total_cost` defaults to the batch's, and 422 `total_below_sealed_pool` when it is below the pool. Accepts the batches a finish can start on: an open batch, or one still `finishing` more than 30 minutes after its finish started (a stuck finish); 409 `cost_batch_not_open` otherwise. 422 `invalid_total_cost` when no total is sent and the batch has no stored total.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CostBatchFinishRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "What the finish would do.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchFinishPreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/finish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "finishCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Finish a cost batch.",
        "description": "Moves an `open` batch to `finishing` and queues the finish; poll `getCostBatch` until `status` is `finished` (or `open` again with `finish_error`). The finish, in one transaction, sets every card's cost from the spread `previewCostBatchFinish` shows and **rewrites the cost of every past sale of those cards** -- order line COGS, order COGS and gross profit -- then locks the batch. The spread uses the prices and cards at the time the finish runs, so it can differ from an earlier preview when prices refresh (every 12 hours) or cards are added in between. 409 `cost_batch_not_open` when the batch is finishing or finished, 409 `cost_batch_busy` (after a 3-second wait) while an import is still adding cards to it, 422 `cost_batch_empty` when it holds no cards, 422 `invalid_total_cost` for a total that is not a positive amount of cents, 422 `total_below_sealed_pool` (`params.sealed_pool`) for a total below the opened sealed cost. `invalid_total_cost` is also returned when no total is sent and the batch has no stored total.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CostBatchFinishRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "The job couldn't be queued (`job_queue_unavailable`) or file storage didn't answer (`file_storage_unavailable`). Nothing was started; try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "202": {
            "description": "The batch, now `finishing`.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/sealed-sources/plan": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "planSealedOpening",
        "tags": [
          "Inventory"
        ],
        "summary": "Plan opening sealed product into a cost batch.",
        "description": "Read-only. Lists the bins holding the sealed SKU and how many copies are available. With `units`, also returns the prefilled `split` (copies taken in sale shelf order), the `released_cost` those copies carry out of stock (costed units only) and `uncosted_units`, the copies with no recorded cost; the dialog asks for a cost before confirming when it is above zero. Needs `inventory.manage_items` as well (403 otherwise). 404 `cost_batch_not_found` / `location_not_found`; 409 `cost_batch_not_open` / `sealed_source_unsettled`; 422 `not_sealed_product` / `stock_insufficient` / `invalid_sealed_request`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "tcgplayer_sku_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plan.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchSealedPlan"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/sealed-sources": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "openSealedIntoCostBatch",
        "tags": [
          "Inventory"
        ],
        "summary": "Open sealed product into an open cost batch.",
        "description": "Takes `units` copies of a sealed SKU out of stock and adds their cost to the batch's `total_cost`; the cards pulled from the pack are added to the batch separately. The copies leave stock FIFO, so the released cost is the cost of the oldest lots, added to `total_cost` and held in the batch's `sealed_pool`. `locations` is the split from `planSealedOpening` (it must add up to `units`); leaving it out takes copies in sale shelf order. `unit_cost_override` costs copies that carry no recorded cost. Needs `inventory.manage_items` as well (403 otherwise). 404 `cost_batch_not_found` / `location_not_found`; 409 `cost_batch_not_open` / `cost_batch_busy` (after a 3-second wait) / `holding_location_locked` / `sealed_source_unsettled`; 422 `not_sealed_product`, `stock_insufficient` (`params.available`, or `params.location_uuid` and `params.on_hand` for a named bin), `sealed_cost_required` (`params.uncosted_units`: send `unit_cost_override`) and `invalid_sealed_request` (`validation_errors`).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CostBatchSealedOpenRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The batch and the sources written.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchSealedOpenResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cost-batches/{batch_uuid}/sealed-sources/{source_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "batch_uuid",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "source_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64"
          }
        }
      ],
      "delete": {
        "operationId": "unopenCostBatchSealedSource",
        "tags": [
          "Inventory"
        ],
        "summary": "Un-open a sealed source, returning its copies to stock.",
        "description": "Reverses one opening: the copies go back into stock at their location and the released cost leaves the batch's `sealed_pool` and `total_cost`. Needs `inventory.manage_items` as well (403 otherwise). 404 `sealed_source_not_found` (also for a malformed `source_id`), `cost_batch_not_found`, or `location_not_found` (the bin the units came from no longer exists); 409 `sealed_source_reverted` (already un-opened), `cost_batch_not_open`, `cost_batch_busy` (after a 3-second wait) or `sealed_unopen_failed` (stock intake refused the copies; the message says why).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The batch and the source, now reverted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CostBatchSealedUnopenResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/catalog": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShippingCatalog",
        "tags": [
          "Shipping"
        ],
        "summary": "The carriers and services this store can actually ship with.",
        "description": "Read from the store's own connected carrier account, never hardcoded — which carriers appear depends on which accounts *this store* connected, so there is nothing correct to hardcode client-side and nothing a global sync could compute. Replaces a hand-maintained list in the frontend that drifted three times.\n\nEvery `service_code` here is the same vocabulary a `ShippingRate` carries, which is what makes a rule authored from this catalog match a quoted rate.\n\nCached for 24h on the store's credential record and refreshed lazily, so the common case costs no upstream call. Pass `refresh=true` to force one. If the provider is unreachable and a cached copy exists, that copy is returned with `stale: true` rather than failing — a day-old service list beats an empty picker.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Bypass the cache and re-read from the provider."
          }
        ],
        "responses": {
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The store's carrier/service catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingCatalog"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "412": {
            "description": "The stored carrier credential was refused; reconnect it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/shipstation/services": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShipStationAvailableServices",
        "tags": [
          "Shipping"
        ],
        "summary": "List this store's connected ShipStation carriers and their service codes.",
        "description": "Proxies the store's own connected ShipStation account (GET /v2/carriers) so the allow-list picker (#1533) has something to render checkboxes against — no ShipStation account-owner access is needed beyond what the store already connected. 404 if the store has no active ShipStation connection; 503 when ShipStation can't be reached (an empty list would wrongly say the account has no services).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "422": {
            "description": "ShipStation rejected the stored API key (`shipstation_auth_failed`). Reconnect ShipStation.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "ShipStation sent back something we couldn't read (`shipstation_bad_response`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "ShipStation couldn't be reached or is rate limiting us (`shipstation_unavailable`, `shipstation_rate_limited`). Try again in a moment.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "ShipStation took too long to answer (`shipstation_timeout`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Connected carriers and their service codes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShipStationAvailableServices"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/pitneybowes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getPitneyBowesConnectionStatus",
        "tags": [
          "Shipping"
        ],
        "summary": "Get this store's Pitney Bowes connection status.",
        "description": "Returns whether the store has an active Pitney Bowes connection (and the USPS carrier account id labels are bought on). No credential material is included in the response.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PitneyBowesConnectionStatus"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/provider": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShippingProvider",
        "tags": [
          "Shipping"
        ],
        "summary": "Get the store's active shipping provider.",
        "description": "Returns which carrier backs the order rate-shop + label-purchase flow — `easypost` (default), `shipstation`, `pitneybowes`, or `shippo`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active provider.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShippingProviderSelection"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplace-fees": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listMarketplaceFeeConfigs",
        "tags": [
          "Marketplace Fees"
        ],
        "summary": "List this store's per-marketplace fee configuration.",
        "description": "Returns the seller-configured credit-card and platform (marketplace commission) fee formulas for each marketplace. HippoLink's own fee is derived from the store's billing tier and is not included here.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Per-marketplace fee configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceFeeConfigList"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listShippingRules",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "List all shipping rules for a store",
        "description": "Lists the store's shipping rules in priority order (ascending), each with its name, conditions, action, and enabled state, plus an ETag. Store employees may read them: the order page's package presets are the rules that set a package (#3537). Also returns `global_rules`, HippoLink's read-only marketplace requirements for the store's connected marketplaces.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of rules to return (1-250). Defaults to 100, not the usual 50, because the ruleset is replaced whole by `replaceShippingRules`: a client that reads a page and writes it back drops every rule past that page, so send `limit` 250 or page through `total` before replacing.\n",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` or `offset` was below its minimum (`query_param_invalid`). A `limit` above 250 is not refused: it is capped at 250.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Shipping rules for the store ordered by priority",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedShippingRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceShippingRules",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "Replace the entire shipping rule set atomically",
        "description": "Replaces all existing shipping rules with the provided set. Rules are evaluated in priority order (ascending). Existing rules not included in the array are deleted. An item carrying the `rule_uuid` of one of the store's rules updates that rule in place and keeps its id. Any other item, including one whose `rule_uuid` is not one of the store's rules or repeats an earlier item's, is created as a new rule. A store has at most 250 rules, the most one `listShippingRules` page returns, so the set can always be read back whole before it is replaced; more is a 422 on `rules`.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "$ref": "#/components/schemas/ShippingRuleInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Shipping rule set replaced. The body is the whole stored ruleset, never a page of it: `rules` holds every rule and `limit` equals `total`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedShippingRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/rules/{rule_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RuleUuid"
        }
      ],
      "delete": {
        "operationId": "deleteShippingRule",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "Delete a shipping rule",
        "description": "Deletes a shipping rule. Returns 204, or 404 if it does not exist.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Shipping rule deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/sealed-parcels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listSealedParcels",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "Saved sealed-product packages for the store",
        "description": "Lists the sizes the store has saved for sealed product, keyed by product and unit count. A saved size can be a letter, flat or package. They are saved when a label is bought with a manual parcel for a sealed-only order, and used by later orders of the same product and quantity.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` or `offset` was below its minimum (`query_param_invalid`). A `limit` above 250 is not refused: it is capped at 250.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Saved sealed-product packages for the store",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSealedParcelList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/sealed-parcels/{tcgplayer_product_id}/{quantity}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "name": "tcgplayer_product_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64"
          }
        },
        {
          "name": "quantity",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        }
      ],
      "delete": {
        "operationId": "deleteSealedParcel",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "Forget a saved sealed-product package",
        "description": "Deletes the saved package for this product and unit count. Returns 204, or 404 (`sealed_parcel_not_found`).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Saved package deleted",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No package is saved for this product and quantity (`sealed_parcel_not_found`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/shipping/saved-boxes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listSavedBoxes",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "The store's saved box sizes",
        "description": "Lists the store's saved boxes in their saved order, for the package-size form's Box dropdown. A box is a name and a length, width and height in inches, with no weight. The first read for a store that has never had a list writes the starter set (Bubble mailer 8 x 4 x 0.25, Small box 6 x 4 x 2, Medium box 8 x 6 x 4, Large box 12 x 9 x 4) and returns it; a store that has deleted every box gets an empty list. Store employees may read it: the order page needs it.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's saved boxes, in their saved order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedBoxList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceSavedBoxes",
        "tags": [
          "Shipping Rules"
        ],
        "summary": "Replace the store's saved boxes",
        "description": "Replaces the whole list with the boxes sent, in the order sent. An empty list deletes every box, and the starter set is not written again. Every box gets a new `box_uuid`; one sent on input is ignored. The last save wins (no ETag). Returns the stored list.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "boxes"
                ],
                "properties": {
                  "boxes": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "$ref": "#/components/schemas/SavedBoxInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The saved boxes as stored",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SavedBoxList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "`validation_error`, with every problem in `validation_errors` under `boxes` or `boxes[i].<field>`: more than 50 boxes, a name that is empty or over 60 characters after trimming, a name already used by another box in the list (ignoring case), or a dimension that is missing, not a number, 0 or less, or over 108.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/early-ship-rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listEarlyShipRules",
        "tags": [
          "Early Ship Rules"
        ],
        "summary": "List a store's early-ship rules",
        "description": "Lists the store's configured early-ship rules, sparse: an unconfigured (game, product_type) combination is simply absent from the array, not returned with early_ship_days 0 — absence itself means the store may not ship that category early for that game (or for any game, when no game-agnostic default row exists either). A rule with game null is the store's default for that product_type across every game it has not specifically overridden; a rule naming a game overrides the default for that game only.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's configured early-ship rules",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarlyShipRuleList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "replaceEarlyShipRules",
        "tags": [
          "Early Ship Rules"
        ],
        "summary": "Replace the store's entire early-ship rule set atomically",
        "description": "Replaces all of the store's existing early-ship rules with the provided set. Existing rules not included in the array are deleted. An empty array is a valid request and clears the store back to its hard-0 default (ship exactly on the catalog release date) for every game and category. At most one rule may be given per (game, product_type) pair — a game-agnostic default is `game: null`. Recomputes `hold_until` for the store's own pre-ship orders synchronously, so the new rules take effect immediately rather than waiting for the next daily recompute sweep. Owner-only: this is a store-wide fulfillment policy change, not a per-role-delegable action.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rules"
                ],
                "properties": {
                  "rules": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/EarlyShipRule"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Early-ship rule set replaced",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarlyShipRuleList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getOrderSettings",
        "tags": [
          "Orders"
        ],
        "summary": "Get the store's order settings",
        "description": "Returns `unfulfilled_alert_hours`, how long an order may sit unfulfilled before the store gets an `ORDERS_UNFULFILLED_AGING` banner. `null` means the reminder is off for this store, which is where every store starts. Also returns `document_layout`, the page layout invoices and packing slips use when a request does not name one, and `pick_list`: the store's pick-list layout (the default when it has never saved one), and the field catalog the layout designer builds from (#3090).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's order settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      },
      "put": {
        "operationId": "putOrderSettings",
        "tags": [
          "Orders"
        ],
        "summary": "Set the store's order settings",
        "description": "Partial update: a key absent from the body leaves its stored value alone, and a body with no recognised key is a 400. An explicit `null` is a real value here rather than \"unset\" — it turns the reminder off, and clears any banner it had already raised instead of leaving it up until the next nightly sweep. `unfulfilled_alert_hours` and `pick_list` accept `null` (`pick_list: null` resets the store to the default pick-list layout); `document_layout` is always one of the `OrderDocumentLayout` values, and anything else, `null` included, is a 400. A `pick_list` layout that fails validation is a 422 whose `validation_errors` list every problem at once, with nothing saved; preview a draft first with `previewPickList`. Every real pick list prints with the saved layout.\n\nThe reminder itself is evaluated once a day. It counts every order still `unfulfilled` whose `ordered_at` is further back than this many hours, except orders still under a presale hold — a preorder waiting for its release date is the hold working, not a backlog. Changing the window does not re-evaluate immediately; the next sweep picks it up.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order settings updated",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSettings"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/settings/pick-list/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewPickList",
        "tags": [
          "Orders"
        ],
        "summary": "Preview a pick-list layout on a sample run",
        "description": "Prints a pick-list layout -- the store's draft from the layout designer, saved or not; `null` for the default layout -- on a fixed sample run of a hundred lines across Magic, Pokémon, Yu-Gi-Oh!, Lorcana and One Piece that covers every case the sheet treats specially (multiples, played and sealed copies, substitutes, promos, 1st Editions, foreign languages, smart-binned and hand-named bins). The sample is the same on every call, so two layouts compare line for line, and the sheet is headed with the store's own name. Saving is `putOrderSettings`; real pick lists print with what was saved.\n\nNever refuses a layout: what saving it would refuse comes back in `errors` (the same `{field, message}` pairs a 422 carries in `validation_errors`) beside the PDF, and what the renderer dropped or clamped to print it anyway in `warnings`. Reads no run and writes nothing, so it is not audit-logged (#3090).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickListPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The sample printed with the layout, and what saving it would refuse",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickListPreviewResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/settings/pick-list/sample": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getPickListSample",
        "tags": [
          "Orders"
        ],
        "summary": "The pick-list sample run as display rows",
        "description": "The same sample run `previewPickList` prints, as rows the layout designer's live mock draws without a server round trip: every field already formatted the way the PDF prints it (rarity codes, condition abbreviations, finish labels), with each row's walk heading (`band`), bin text and the black boxes it would draw. Identical for every store and every call (#3090).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The sample rows, in walking order",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickListSample"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/document": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "generateOrderDocument",
        "tags": [
          "Order Documents"
        ],
        "summary": "Generate an order's packing slip PDF",
        "description": "Returns the order's packing slip as a PDF download: the store's letterhead and address, the buyer's shipping address and note, a line per item (quantity, product and printing, condition / language / finish with anything other than NM-or-LP / English / Non-Foil boxed, unit price and line total), and the order's subtotal through grand total. Pass `run_uuid` for a pick run with order slots at ready_to_pack and the slip lists cards in placement order. On a store whose slip layout is by-location, a web request creates the pick run of an order that has none; an API key never does, and answers 409 `order_document_run_required` (the unplaced orders in `params.order_uuids`) until `createFulfillmentRun` or a web print puts them on a run. Errors: 404 `fulfillment_run_not_found`, 409 `fulfillment_run_not_ready_to_pack`, 409 `order_document_run_required`, 422 `order_document_order_not_in_run`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "sections",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Ignored. Retired when the packing slip absorbed the invoice; still accepted so a client that sends it keeps working.\n",
            "schema": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "$ref": "#/components/schemas/OrderDocumentSection"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDocumentSortBy"
            }
          },
          {
            "name": "sort_dir",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDocumentSortDir"
            }
          },
          {
            "name": "layout",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDocumentLayout"
            }
          },
          {
            "name": "run_uuid",
            "in": "query",
            "required": false,
            "description": "A pick run with order slots, at ready_to_pack. The slip lists this order's cards in placement order, top of the slot's pile first, with what isn't in the box after; sort_by and sort_dir are ignored. A run without slots is ignored.\n",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Packing slip PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"packing-slip-{marketplace_order_id}.pdf\", or \"packing-slip-{order_uuid}.pdf\" when the marketplace gave the order no id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`order_document_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/documents": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "generateBatchOrderDocuments",
        "tags": [
          "Order Documents"
        ],
        "summary": "Generate packing slip PDFs for multiple orders",
        "description": "Returns one combined PDF holding each order's packing slip, in `order_uuids` order (so a pack-sort's `packages[].order_uuid` sequence prints matching its piles). `order_uuids` may hold up to 250 entries. Pass `run_uuid` for a pick run with order slots at ready_to_pack and the slip lists cards in placement order. On a store whose slip layout is by-location, a web request creates the pick run of an order that has none; an API key never does, and answers 409 `order_document_run_required` (the unplaced orders in `params.order_uuids`) until `createFulfillmentRun` or a web print puts them on a run. Errors: 404 `fulfillment_run_not_found`, 409 `fulfillment_run_not_ready_to_pack`, 409 `order_document_run_required`, 422 `order_document_order_not_in_run`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Up to 250 entries."
                  },
                  "sections": {
                    "type": "array",
                    "deprecated": true,
                    "description": "Ignored. Retired when the packing slip absorbed the invoice; still accepted so a client that sends it keeps working.\n",
                    "items": {
                      "$ref": "#/components/schemas/OrderDocumentSection"
                    }
                  },
                  "sort_by": {
                    "$ref": "#/components/schemas/OrderDocumentSortBy"
                  },
                  "sort_dir": {
                    "$ref": "#/components/schemas/OrderDocumentSortDir"
                  },
                  "layout": {
                    "$ref": "#/components/schemas/OrderDocumentLayout"
                  },
                  "run_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A pick run with order slots, at ready_to_pack. The slip lists this order's cards in placement order, top of the slot's pile first, with what isn't in the box after; sort_by and sort_dir are ignored. A run without slots is ignored.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Combined packing slip PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"packing-slips.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`order_document_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/{order_uuid}/envelope-label": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/OrderUuid"
        }
      ],
      "get": {
        "operationId": "generateEnvelopeLabel",
        "tags": [
          "Envelope Labels"
        ],
        "summary": "Generate a 4x6 envelope address label PDF for an order",
        "description": "Returns a 4x6 (landscape) envelope address label as a PDF download. The store's return address is top-left, the customer's delivery address is centered, and a stamp area sits top-right. The frontend can print it directly onto a 4x6 label or tape it to an envelope.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Envelope label PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"envelope-label-{order_uuid}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`envelope_label_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/orders/envelope-labels": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "generateBatchEnvelopeLabels",
        "tags": [
          "Envelope Labels"
        ],
        "summary": "Generate 4x6 envelope address label PDFs for multiple orders (max 50)",
        "description": "Returns a single combined PDF containing one 4x6 envelope address label per order. Labels are rendered in the order they appear in the request array. Each label shows the store return address, the customer delivery address, and a stamp area.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order_uuids"
                ],
                "properties": {
                  "order_uuids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Combined envelope label PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"envelope-labels-batch.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`envelope_label_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/alerts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listStoreAlerts",
        "tags": [
          "Order Sync"
        ],
        "summary": "List active store-facing alert banners for a store",
        "description": "Returns the store's active alert banners — app-generated notices shown to all users of the store in the dashboard (e.g. an aging TCGPlayer cookie that needs refreshing, or an order-sync redirect indicating the cookie/session is likely dead). Readable by every store role since the banner is surfaced to all users. Resolved alerts are omitted.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active store alerts",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "alerts"
                  ],
                  "properties": {
                    "alerts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoreAlert"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getOrderSyncStatus",
        "tags": [
          "Order Sync"
        ],
        "summary": "Get order sync health and status for a store",
        "description": "Returns a comprehensive visibility payload including recent orders, sync task history, per-platform health, anomaly indicators, and rolling 24-hour metrics.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Order sync status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSyncStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/tcg-cookie-status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getTcgCookieStatus",
        "tags": [
          "Order Sync"
        ],
        "summary": "Get TCGplayer cookie-sync state for a store",
        "description": "The dashboard's FE-companion of `GET /v1/plugin/tcg-cookie/status`: same underlying credential state, reached with this store's own JWT instead of a plugin bearer token, since the dashboard never holds one. Never returns the cookie, any part of it, a derivative of it, or the raw seller-account key -- only whether one is bound.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "TCGplayer cookie-sync status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TcgCookieStatusResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/connection-test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "testOrderSyncConnection",
        "tags": [
          "Order Sync"
        ],
        "summary": "Test connectivity for one marketplace's stored credentials",
        "description": "Calls one marketplace with the store's stored credentials and returns a ConnectionTestResult saying whether it passed, with an error code, a plain `message` when it failed, and a timestamp. Used to diagnose credential or marketplace-outage issues. A failed test is still a 200. `platform` is required (422 `validation_error`), and a store with no credentials for it is refused (404 `<platform>_credentials_not_found`, for example `shopify_credentials_not_found`). On Snapcaster a pass also refreshes the readiness `GET /order-sync/status` reports.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "description": "The marketplace to test, for example `snapcaster` or `MANA_POOL`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field) or a provider refused the credentials (`{provider}_auth_failed`, `{provider}_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The connection-test result for that marketplace",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionTestResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/ebay/onboarding": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getEbayOnboardingStatus",
        "tags": [
          "Order Sync"
        ],
        "summary": "Get the store's eBay onboarding status",
        "description": "Returns whether the store has opted into eBay's Business Policy Management program, the fulfillment/payment/return policies currently on the seller's eBay account (empty until opted in -- this never opts the store in itself), which of those are already selected for HippoLink use, whether the HippoLink inventory location exists on the seller's eBay account, and whether onboarding is complete (a selected policy of each type plus an existing location). Reads only; nothing here writes to the seller's eBay account (#2600, EBAY-06).\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "409": {
            "description": "A state conflict, such as `{provider}_credentials_incomplete` or `{provider}_reconnect_required` (the connection needs to be re-authorized).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field) or a provider refused the credentials (`{provider}_auth_failed`, `{provider}_rejected`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The marketplace took too long to answer (`{provider}_timeout`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The store's eBay onboarding status",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbayOnboardingStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The store has no eBay credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "eBay could not be reached, or refused the request (see error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "eBay OAuth not configured, or eBay rate-limited the request (see error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/whatnot/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getWhatnotSettings",
        "tags": [
          "Order Sync"
        ],
        "summary": "Get a store's Whatnot selection settings",
        "description": "Returns the store's Whatnot listing selection settings: whether the price rule is on, its threshold, the listing cap, and how many SKUs are currently selected for Whatnot. Whatnot lists only the cards a store selects: those tagged sell-on-whatnot and, while the rule is on, every eligible in-stock card priced at or above the threshold, up to the cap (tagged cards first). do-not-sell-on-whatnot and do-not-sell always win.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's Whatnot settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatnotSettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/whatnot/settings/rule-preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getWhatnotRulePreview",
        "tags": [
          "Order Sync"
        ],
        "summary": "Preview what the Whatnot price rule would list",
        "description": "Read-only. Reports what the Whatnot price rule would do with rule_enabled on and the given threshold, using the selection the reconcile applies: cards newly listed, selected cards that stay, and qualifying cards the listing cap leaves out. threshold_cents defaults to the stored threshold. When the scan is cut by the inline statement timeout the response carries capped true, null counts, and would_list is at most the cap's free slots (null without a cap).\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "threshold_cents",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Rule threshold to preview; defaults to the stored one."
          }
        ],
        "responses": {
          "200": {
            "description": "The rule's projected effect",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatnotRulePreview"
                }
              }
            }
          },
          "400": {
            "description": "A query parameter was invalid (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/ebay/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getEbaySettings",
        "tags": [
          "Order Sync"
        ],
        "summary": "Get a store's eBay curation settings",
        "description": "Returns the store's eBay listing settings: whether the price-threshold rule is on, the threshold itself, the listing cap and whether it is auto or manual, the facts last refreshed from eBay (selling limit quantity and amount, and when they were checked), and the current count of SKUs opted in to eBay. Also the eBay Store subscription (level, term, when checked), the listing-fee policy, an estimate of monthly insertion fees for that tier, and the date the free-listing allowance was found used up this month. An auto cap follows eBay's own monthly selling limit on every refresh; a manual cap is never overwritten by a refresh. The threshold has a minimum of 99 cents, eBay's own fixed-price minimum. The rule itself only takes effect once the eBay provider ships; today this endpoint only reads and writes the settings row. Note that eBay's selling limit is a monthly cap on item units sold, while listing_cap counts distinct SKUs opted in -- the auto cap copies the unit quantity as a SKU count, so it is an approximation; eBay's own limit is the hard stop regardless.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The store's eBay settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbaySettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/ebay/settings/rule-preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getEbayRulePreview",
        "tags": [
          "Order Sync"
        ],
        "summary": "Preview what the eBay price rule would list",
        "description": "Read-only. Reports what the price rule would do with rule_enabled on and the given threshold, using the same selection the reconcile applies: how many cards would be newly listed, how many selected cards stay listed, and how many qualifying cards the listing cap leaves out. threshold_cents defaults to the stored threshold and is never below 99 cents. The scan runs under the inline statement timeout; when it is cut the response carries capped true, null counts and would_list is at most the cap's free slots (null without a cap). Writes nothing.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "threshold_cents",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 99
            },
            "description": "Rule threshold to preview; defaults to the stored one."
          }
        ],
        "responses": {
          "400": {
            "description": "The request was malformed or a query parameter was invalid. `error` is a specific code such as `request_body_invalid_json` or `query_param_invalid`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The rule's projected effect",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbayRulePreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/ebay/settings/refresh": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "refreshEbaySettings",
        "tags": [
          "Order Sync"
        ],
        "summary": "Refresh the store's eBay selling limit and Store subscription from eBay",
        "description": "Calls eBay's getPrivileges endpoint to refresh the store's monthly selling limit (quantity and amount) and getSubscription to refresh its eBay Store tier and term. The two are independent: the response is 200 when either succeeded (each carries its own checked_at), 502 only when both failed. When the cap is auto, it is updated to follow the refreshed selling limit; a manual cap is left untouched. eBay reporting no limit is stored as no limit, not zero. Rate-limited to once per 5 minutes per store. A daily job refreshes the same facts and does not use up this limit.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "504": {
            "description": "The marketplace took too long to answer (`{provider}_timeout`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Refreshed eBay settings",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbaySettings"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No eBay credential connected for this store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "description": "Either the ordinary rate limit, or a refresh was already attempted for this store within the last 5 minutes, whether or not it succeeded (error `refresh_too_soon`).\n\nA key whose request budget is spent is also answered 429 `api_rate_limited`, with `Retry-After`. The gateway's own throttle answers `{\"message\":\"Too Many Requests\"}` with no `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayMessage"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying. Sent with `api_rate_limited` only.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "eBay was reached but the refresh failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "eBay OAuth not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/ebay/description-preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewEbayDescription",
        "tags": [
          "Order Sync"
        ],
        "summary": "Render an eBay listing description template for a sample card",
        "description": "Validates the template the same way updateEbaySettings does and renders it for a fixed sample card, without saving anything.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EbayDescriptionPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The rendered description",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbayDescriptionPreview"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The template uses an unknown variable or malformed $ syntax",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/misprint/account": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getMisprintAccount",
        "tags": [
          "Order Sync"
        ],
        "summary": "Read the store's live Misprint seller level and listing limits",
        "description": "Calls Misprint with the stored API key and returns the seller's level, vacation-mode flag, live listing count and listing limits with their current usage. Nothing is cached or stored. Values are USD dollars as Misprint reports them and any field Misprint omits is null. `listing_count_pending` and `listing_value_pending` are accepted creates not yet applied; they count against the limits alongside the current values. A key Misprint refuses flags the Misprint connection as needing a reconnect (`misprint_reconnect_required`); a successful read clears that flag. Errors: 404 when Misprint is not connected, `misprint_reconnect_required`, `misprint_key_scope_missing` and `misprint_account_blocked` (409), `misprint_rate_limited` or `misprint_budget_unavailable` (503, retry after the `Retry-After` header), 502 when Misprint is unreachable or answers with something unusable, and 504 on a timeout.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The seller's Misprint level and listing limits",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MisprintAccount"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Misprint isn't connected for this store.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "The saved key was refused (`misprint_reconnect_required`), lacks a scope (`misprint_key_scope_missing`) or the seller account is banned or paused (`misprint_account_blocked`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "Misprint could not be reached or answered with something unusable (unreachable, or an unusable answer).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "HippoLink is at its Misprint request limit for this key (`misprint_rate_limited`), or couldn't check that budget (`misprint_budget_unavailable`); retry after the `Retry-After` header.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "Misprint took too long to answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/lightspeed/locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listLightspeedLocations",
        "tags": [
          "Order Sync"
        ],
        "summary": "List the store's Lightspeed locations for the location picker",
        "description": "Returns the connected Lightspeed account's live locations (X-Series outlets, R-Series shops; fetched from Lightspeed) and the current choice: the locations the push writes to and the main one, which gets the full sellable count while the others get 0. A store with one location has it selected at connect; with several it picks through `upsertOrderSyncCredentials` (`lightspeed_push_location_ids`, `lightspeed_primary_location_id`) before inventory is sent.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Lightspeed locations for this store",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LightspeedLocationsResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Lightspeed is connected but the connection is incomplete or its access was revoked; reconnect Lightspeed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "Lightspeed answered with an error (`{provider}_unavailable`, `{provider}_bad_response`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Lightspeed is rate limiting (`{provider}_rate_limited`). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "Lightspeed took too long to answer (`{provider}_timeout`). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/lightspeed/categories": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listLightspeedCategories",
        "tags": [
          "Order Sync"
        ],
        "summary": "List the store's Lightspeed categories for the category parent picker",
        "description": "Returns the connected Lightspeed account's product categories (fetched from Lightspeed, with their paths) and the store's category setting (#4177). The store picks a parent, or none, and a layout through `upsertOrderSyncCredentials` (`lightspeed_category_layout`, `lightspeed_category_parent_id`).\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Lightspeed categories for this store",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LightspeedCategoriesResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Lightspeed is connected but the connection is incomplete or its access was revoked; reconnect Lightspeed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "Lightspeed answered with an error (`{provider}_unavailable`, `{provider}_bad_response`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "503": {
            "description": "Lightspeed is rate limiting (`{provider}_rate_limited`). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "Lightspeed took too long to answer (`{provider}_timeout`). Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/square/locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listSquareLocations",
        "tags": [
          "Order Sync"
        ],
        "summary": "List the store's Square locations for the sync-location picker",
        "description": "Returns the seller's Square business locations (fetched live from Square) so the dashboard can let the store choose which location HippoLink syncs inventory to. Also returns the currently-selected push location (`selected_location_id`), which is null until the store picks one. A store with a single active Square location has it auto-selected at connect time; a store with multiple locations must pick one (via `PUT /v1/stores/{store_uuid}/order-sync/credentials` with `square_push_location_ids`) before inventory push to Square runs.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "503": {
            "description": "A dependency is unavailable or rate limiting (`{provider}_rate_limited`, `webhook_ingress_not_configured`, `{provider}_oauth_not_configured`, `service_unavailable`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The marketplace took too long to answer (`{provider}_timeout`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Square locations for this store",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SquareLocationsResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Square is connected but the connection is incomplete or its access was revoked; reconnect Square.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "Square API error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/order-sync/shopify/locations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listShopifyLocations",
        "tags": [
          "Order Sync"
        ],
        "summary": "List the store's Shopify locations for the sync-location picker",
        "description": "Returns the seller's Shopify locations (fetched live from Shopify) so the dashboard can let the store choose which location HippoLink syncs inventory to. Also returns the currently-selected location (`selected_location_id`), which is null until the store picks one. A shop with a single active location has it auto-used at sync time; a shop with multiple locations must pick one (via `PUT /v1/stores/{store_uuid}/order-sync/credentials` with `shopify_location_id`) before inventory push to Shopify runs.\n\n**Who can call this:** Store owner.\n\n**Scope required:** `integrations:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "503": {
            "description": "A dependency is unavailable or rate limiting (`{provider}_rate_limited`, `webhook_ingress_not_configured`, `{provider}_oauth_not_configured`, `service_unavailable`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The marketplace took too long to answer (`{provider}_timeout`). Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Shopify locations for this store",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShopifyLocationsResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Shopify is connected but the connection is incomplete or its access was revoked; reconnect Shopify.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "Shopify API error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/sales": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getSalesReport",
        "tags": [
          "Reports"
        ],
        "summary": "Aggregated sales report grouped by time period",
        "description": "Returns revenue, units sold, and order counts aggregated by day, week, or month. Free-tier stores are limited to a 30-day window; if the requested range exceeds this limit the `from` date is clamped and the response includes an `X-Report-Limited: true` header.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "default": "daily"
            },
            "description": "Grouping granularity."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601). Defaults to 30 days before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601). Defaults to today."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional marketplace filter (e.g. `tcgplayer`)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Sales report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Report-Limited": {
                "schema": {
                  "type": "string"
                },
                "description": "Set to `true` when the requested date range was clamped for a free-tier store.\n"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/trades": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getTradeReport",
        "tags": [
          "Reports"
        ],
        "summary": "Cards bought through the buylist over a date range, cash against store credit",
        "description": "Returns the buylist trades the store pushed into inventory between `from` and `to` (inclusive UTC days, ranged on the push time), newest first, with a summary over the whole range: trade and card counts, cash paid, store credit paid, and a breakdown by the payout method the store labels its trades with. A trade pays out on one leg, cash or credit, never both. Only cards actually bought count; a declined line does not. Per-trade card detail is `listBuylistPurchaseLines`. With `format=csv` the response is one row per bought card across the whole range (no paging). Free-tier stores are limited to a 30-day window; if the requested range exceeds it the `from` date is clamped and the response includes an `X-Report-Limited: true` header.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "First day of the range (ISO 8601, UTC)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Last day of the range, inclusive (ISO 8601, UTC)."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            },
            "description": "`csv` returns the per-card rows as a file instead of the JSON report."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "413": {
            "$ref": "#/components/responses/ResponseTooLarge"
          },
          "422": {
            "description": "`from` was after `to`, or `limit` was over 250 (`query_param_invalid`). `limit` is read only for JSON; `format=csv` is unpaged and instead answers 413 `response_too_large` when the range holds too many cards for one file.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Trade report (JSON), or the per-card CSV when `format=csv`.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Trades in the range (JSON only)."
              },
              "X-Report-Limited": {
                "schema": {
                  "type": "string"
                },
                "description": "Set to `true` when the requested date range was clamped for a free-tier store.\n"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "CSV only: attachment; filename=\"trade-report-{from}-{to}.csv\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradeReportResponse"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/untracked-sales": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getUntrackedSalesReport",
        "tags": [
          "Reports"
        ],
        "summary": "Row-per-line report of untracked (non-HL) register sales",
        "description": "Returns one row per untracked order line. A non-HL line (#1362) is a marketplace-rung sale -- a Square food/custom-amount charge, a Shopify product with no matching HippoLink SKU -- that landed as a real `order_items` row (`billable = FALSE`, `tcgplayer_sku_id IS NULL`) but never resolved to a catalog product, so it never hit inventory, COGS, or billing. This report surfaces those rows per store so an owner sees the inventory-drift risk (unmatched register sales, custom-amount lines) as it happens instead of at audit time. Free tier, deliberately: like the sales report, this is operational visibility over the store's own lines, not the Pro analytics set.\n\nA row is matched live against `order_items.billable`, not a snapshot -- once the admin reclassification endpoint (#1363) flips a line `billable = TRUE` (identifying what it actually was), it stops matching and drops off this report on the very next read.\n\nCanceled orders are excluded (`status != 'canceled'`), matching every sibling report's posture; refunded orders stay in -- the line was still rung up untracked regardless of a later refund. $0.00 lines are excluded: they carry no untracked revenue, and an admin line-item correction records a phantom line (one the marketplace put on the order but the shopper never bought) as a zero-priced row of this same shape.\n\nFree-tier stores are limited to a 30-day window; if the requested range exceeds this limit the `from` date is clamped and the response includes an `X-Report-Limited: true` header.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601). Defaults to 30 days before `to`."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601). Defaults to today."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Marketplace"
            },
            "description": "Filter to a single marketplace (exact match). Omit to include lines from all marketplaces."
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Untracked (non-HL) register sales, one row per line item",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Report-Limited": {
                "schema": {
                  "type": "string"
                },
                "description": "Set to `true` when the requested date range was clamped for a free-tier store.\n"
              },
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total number of matching lines (same value as the `total` field in the response body)."
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UntrackedSalesReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/slow-movers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getSlowMoversReport",
        "tags": [
          "Reports"
        ],
        "summary": "Slow-moving inventory report (Pro plan only)",
        "description": "Returns SKUs that have been in stock for at least `min_days_in_stock` days with zero sales. Items that have sold in any quantity are excluded. Results are sorted by `days_in_stock` descending. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "min_days_in_stock",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 60,
              "minimum": 0
            },
            "description": "Minimum number of days an item must have been in stock."
          },
          {
            "name": "max_results",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            },
            "description": "Maximum number of rows to return (server-side cap of 500)."
          }
        ],
        "responses": {
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Slow-movers report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlowMoversReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/sell-through": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getSellThroughReport",
        "tags": [
          "Reports"
        ],
        "summary": "Sell-through rate per Magic set (Pro plan only)",
        "description": "Returns per-set inventory and sales aggregates for the store. Stock denominator is physical inventory (`total_quantity`), not the currently-listed subset. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Sell-through report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellThroughBySetResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/shrinkage": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getShrinkageReport",
        "tags": [
          "Reports"
        ],
        "summary": "Shrinkage (non-sale stock loss) report (Pro plan only)",
        "description": "Returns inventory removed outside a sale (theft, damage, lost, miscount, giveaway), aggregated by time bucket and reason and valued at cost basis — a shrinkage event is effectively a sale for $0. Reads the inventory ledger; the manual_correction reason is excluded as it is a non-loss correction. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start of the window (ISO 8601, inclusive). Omit to leave open."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End of the window (ISO 8601, exclusive). Omit to leave open."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "default": "monthly"
            },
            "description": "Time-bucket granularity for the rows."
          }
        ],
        "responses": {
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Shrinkage report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShrinkageReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/product-delta": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getProductDeltaReport",
        "tags": [
          "Reports"
        ],
        "summary": "Products added/removed report (Pro plan only)",
        "description": "Lists individual product add/remove events read from the inventory ledger -- what came in (manual/import/buylist/other) and what went out (sold/breakage/manual/other) over the window. Unlike the other reports here, this returns one row per event rather than an aggregate; `totals` gives the unit counts by category over the whole matched window, independent of pagination. `from`/`to` default to the last complete UTC day when both are omitted, since this report is framed as a daily check. \"Sold\" means the visible-counter decrement at order-received (`order_sale`); the physical shelf-pull side of the same sale is excluded from every category so a sale is never double-counted. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start of the window (ISO 8601, inclusive). Defaults to yesterday (UTC) when both `from` and `to` are omitted.\n"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End of the window (ISO 8601, exclusive). Defaults to today (UTC) when both `from` and `to` are omitted.\n"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "added",
                "removed"
              ]
            },
            "description": "Narrow to only additions or only removals."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "manual",
                "import",
                "buylist",
                "sold",
                "breakage",
                "other"
              ]
            },
            "description": "Narrow to one category."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            },
            "description": "Page size, capped at 250."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "422": {
            "description": "`limit` was past its maximum (250), or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Product delta report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductDeltaReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/sku-sales": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getSkuSalesReport",
        "tags": [
          "Reports"
        ],
        "summary": "Per-SKU sales rollup report (Pro plan only)",
        "description": "Returns one row per TCGPlayer SKU that sold at least once inside the trailing `days` window, aggregated across this store's qualifying orders. `units_sold`, `revenue`, and `avg_sale_price` are scoped to that same window, mirroring the AVG_SALE_PRICE_LAST_N_DAYS repricing variable family; `last_sale_price` and `last_sold_at` are always all-time regardless of `days`, matching the windowless LAST_SALE_PRICE variable. Canceled and refunded orders are excluded from every aggregate here, the same exclusion the sale-price repricing variables use, deliberately stricter than the other inventory reports (slow-movers, sell-through, shrinkage), which exclude only canceled orders. `avg_sale_price` is quantity-weighted: a 4-copy line moves the average four times as much as a single copy. Every money field is scoped to the `currency` filter; amounts are never blended across currencies. Sorting by `revenue` or `units_sold` (always descending, `tcgplayer_sku_id` ascending on ties) is the top-sellers ranking. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "default": 30
            },
            "description": "Trailing window in days scoping units_sold, revenue, and avg_sale_price, mirroring the AVG_SALE_PRICE_LAST_N_DAYS repricing variable family. last_sale_price and last_sold_at are always all-time regardless of this window, matching the windowless LAST_SALE_PRICE variable.\n"
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Currency"
                }
              ],
              "default": "USD"
            },
            "description": "Scopes every money field (revenue, avg_sale_price, last_sale_price) to orders placed in this currency, mirroring the currency scope on the sale-price repricing variables. Amounts are never blended across currencies.\n"
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Marketplace"
            },
            "description": "Filter to a single marketplace (exact match). Omit to include sales from all marketplaces."
          },
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Filter to a single game family. Omit to include all games."
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "revenue",
                "units_sold"
              ],
              "default": "revenue"
            },
            "description": "Metric to rank SKUs by, always descending with tcgplayer_sku_id ascending as the tie-break. This is the top-sellers ranking.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 25
            },
            "description": "Page size. A value above 250 is capped at 250."
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "422": {
            "description": "`limit` was below 1 or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated per-SKU sales rollup",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-Total-Count": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total number of matching SKUs (same value as the `total` field in the response body)."
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSkuSalesRollupList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplace-sync-rejections": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listMarketplaceSyncRejections",
        "tags": [
          "Inventory"
        ],
        "summary": "List marketplace sync rejections for a store",
        "description": "Lists SKUs a marketplace permanently refused to list (e.g. ManaPool \"Product not found\"), recorded by inventory-push-service when a push is dropped for an attributable, won't-fix-on-retry reason. Defaults to open (unresolved) rejections; a rejection auto-resolves the next time the SKU syncs cleanly. Transient failures are retried automatically and never appear here.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "TCGPLAYER",
                "MANA_POOL",
                "CARD_TRADER",
                "SHOPIFY",
                "SQUARE",
                "EBAY",
                "CARD_NEXUS",
                "MISPRINT",
                "SNAPCASTER",
                "LIGHTSPEED",
                "WHATNOT",
                "SICK_DEALS"
              ]
            },
            "description": "Filter to a single marketplace (UPPERCASE platform code)."
          },
          {
            "name": "reason_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "product_not_found",
                "duplicate",
                "unpriced",
                "validation",
                "price_drift",
                "unknown"
              ]
            },
            "description": "Filter to a single rejection reason."
          },
          {
            "name": "resolved",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Return resolved (cleared) rejections instead of open ones."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 250
            },
            "description": "Page size (max 250)."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            },
            "description": "Number of rows to skip."
          }
        ],
        "responses": {
          "422": {
            "description": "`limit` was past its maximum (250), or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of marketplace sync rejections",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceSyncRejectionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/marketplace-held-pushes": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listMarketplaceHeldPushes",
        "tags": [
          "Inventory"
        ],
        "summary": "List cards a marketplace push is holding back, and why",
        "description": "Cards HippoLink is deliberately not listing on a marketplace yet, with the reason the last push gave: a used-up eBay free-listing allowance, a daily creation cap, an unfinished marketplace setup. These are not rejections: nothing is wrong with the card, and each one lists on its own once the reason clears. Oldest first.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "TCGPLAYER",
                "MANA_POOL",
                "CARD_TRADER",
                "SHOPIFY",
                "SQUARE",
                "CARDMARKET",
                "EBAY",
                "CARD_NEXUS",
                "MISPRINT",
                "SNAPCASTER"
              ]
            },
            "description": "Filter to a single marketplace (UPPERCASE platform code)."
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MarketplaceHeldPushReason"
            },
            "description": "Filter to a single reason."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 250
            },
            "description": "Page size (max 250)."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            },
            "description": "Number of rows to skip."
          }
        ],
        "responses": {
          "422": {
            "description": "`limit` was past its maximum (250), or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of held-back cards",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceHeldPushesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/ebay/inclusions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listEbayInclusions",
        "tags": [
          "Inventory"
        ],
        "summary": "List a store's per-SKU eBay opt-in decisions, or the cards ready to decide",
        "description": "eBay is opt-in: a SKU only lists there once a row here says decision=include. Tagging a card sell-on-ebay, or meeting the store's eBay price rule, is the opt-in signal; the store's listing cap and priority order (schemas.ebay_selection) decide which candidates actually get a row here. Ordered by sort: tcgplayer_sku_id ascending by default (stable), or by the effective eBay price with tcgplayer_sku_id as the tie-break.\n\nstate=ready lists SKUs with no decision row that the next selection reconcile would take: tagged sell-on-ebay, or meeting the store's eBay price rule (the tag overrides only the rule's threshold), in stock (under the same quantity rule the eBay push uses), in eBay's scope (a game eBay has a category for, a listable condition), not suppressed (including by a do-not-sell-on-ebay tag), and with an effective eBay price of at least $0.99 before any clamp -- the same query the selection reconcile draws its candidates from. The store's listing cap is not applied, so total is not limited by it. Ready rows carry null decision, source and updated_at and a boolean tagged; with sort=price_desc, tagged rows come first, as the reconcile ranks them. Counting that set probes the catalog per SKU, so its total stops at 10,000: total is then 10000 and total_capped is true. state=included / state=excluded are decision=include / decision=exclude; a conflicting pair is a 422.\n\nAny of the inventory filter params (the vocabulary bulkReserveInventory accepts as filters, parsed as listInventory parses them) narrow the listing, whatever the state. They resolve to the store's in-stock SKUs, so a decided row for a sold-out SKU drops out of a filtered listing. A filter matching more than 10,000 SKUs is a 422; narrow it.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ready",
                "included",
                "excluded"
              ]
            },
            "description": "ready: undecided SKUs the next selection reconcile would take, tagged or meeting the price rule (cannot be combined with decision or source). included / excluded: same as decision=include / decision=exclude.\n"
          },
          {
            "name": "decision",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EbayInclusionDecision"
            },
            "description": "Filter to a single decision. Prefer state."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EbayInclusionSource"
            },
            "description": "Filter to a single source."
          },
          {
            "name": "tcgplayer_sku_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+(,[0-9]+)*$"
            },
            "description": "Comma-separated SKU ids (at most 250): only these SKUs, sold out included, e.g. one product's rows for its eBay toggle. Combines with the inventory filters by intersection.\n"
          },
          {
            "$ref": "#/components/parameters/Search"
          },
          {
            "$ref": "#/components/parameters/InventoryRarity"
          },
          {
            "$ref": "#/components/parameters/Condition"
          },
          {
            "$ref": "#/components/parameters/InventoryTags"
          },
          {
            "$ref": "#/components/parameters/InventorySetName"
          },
          {
            "$ref": "#/components/parameters/InventoryProductNumber"
          },
          {
            "$ref": "#/components/parameters/QuantityMin"
          },
          {
            "$ref": "#/components/parameters/QuantityMax"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMin"
          },
          {
            "$ref": "#/components/parameters/QuantityVisibleMax"
          },
          {
            "$ref": "#/components/parameters/PriceMin"
          },
          {
            "$ref": "#/components/parameters/PriceMax"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMin"
          },
          {
            "$ref": "#/components/parameters/InventoryCOGSMax"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/FirstInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedAfter"
          },
          {
            "$ref": "#/components/parameters/LastInventoriedBefore"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldAfter"
          },
          {
            "$ref": "#/components/parameters/LastCopySoldBefore"
          },
          {
            "$ref": "#/components/parameters/NeverSold"
          },
          {
            "name": "location_uuid",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only SKUs of products stocked at this location or anywhere beneath it, as listInventory's location_uuid.\n"
          },
          {
            "name": "game",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Only SKUs of this game."
          },
          {
            "name": "live",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Decided rows only: true keeps the cards eBay has live now (the last acked push holds a quantity above zero), false the rest. Applied in the paged query, so total and the page agree (#2767). Refused with state=ready, whose rows are never on eBay.\n"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sku",
                "price_desc",
                "price_asc"
              ],
              "default": "sku"
            },
            "description": "sku: tcgplayer_sku_id ascending. price_desc / price_asc: the effective eBay price (override beats base, before the $0.99 clamp), unpriced rows last, ties by tcgplayer_sku_id ascending -- the \"top N by value\" preset is state=ready&sort=price_desc&limit=N.\n"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 250
            },
            "description": "Page size (max 250)."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            },
            "description": "Number of rows to skip."
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "504": {
            "description": "The request took too long (`request_timeout`). Narrow the filters or search and try again.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "A page of eBay inclusion rows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbayInclusionListResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/ebay/tags/preview": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "post": {
        "operationId": "previewEbayTagAssignments",
        "tags": [
          "Inventory"
        ],
        "summary": "Preview what tagging cards sell-on-ebay (or do-not-sell-on-ebay) would do",
        "description": "A dry run of applyStoreTagAssignments for one of the two eBay slugs. It takes the same `assign` rows (products, SKUs, or both; a null `tcgplayer_sku_id` is the whole product) and writes nothing. Every row must carry the same slug, either sell-on-ebay or do-not-sell-on-ebay; `unassign` is ignored. It needs the same permission as the write.\n\nThe selected SKUs are the store's priced SKUs of each product-grain row plus each SKU row the catalog confirms belongs to its product. For sell-on-ebay the counts come from the selection reconcile's own candidate query, run over just those SKUs with the tag treated as applied: in stock under the push's quantity rule, in eBay's scope, not suppressed (do-not-sell, do-not-sell-on-ebay), and priced at eBay's $0.99 minimum or more. They are disjoint except already_tagged: already_listed (a decision=include row exists) + would_list + over_cap + below_minimum + ineligible = selected_skus. would_list and over_cap weigh the qualifying cards against the cap's free slots right now (listing_cap minus every include row), so over_cap is how many wait beyond the cap; with no cap, over_cap is 0. already_tagged counts the selected SKUs that already carry the slug, at either grain, and is independent of the others.\n\nFor do-not-sell-on-ebay nothing can list: would_list, over_cap and below_minimum are 0, already_listed are the cards the next reconcile would take down, and ineligible is the rest.\n\nThe scan runs under the reconcile's inline statement timeout. When it is cut, capped is true and every count but selected_products is null. A selection of more than 10,000 SKUs is examined up to 10,000 and also answers capped: true, so selected_skus is then a floor.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "assign"
                ],
                "properties": {
                  "assign": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 5000,
                    "items": {
                      "$ref": "#/components/schemas/StoreTagAssignmentInput"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't the JSON shape the route expects (`request_body_invalid_json`, `request_body_invalid`, `request_body_required`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "What the assignment would do.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EbayTagPreviewResult"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/cogs-margin": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getCogsMarginReport",
        "tags": [
          "Reports"
        ],
        "summary": "Per-order COGS and gross-margin report (Pro plan only)",
        "description": "Returns per-order revenue, COGS, and gross-margin data for a date range. Orders without COGS data are included in `rows` with null cost/margin fields but excluded from `totals`. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601, inclusive)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601, inclusive)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "COGS margin report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CogsMarginReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/profit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getProfitReport",
        "tags": [
          "Reports"
        ],
        "summary": "Profit report grouped by time period (Pro plan only)",
        "description": "Returns revenue, COGS, marketplace fees, and profit aggregated by day, week, or month. COGS is COALESCE'd to 0 for orders without FIFO cost data. Requires a Pro or Enterprise subscription; a store below Pro receives 402. Invariant per row and totals: profit_usd = revenue_usd - cogs_usd - fees_usd. All amounts are in the store's currency (the `_usd` suffix is historical); orders in any other currency are left out.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601, inclusive)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601, inclusive)."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "default": "daily"
            },
            "description": "Grouping granularity."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional marketplace filter (e.g. `tcgplayer`)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Profit report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/marketplace-fees": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getMarketplaceFeesReport",
        "tags": [
          "Reports"
        ],
        "summary": "Marketplace fees report grouped by marketplace (Pro plan only)",
        "description": "Returns total fees, order counts, and average fee per order for each marketplace in the requested date range. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601, inclusive)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601, inclusive)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Marketplace fees report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceFeesReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/refunds": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getRefundsReport",
        "tags": [
          "Reports"
        ],
        "summary": "Refunds report grouped by time period (Pro plan only)",
        "description": "Returns refund counts and amounts aggregated by day, week, or month. Date filtering is applied to the refund creation date. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601, inclusive)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601, inclusive)."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "default": "daily"
            },
            "description": "Grouping granularity."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional marketplace filter (e.g. `tcgplayer`)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Refunds report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundsReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/reports/returns": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getReturnsReport",
        "tags": [
          "Reports"
        ],
        "summary": "Returns report grouped by time period (Pro plan only)",
        "description": "Returns counts and values for items returned to inventory (refunds where `return_to_stock = true`), aggregated by day, week, or month. A return is a distinct event from a refund: the item came back into stock. Date filtering is applied to the refund/return creation date. Requires a Pro or Enterprise subscription; a store below Pro receives 402.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `reports:read`.\n\n**Cost:** 10 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (ISO 8601, inclusive)."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (ISO 8601, inclusive)."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "default": "daily"
            },
            "description": "Grouping granularity."
          },
          {
            "name": "marketplace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional marketplace filter (e.g. `tcgplayer`)."
          }
        ],
        "responses": {
          "422": {
            "description": "`from` was after `to` (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Returns report",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnsReportResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/SubscriptionRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/tcg-messages/summary": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getTcgMessagesSummary",
        "tags": [
          "TCG Messages"
        ],
        "summary": "TCGPlayer message counts for a store's dashboard badge",
        "description": "Unread, unanswered, and total counts for the store's TCGPlayer seller-portal message threads. Unread is TCGPlayer's own unread-message count; unanswered counts recent order-scoped threads awaiting a reply.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Message counts",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TcgMessageSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listReimbursementInvoices",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "List TCGplayer Direct Reimbursement Invoices",
        "description": "Paginated list of the store's Reimbursement Invoices, newest first, with inline unread and open counts for the notifications tab.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "unread",
            "in": "query",
            "description": "When `true`, return only RIs the store has not marked read.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "fulfilled",
            "in": "query",
            "description": "`false` returns only RIs not yet fulfilled (still to pull); `true` only fulfilled ones. Omit for every RI. `total` counts the filtered set; `unread` and `open` stay store-wide.\n",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated RI list with unread/open counts",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementInvoiceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "get": {
        "operationId": "getReimbursementInvoice",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Get a Reimbursement Invoice with its line items",
        "description": "One TCGplayer Reimbursement Invoice with its line items in TCGplayer's own order, the order the seller pulls them in. Each line carries its SKU, image, finish and whether the SKU is in the catalog; `condition` is shown in the store's region's grading terms. Once the invoice is fulfilled, each line also carries `covered_quantity` and `coverage` against the store's held Direct orders, and the invoice a `coverage` roll-up; before that they are `null`. When the invoice was pulled through a fulfillment run, `pull` and each line's `missing_quantity` say what the pull didn't find. `hub_shipment` is the live label bought for the parcel to TCGplayer, if any. Reading the invoice does not mark it read (`markReimbursementInvoiceRead` does). An unknown id, or another store's, is 404.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The Reimbursement Invoice with SKU-resolved line items",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementInvoiceDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/read": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "markReimbursementInvoiceRead",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Mark a Reimbursement Invoice read",
        "description": "Sets the RI's `hl_read_at` marker (idempotent).\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The updated Reimbursement Invoice",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementInvoice"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/shipping/rates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "getReimbursementShippingRates",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Rate-shop the parcel carrying this RI to TCGplayer",
        "description": "Live carrier rates for the one parcel carrying this RI's whole pull sheet.\n**The destination is resolved here, not supplied.** It is derived from the RI's tier (`hub_destination` on the invoice), so a caller cannot buy postage to an address of its choosing on the store's carrier account, and no client needs to know the facility address. That is why this is RI-scoped rather than the generic \"rate against any address\" endpoint #1926 first proposed.\n**Send an explicit `parcel`.** Omitted, the default candidates are the single-card shapes (bubble mailer, PWE, large letter) and quote nothing usable for a box of a few hundred cards.\nUnlike the order-scoped `getShippingRates`, the response carries **no synthetic stamp/pickup options** and **no rule-driven recommendation**: neither is a way to send this parcel, and the shipping-rule engine matches on an order, which this is not.\nReturns 422 when the RI's tier has no known destination.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReimbursementRatesRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Available rates for the parcel.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementRatesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "No shipping destination is known for this RI's tier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/shipping/label": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "purchaseReimbursementShippingLabel",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Buy a label for the parcel carrying this RI",
        "description": "Buys the selected rate and records the label against the RI, stamping its `hub_tracking_number` / `hub_tracking_company` — the same columns a hand-typed number writes, so settlement reads one shape either way. The label's number is then sent to TCGplayer (#1897); a refusal never fails the purchase and is reported on the RI as `hub_tracking_push_error`. Voiding clears the number locally only, since TCGplayer has no way to clear it.\n**Buying does not settle the RI.** Settling stays with the pick run (`completeFulfillmentRun`) or `fulfillReimbursementInvoice`; nothing about an RI's status is derived from having a label.\nOne parcel means one label: a second purchase while a live one exists is refused 409. Void first if the wrong rate was bought. The `Idempotency-Key` header is required (#3147), so a double click or retry replays the first purchase instead of buying a second label at the carrier; a request without one is a 400 `missing_idempotency_key`. A concurrent request with the same key returns 409 `idempotency_key_in_progress`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyRequired"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReimbursementLabelRequest"
              }
            }
          }
        },
        "responses": {
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "201": {
            "description": "The purchased label.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A shipment already exists for this invoice, or a purchase for it is already in progress (`idempotency_key_in_progress`, also returned while an earlier purchase that may have charged the carrier ends unconfirmed; retry after about 90 seconds and check the carrier account first).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "A stamp or pickup rate_id was sent (not offered for an RI), or `idempotency_key_conflict` when the key was already used for a different request body or another invoice.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/shipping/void": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "voidReimbursementShippingLabel",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Void the RI parcel's label",
        "description": "Voids the label with the carrier and **clears the RI's hub tracking**.\nClearing is deliberate, and the one place a void touches tracking: for an ordinary order a stale number is inert history behind a re-ship that overwrites it, whereas here it is live input to a settle that has not happened yet — an abandoned void would otherwise ship the parcel `tracked` under a number the carrier already refunded.\nWhether the carrier actually refunds is its own decision; a refusal comes back as the carrier's error.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `shipping_purchases:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "412": {
            "description": "The store's shipping carrier isn't connected or its credentials need attention (`easypost_not_connected`, `shipstation_not_connected`, `pitneybowes_not_connected`, `shippo_not_connected`, `<provider>_credentials_incomplete`, `<provider>_credential_invalid`). Reconnect it under Settings > Integrations.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "502": {
            "description": "The carrier failed or couldn't be reached (`carrier_error`). The carrier's own response is never echoed.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "The voided shipment.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shipment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/hub-tracking": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "setReimbursementHubTracking",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Record the tracking for the parcel shipped to TCGplayer",
        "description": "Record the seller's outbound parcel for this RI: the one box carrying the whole pull sheet to the TCGplayer facility named by `hub_destination`.\nIts own route rather than a field on `fulfillReimbursementInvoice`, because an RI has no ship call to carry one — it settles *at* pick-complete on the picked path (`completeFulfillmentRun`, the shared route for every run type) and inside the fulfill on the no-picker one. Keeping it separate also means the tracking is not hostage to the settle succeeding, and can be recorded before or after it: shipping the box and clicking Fulfill are independent events in a warehouse, in either order.\n**Sent to TCGplayer (#1897).** After the save, the number is set on the RI in TCGplayer's seller portal, the same way its detail page's \"Edit\" does. A TCGplayer refusal or an expired session never fails this request or loses the saved number; the outcome comes back in `hub_tracking_pushed_at` / `hub_tracking_push_error`. Saving a number TCGplayer already accepted sends nothing; saving one it refused tries again. Clearing the number sends nothing, since TCGplayer has no way to clear an RI's tracking.\nWrites `hub_tracking_number` / `hub_tracking_company`, never the RI's `tracking_number`, which is TCGplayer's own copy scraped from the detail page and reassigned on every re-scan.\nSending an empty or whitespace-only `tracking_number` clears both fields, which is the undo for a mistyped number. Clearing the number clears the carrier with it, since a carrier alone describes no parcel.\nA field the body **omits** is left as it is — only a blank string clears, so a partial body cannot erase a recorded parcel by accident. Sending `tracking_company` alone corrects the carrier of a parcel that already has a number, and is dropped when there is no number to attach it to.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReimbursementHubTrackingRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "A field failed validation (`validation_error`, with `validation_errors` naming each field).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The updated Reimbursement Invoice",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementInvoice"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/missing-confirmation": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "put": {
        "operationId": "confirmReimbursementMissing",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Confirm the cards missing from a Reimbursement Invoice before printing its packing slip",
        "description": "Saves how many copies of each line the seller could not find, printed as `-N` in the Notes column of the packing slip (`getReimbursementPackingSlip`). Replaces the whole set: a line the body does not list is saved as 0, so a confirmation always covers the invoice. A record only: it moves no inventory and settles nothing. Returns the invoice detail with each line's `confirmed_missing_quantity`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReimbursementMissingConfirmationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Reimbursement Invoice with the confirmed counts",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementInvoiceDetail"
                }
              }
            }
          },
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`items` is not a list of `{item_uuid, missing_quantity}` (`validation_error`); a count is below 0 or above the line's quantity (`reimbursement_missing_quantity_invalid`); or an item_uuid is not a line of this invoice (`reimbursement_invoice_item_unknown`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/packing-slip": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "get": {
        "operationId": "getReimbursementPackingSlip",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Print a Reimbursement Invoice's packing slip",
        "description": "TCGplayer's RI packing slip as a Letter PDF, laid out as TCGplayer's own printout (header, Mail To, barcode, one table per condition and game, the high-value underline), with `-N` in the Notes cell of each line confirmed missing through `confirmReimbursementMissing`. The hand-filled header lines are left blank. Before any confirmation every Notes cell is blank.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.\n\n**Cost:** 5 rate-limit tokens.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Packing slip PDF",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "description": "attachment; filename=\"packing-slip-{ri_id}.pdf\""
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "413": {
            "description": "The rendered PDF is too large to download as one file (`reimbursement_packing_slip_too_large`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/fulfill": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "fulfillReimbursementInvoice",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Fulfill a Reimbursement Invoice",
        "description": "Request that the RI be marked fulfilled after the seller has pulled, packed, and shipped the batch to TCGplayer. The work runs as a background job, so the call returns `202` with the job in `settle_job`; poll the RI detail's `settle_job` until it is `succeeded` or `failed`. The job decrements physical stock (`total_quantity`) for the RI's SKUs and transitions the held Direct orders it covers to `shipped`.\nAn already queued or running job is checked first: another fulfill is returned as `202` unchanged (idempotent), an unfulfill is a `409` carrying that job. Only when no job is active and the RI is already fulfilled does the call return `200` with the result and `already_fulfilled: true`. Coverage gaps (a SKU with no held order, a SKU absent from the catalog, or a held quantity below the RI's) are reported in `items`/`coverage`, never silently applied to inventory.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Nothing to do; the RI was already fulfilled and no job is active.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementFulfillmentResult"
                }
              }
            }
          },
          "202": {
            "description": "The fulfill job is queued, or a fulfill job is already queued or running for this RI (the call is idempotent). Poll the RI detail's `settle_job`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiSettleJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A job of the opposite kind is queued or running for this RI. The body is an `ErrorResponse` that also carries that job as `settle_job`. Also returned with `error: \"at_cardchaos\"` (no `settle_job`) when the RI is queued in CardChaos; CardChaos pulls its stock, so pick it there. A fulfill also answers `error: \"prepull_pending\"` while a Direct pre-pull run is open for the store (`params.prepull_run_uuid` names the run and `params.program` is direct; finish or cancel it, then request again). Cards already pre-pulled into holding do not refuse it: the fulfill takes them first.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ErrorResponse"
                        },
                        {
                          "$ref": "#/components/schemas/RiSettleJobResponse"
                        }
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The job could not be queued. It was recorded as failed; the request can be retried.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/unfulfill": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "unfulfillReimbursementInvoice",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Reverse a Reimbursement Invoice fulfillment",
        "description": "Manual override — the clean inverse of fulfill, run as a background job: the call returns `202` with the job in `settle_job`; poll the RI detail's `settle_job` until it is `succeeded` or `failed`. The job restores physical stock (`total_quantity`) for every SKU the RI pulled, drops its attribution links, reverts the Direct orders it shipped back to `direct` (held), and clears `fulfilled_at`. Use it to recover from a mis-scan or a wrong-RI fulfill; afterwards the RI can be fulfilled again. COGS and `quantity_visible` are unchanged (the orders return to their reserved state).\nAn already queued or running job is checked first: another unfulfill is returned as `202` unchanged (idempotent), a fulfill is a `409` carrying that job. Only when no job is active and the RI isn't fulfilled does the call return `200` with `was_fulfilled: false`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Nothing to do; the RI wasn't fulfilled and no job is active.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementUnfulfillResult"
                }
              }
            }
          },
          "202": {
            "description": "The unfulfill job is queued, or an unfulfill job is already queued or running for this RI (the call is idempotent). Poll the RI detail's `settle_job`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiSettleJobResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A job of the opposite kind is queued or running for this RI. The body is an `ErrorResponse` that also carries that job as `settle_job`.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/RiSettleJobResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The job could not be queued. It was recorded as failed; the request can be retried.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/review": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "getReimbursementReview",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "TCGplayer Direct review / exceptions surface",
        "description": "Coverage gaps on fulfilled RIs (unmatched / uncatalogued / short items), stuck held Direct orders (reserved but not yet pulled past the age threshold), and the total committed-but-unpulled quantity. The operator surface for reconciling the reserve/pull gaps that never silently move inventory.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The review surface for the store.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimbursementReview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/direct/reimbursement-invoices/{ri_uuid}/pick-run": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/RiUuid"
        }
      ],
      "post": {
        "operationId": "createReimbursementPickRun",
        "tags": [
          "TCGplayer Direct"
        ],
        "summary": "Start picking a Reimbursement Invoice",
        "description": "Create a fulfillment run that picks the RI's line items, so the picker gets real HippoLink bin locations (resolved by the same reallocation engine order picking uses) instead of TCGplayer's internal storage code. The run's demand is the RI's SKUs, resolved **exact-SKU only** — an RI commits exact SKUs to TCGplayer, so no condition substitution is offered. The run is then worked through the normal `/fulfillment/runs/{run_uuid}/...` routes; completing it settles the RI (pull stock, ship the covered held Direct orders). Returns 409 if the RI is already fulfilled or already has an active pick run. The optional `strategy` picks the run's route: `by_location` (default) or `by_game_set_alpha`. `by_order` is refused, since an RI has no orders.\n**Pull order.** `pull_order: bin_route` walks the fewest bins (the `strategy` picks how the sheet prints). `pull_order: invoice_order` walks the RI's lines in TCGplayer's own pull-sheet order (the scanner `position`): every stop carries `walk_seq` and `pick_source` and the run has `walk_order: true`. With `pull_order` omitted the run uses the store's `direct_invoice_order.pull_order` from order settings, and `bin_route` when none is stored, so a caller that sends nothing new walks as before. `save_as_default: true` also stores the sent `pull_order` as that default; it needs the order-settings permission (store managers and owners), and without it the request is a 403. `dont_ask_again: true` does that and also turns off the store's prompt (`direct_invoice_order.ask_each_run` becomes false); it needs a `pull_order` (422 `validation_error` on `pull_order` without one) except on a store with Direct holding on, where it only turns the prompt off. It needs the same permission. Invoice order cannot be combined with the `by_game_set_alpha` strategy (422 `reimbursement_pull_order_conflict`).\n**Holding.** When Direct holding is on for the store, the run always walks the RI in invoice order (`bin_route` is a 422 `reimbursement_invoice_order_required`): every stop carries `walk_seq` (its position on the invoice) and `pick_source` (`holding` for a copy pre-pulled into a holding box, `shelf` for a bin), and the run has `walk_order: true`. A line takes its SKU's holding copies first and the shelf for the rest. Creating the run also creates the Direct pre-pull run the RI needs (the auto pre-pull), if none exists, and answers 409 `prepull_pending` while a pre-pull run is open, so cards are never committed to holding under an open invoice run. Completing the run takes the picked holding copies and releases their commitments.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "enum": [
                      "by_location",
                      "by_game_set_alpha"
                    ],
                    "default": "by_location"
                  },
                  "pull_order": {
                    "type": "string",
                    "enum": [
                      "bin_route",
                      "invoice_order"
                    ],
                    "description": "The run's walk. Omitted means the store's default `direct_invoice_order.pull_order`, else `bin_route`.\n"
                  },
                  "save_as_default": {
                    "type": "boolean",
                    "default": false,
                    "description": "Also store `pull_order` as the store's default Direct pull order."
                  },
                  "dont_ask_again": {
                    "type": "boolean",
                    "default": false,
                    "description": "Store `pull_order` as the store's default and stop asking each run (`direct_invoice_order.ask_each_run` becomes false). Needs `pull_order`, except on a store with Direct holding on.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "422": {
            "description": "`validation_error` (a field failed validation, with `validation_errors` naming each field), `reimbursement_invoice_order_required` (the bin route asked for while Direct holding is on) or `reimbursement_pull_order_conflict` (invoice order with the A-Z printing strategy).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "The pick run for the RI.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "RI already fulfilled, already has an active pick run, is queued in CardChaos (pick it there), or a Direct pre-pull run is still open for the store (`error: \"prepull_pending\"`; `params.prepull_run_uuid` names the run and `params.program` is direct; finish or cancel it, then create the run again).\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-orders": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listCardTraderZeroOrders",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "List informational CardTrader Zero sales",
        "description": "Paginated list of the store's individual CardTrader Zero sales, newest first. These are **informational**: the buyer checked out through CardTrader's hub, so the card ships to the hub in a weekly consolidated parcel rather than to the buyer, and the store never picks or ships these one by one. They are here so a sale is visible, attributable and costed. `cardtrader_state` is the operator's cue for whether a sale is spoken for yet — `hub_pending` means it is awaiting consolidation into a future invoice, `closed` means CardTrader has already folded it into one. The thing the store actually works is the invoice — see `listCardTraderZeroInvoices`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated informational CT Zero sales.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardTraderZeroOrderList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-invoices": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listCardTraderZeroInvoices",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "List CardTrader Zero consolidated invoices",
        "description": "Paginated list of the store's weekly consolidated CardTrader Zero invoices, newest first, with an inline count of those still awaiting fulfillment. Each invoice is the pull sheet for one week's hub parcel: CardTrader closes the outstanding Zero sales and issues one order carrying all of their items. This is the CardTrader analogue of a TCGplayer Direct Reimbursement Invoice, except CardTrader delivers it as a real order rather than something we scrape.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "open",
            "in": "query",
            "description": "When `true`, return only invoices still awaiting fulfillment.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated invoice list with an open count.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardTraderZeroInvoiceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-invoices/{invoice_order_uuid}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/CardTraderZeroInvoiceOrderUuid"
        }
      ],
      "get": {
        "operationId": "getCardTraderZeroInvoice",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "Get a CardTrader Zero invoice with its pull lines",
        "description": "One weekly CardTrader Zero invoice, the consolidated order the store pulls and ships, with its lines. Each line is resolved to its SKU where HippoLink knows the card, with name, set, image, game, condition (in the store's region's grading terms), finish and language; a line HippoLink can't match keeps the name CardTrader gave it and has a `null` SKU. Coverage against the store's held Zero sales (each line's `covered_quantity`, the invoice's `covered_order_count`) is filled in only once the invoice is settled, and is `null` before that. `hub_shipment` is the live label bought for the parcel, if any. Only invoices are found here: an individual Zero sale's id is 404, as is another store's invoice.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The invoice with SKU-resolved pull lines.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardTraderZeroInvoiceDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-invoices/{invoice_order_uuid}/pick-run": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/CardTraderZeroInvoiceOrderUuid"
        }
      ],
      "post": {
        "operationId": "createCardTraderZeroInvoicePickRun",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "Start picking a CardTrader Zero invoice",
        "description": "Create a fulfillment run that picks the weekly invoice's line items, so the picker walks real HippoLink bins instead of working a 200-card parcel off the invoice by hand. The picking counterpart of `fulfillCardTraderZeroInvoice`, which pulls the whole invoice FIFO with no picker; both settle the same way and cannot double-settle.\nCondition resolution is **up-level only** — each line is a card already sold to an end buyer at a stated condition, so an equal-or-better one may be sent and a worse one never may. An up-level is automatic and needs no substitution acknowledgement.\nThe run is then worked through the normal `/fulfillment/runs/{run_uuid}/...` routes. Completing it pulls the picked stock and covers the held Zero sales it can, capped at what the picker actually found; shipping it ships the invoice itself and tells CardTrader, but only once nothing is left to cover — a short pick leaves the invoice open for a second run to finish. Returns 409 if the invoice has already settled or already has an active pick run.\n**Pull order.** `pull_order: bin_route` walks the fewest bins. `pull_order: invoice_order` walks the invoice's lines in `sort_keys` (1 to 4 columns, the way CardTrader sorts the invoice), else the store's `cardtrader_invoice_order.sort_keys` from order settings; with neither it is a 422 `cardtrader_zero_sort_keys_required`. `save_as_default: true` also stores the sent `sort_keys` as that default; it needs the order-settings permission (store managers and owners), and without it the request is a 403. An invoice-order run's stops carry `walk_seq` and `pick_source` and the run has `walk_order: true`. With no body the run walks as before: invoice order on a store with CardTrader Zero holding on, the bin route otherwise. With `pull_order` omitted, `sort_keys` is used only on a store with CardTrader Zero holding on (otherwise the run takes the bin route).\n**Holding.** When CardTrader Zero holding is on, the run always walks invoice order (`bin_route` is a 422 `cardtrader_zero_invoice_order_required`), takes holding copies first (`pick_source: holding`), creates the CardTrader Zero pre-pull run the invoice needs (the auto pre-pull) if none exists, and answers 409 `prepull_pending` while a pre-pull run is open. Completing the run takes the picked holding copies and releases their commitments.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardTraderZeroInvoicePickRunRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The pick run for the invoice.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentRun"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Invoice already settled, already has an active pick run, is queued in CardChaos (pick it there), or a CardTrader Zero pre-pull run is still open for the store (`error: \"prepull_pending\"`; `params.prepull_run_uuid` names the run and `params.program` is ct_zero; finish or cancel it, then create the run again).\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "422": {
            "description": "`validation_error` (an unknown field, a bad pull order, or bad sort keys), `cardtrader_zero_invoice_order_required` (the bin route asked for while CardTrader Zero holding is on) or `cardtrader_zero_sort_keys_required` (invoice order with no sort keys sent and no store default).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-invoices/{invoice_order_uuid}/fulfill": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/CardTraderZeroInvoiceOrderUuid"
        }
      ],
      "post": {
        "operationId": "fulfillCardTraderZeroInvoice",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "Fulfill a CardTrader Zero invoice",
        "description": "Mark the invoice fulfilled after the seller has pulled, packed, and shipped the parcel to CardTrader's hub. Decrements physical stock (`total_quantity`) for the invoice's SKUs, ships the informational Zero sales it covers (matched by exact `tcgplayer_sku_id`, oldest-order-first, and only sales CardTrader has already marked `closed` — a sale still `hub_pending` belongs to a future invoice), and marks the invoice shipped. If `tracking_number` is supplied it is recorded on the invoice and pushed to CardTrader with the ship-back; the covered sales are shipped locally only, since CardTrader closed those itself and a push for each would be redundant. Idempotent — a second call is a no-op returning `already_fulfilled: true`. Coverage gaps never silently move inventory: only what maps to a held reservation is pulled, and every line's coverage is reported.\nThe hub leg can instead go on a label bought for the parcel through `purchaseShippingLabel` on this invoice's order_uuid — send `shipment_uuid`, or send neither field and the invoice's live label supplies the tracking.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardTraderZeroFulfillRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "The request body wasn't valid JSON, or wasn't a JSON object (`request_body_invalid_json`, `request_body_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "200": {
            "description": "The fulfillment summary.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardTraderZeroFulfillmentSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The invoice is queued in CardChaos (`error: \"at_cardchaos\"`, with the invoice's `order_uuids`); CardChaos pulls its stock, so pick it there. Also `error: \"pick_run_active\"` while a pick run for this invoice is open (unassigned, picking or ready to pack; `params.run_uuid` names it; finish or cancel it, then fulfill again), and `error: \"prepull_pending\"` while a CardTrader Zero pre-pull run is open for the store (`params.prepull_run_uuid` names the run and `params.program` is ct_zero; finish or cancel it, then fulfill again). Cards already pre-pulled into holding do not refuse it: the fulfill takes them first.\n",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "order_uuids": {
                          "type": "array",
                          "description": "The invoice's `order_uuid`, present with `error` `at_cardchaos`.",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "The request named the hub parcel's label in a way that cannot be honoured: `hub_tracking_conflict` (both `shipment_uuid` and `tracking_number` sent) or `hub_label_not_found` (the named shipment is voided, or is not this invoice's).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/cardtrader/zero-invoices/{invoice_order_uuid}/unfulfill": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/CardTraderZeroInvoiceOrderUuid"
        }
      ],
      "post": {
        "operationId": "unfulfillCardTraderZeroInvoice",
        "tags": [
          "CardTrader Zero"
        ],
        "summary": "Reverse a CardTrader Zero invoice fulfillment",
        "description": "Manual override, the clean inverse of fulfill: restores `total_quantity` for what was pulled, deletes the coverage links, reverts the sales this invoice shipped back to the held status, and returns the invoice to awaiting fulfillment. COGS and `quantity_visible` are left as-is — the sales return to the reserved/held state they were already in. Nothing is pushed to CardTrader: there is no un-ship call, so a genuinely wrong ship is resolved on CardTrader's own site.\n\n**Who can call this:** Store owner, Store manager.\n\n**Scope required:** `orders:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The reversal summary.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardTraderZeroFulfillmentSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/pull-alerts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        }
      ],
      "get": {
        "operationId": "listPullAlerts",
        "tags": [
          "Pull Alerts"
        ],
        "summary": "List online-sale pull alerts",
        "description": "Paginated list of the store's pull alerts (double-sell guard), newest first. Each alert flags a card sold online that is physically present in a location marked `notify_on_online_sale`, so staff can pull the copy before a walk-in double-sells it. Defaults to `status=pending`.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:read`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by alert status. Defaults to `pending`.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "pulled",
                "dismissed",
                "canceled"
              ],
              "default": "pending"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "A query parameter was malformed (`query_param_invalid`, with `validation_errors` naming the parameter).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "`limit` was past its maximum, or another value was out of range (`query_param_invalid`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "200": {
            "description": "Paginated pull-alert list",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PullAlertList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v1/stores/{store_uuid}/pull-alerts/{alert_uuid}/pull": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/AlertUuid"
        }
      ],
      "post": {
        "operationId": "markPullAlertPulled",
        "tags": [
          "Pull Alerts"
        ],
        "summary": "Mark a pull alert pulled",
        "description": "Record that staff pulled the physical copy from the flagged location. Sets the alert to `pulled` (terminal). Idempotent — a non-pending alert is returned unchanged.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The updated pull alert",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PullAlert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/v1/stores/{store_uuid}/pull-alerts/{alert_uuid}/dismiss": {
      "parameters": [
        {
          "$ref": "#/components/parameters/StoreUuid"
        },
        {
          "$ref": "#/components/parameters/AlertUuid"
        }
      ],
      "post": {
        "operationId": "dismissPullAlert",
        "tags": [
          "Pull Alerts"
        ],
        "summary": "Dismiss a pull alert",
        "description": "Dismiss the alert without pulling (e.g. a false positive, or the copy was already set aside). Sets it to `dismissed` (terminal). Idempotent — a non-pending alert is returned unchanged.\n\n**Who can call this:** Store owner, Store manager, Store employee.\n\n**Scope required:** `inventory:write`.\n\n**Idempotency:** send an `Idempotency-Key` header so a retry can't run this twice. See the Idempotency section of the API description.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The updated pull alert",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PullAlert"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from `POST /v1/auth/token`: an RS256 JWT issued by `https://auth.hippolink.app`, valid for one hour. Exchange the API key again when it expires, or once after a gateway 401 (`{\"message\":\"Unauthorized\"}`)."
      },
      "apiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "hlak_ API key",
        "description": "An API key (`hlak_...`), accepted only by `POST /v1/auth/token`, which exchanges it for an access token."
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "Opaque identifier for this request (the API Gateway request id), for debugging/support. Sent on every answer HippoLink's code makes; the gateway's own answers do not carry it.\n",
        "schema": {
          "type": "string"
        }
      },
      "ETag": {
        "description": "Entity tag for optimistic concurrency control",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Limit": {
        "description": "Size of this key's request bucket, in rate-limit tokens. Present once the request reached the rate limiter; absent on gateway answers and on the key refusals made before it.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Rate-limit tokens left in this key's bucket after this request.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Whole seconds until this key's bucket is full again.",
        "schema": {
          "type": "integer"
        }
      },
      "Idempotent-Replayed": {
        "description": "`true` when this answer is the stored result of an earlier request with the same `Idempotency-Key`, not a new run. Absent otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "parameters": {
      "StoreUuid": {
        "name": "store_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "RuleUuid": {
        "name": "rule_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "PurchaseUuid": {
        "name": "purchase_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "TcgplayerSkuId": {
        "name": "tcgplayer_sku_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      },
      "LotId": {
        "name": "lot_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      },
      "TcgplayerProductId": {
        "name": "tcgplayer_product_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      },
      "IncludeSlabs": {
        "name": "include_slabs",
        "in": "query",
        "description": "Also include the store's graded slabs of this card, each row carrying its `graded` label (#3528). A slab is its own product, so without this the card's history leaves them out.\n",
        "schema": {
          "type": "boolean",
          "default": false
        }
      },
      "RebuildUuid": {
        "name": "rebuild_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "LocationUuid": {
        "name": "location_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "OrderTransferUuid": {
        "name": "transfer_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "RepriceJobUuid": {
        "name": "reprice_job_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "JobUuid": {
        "name": "job_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional. A unique value for this action: 1 to 255 printable ASCII characters, ideally a UUIDv4 made once per logical operation. Send the same value when you retry the action. A completed request with this key answers again with the stored status and body; on a write operation the replay also carries `Idempotent-Replayed: true`. The key is scoped to the store and lasts 24 hours. Reusing it for a different body, resource or user is 422 `idempotency_key_conflict`; a request with this key still running is 409 `idempotency_key_in_progress`; a malformed value is 400 `idempotency_key_invalid`. See the Idempotency section of the API description.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "IdempotencyKeyRequired": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Required on this operation: a request without it is 400 `missing_idempotency_key`. A unique value for this action: 1 to 255 printable ASCII characters, ideally a UUIDv4 made once per logical operation. Send the same value when you retry the action. A completed request with this key answers again with the stored status and body; on a write operation the replay also carries `Idempotent-Replayed: true`. The key is scoped to the store and lasts 24 hours. Reusing it for a different body, resource or user is 422 `idempotency_key_conflict`; a request with this key still running is 409 `idempotency_key_in_progress`; a malformed value is 400 `idempotency_key_invalid`. See the Idempotency section of the API description.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "IfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": false,
        "description": "ETag value from a prior GET. If provided and the resource has changed since, the server returns 412 Precondition Failed.\n",
        "schema": {
          "type": "string"
        }
      },
      "IfMatchRequired": {
        "name": "If-Match",
        "in": "header",
        "required": true,
        "description": "ETag value from a prior GET or write. Required: a missing header is 428 Precondition Required, and a stale one is 412 Precondition Failed.\n",
        "schema": {
          "type": "string"
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Maximum number of items to return (1–250). Defaults to 50 unless overridden by the endpoint (e.g. reprice history defaults to 7).\n",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 250,
          "default": 50
        }
      },
      "RecountMinFlagsPerBin": {
        "name": "min_flags_per_bin",
        "in": "query",
        "description": "Only bins holding at least this many open recount flags (1-100). Defaults to the store's `recount_alert_min_flags_per_bin` (on `listRecountFlags`, for `status=open` only; other statuses default to 1). Send 1 to see every bin.\n",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "Offset": {
        "name": "offset",
        "in": "query",
        "description": "Number of items to skip for pagination",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      },
      "After": {
        "name": "after",
        "in": "query",
        "description": "Opaque forward cursor for keyset pagination. Omit on the first page; on subsequent pages pass the `next_cursor` returned by the previous response. The token is scoped to the exact filter set that produced it — drop it and restart from the first page whenever any filter changes.\n",
        "schema": {
          "type": "string"
        }
      },
      "Count": {
        "name": "count",
        "in": "query",
        "description": "When `true`, the response includes `total` (the full count of matching rows, ignoring the cursor). Off by default because the count is the expensive query cursor pagination exists to avoid; request it only when the UI needs a total.\n",
        "schema": {
          "type": "boolean",
          "default": false
        }
      },
      "Condition": {
        "name": "condition",
        "in": "query",
        "description": "Filter by card condition. Accepts one or more values (e.g. ?condition=Near Mint&condition=Lightly Played). An `eu` store may filter in its own Cardmarket/MKM vocabulary; values are translated to the stored US grades server-side (#1599).\n",
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardConditionInput"
          }
        },
        "style": "form",
        "explode": true
      },
      "InventoryLanguage": {
        "name": "language",
        "in": "query",
        "description": "Filter by card language (e.g. English, Japanese). Accepts one or more values (e.g. ?language=English&language=Japanese). Matches products with at least one SKU in one of the given languages.\n",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "style": "form",
        "explode": true
      },
      "InventoryFinish": {
        "name": "finish",
        "in": "query",
        "description": "Filter by card finish (e.g. normal, foil). Accepts one or more values (e.g. ?finish=foil&finish=etched). Matches products with at least one SKU of one of the given finishes.\n",
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CardFinish"
          }
        },
        "style": "form",
        "explode": true
      },
      "PriceMin": {
        "name": "price_min",
        "in": "query",
        "description": "Minimum price filter (inclusive), in USD. Per SKU (#2591); `is:whole_card` in `search` reads it per card.\n",
        "schema": {
          "type": "number",
          "format": "double"
        }
      },
      "PriceMax": {
        "name": "price_max",
        "in": "query",
        "description": "Maximum price filter (inclusive), in USD. Per SKU (#2591); `is:whole_card` in `search` reads it per card.\n",
        "schema": {
          "type": "number",
          "format": "double"
        }
      },
      "Search": {
        "name": "search",
        "in": "query",
        "description": "Scryfall-style search string combining inline operators with free text (#1531). Supported operators, matched case-insensitively: `set:`/`e:` (matches either the full set name or the short set code, case-insensitive; exact full-string by default, or use `*` as a wildcard for a partial match, e.g. `set:Commander*` — same semantics and the same underlying clause as the structured `set_name` param below, regardless of quoting or value length), `cn:`/`number:` (exact, case-insensitive match against the collector/product number — same as the structured `product_number` param), and `c:`/`color:` (Magic color identity: single-letter tokens either concatenate with no separator or comma-separate, e.g. `c:wu` and `c:w,u` are equivalent; the card's identity must contain every letter, so `c:ur` is both U and R (#2857; the structured `color` param below stays an overlap); accepts the same `W`/`U`/`B`/`R`/`G`/`C`/`M` vocabulary, and rejects with the same message, as the structured `color` param below), and `usd:` / `selling_usd:` (sell price — matches a product with any SKU whose price satisfies the comparison) / `buylist_usd:` (buy price — same \"any SKU\" reading against what the store's buylist pays, i.e. a SKU the store's buylist rules decline never matches). The two price operators additionally accept `>=`/`<=`/`>`/`<`/`=` in place of the bare `:`, e.g. `usd>=9`, `buylist_usd<=2.5`; a bare `usd:5` reads as `usd<=5` (5 or less, not equality — the same numeric-field convention the structured price params below don't share, since they're already unambiguous). Unlike every other operator here, repeating a price operator accumulates rather than overwriting, so a range is expressible: `usd>=5 usd<=10`. Negating a price comparator with a leading `-` (e.g. `-usd>=9`) is rejected with 422 — not supported yet. The syntax follows Scryfall's (https://scryfall.com/docs/syntax) wherever it has an analog (#2405): `s:`/`edition:` also mean `set:`, `cn:` also means `number:` (the older `num:` is not an operator any more and reads as name text), `r:`/`rarity:` (exact, case-insensitive — `r:rare` does not match \"Super Rare\"), `lang:`/`language:` (a language name, or a Scryfall code such as `ja`, `zhs`), `is:foil` / `is:nonfoil` / `is:etched` (finish, the coarse cross-game spelling — `foil` covers every foil finish), the printing's foil treatment as `is:<treatment>` (`is:oilslick`, `is:surgefoil`, `is:galaxyfoil`, `is:dazzlefoil` for \"Pool Party Foil\", ... the catalog's promo-type keys, one per label the storefront shows, not the label text itself; Magic only). A treatment is a property of the card printing and only ever applies to its foil finishes, so `is:surgefoil` never matches the non-foil copy of the same card and `is:nonfoil is:surgefoil` matches nothing. `(is:oilslick or is:surgefoil)` works, but a group cannot mix a finish with a treatment, and two different treatments ANDed (`is:neonink is:neoninkblue`) must both be on the printing), `is:retail_locked` / `is:buylist_locked` (the cards whose retail price, or buylist offer, the store has locked against repricing. These are another spelling of the system tags `tag:no-repricing-retail` / `tag:no-repricing-buylist` and behave as `tag:` does in every respect: they match on the product, a product matching when any copy the store holds is locked, so the row's totals still cover all of its copies; `-is:retail_locked` is every product with no locked copy; `(is:retail_locked or is:buylist_locked)` is either lock, and a group cannot mix a lock with a finish or a treatment. The copies considered are the ones the request's per-copy filters leave, so with `cond:nm` only a locked Near Mint copy counts. A filtered bulk action that works per copy (bulk move, the synchronous bulk delete) acts on the locked copies only; the delete-everything-matching job is whole-product, as it is for every filter. A lock on a card the store does not currently hold is not listed, since this list is the store's holding), and `finish:` (the exact stored finish, e.g. `holofoil`, `reverse_holofoil`, `1st_edition`, `cold_foil`, `rainbow_foil`; validated against the game named by `game:` when there is one). Inventory concepts Scryfall has no analog for use their own names: `cond:` / `condition:` (a condition name or grade abbreviation in the store's own vocabulary, e.g. `lp`; on an `eu` store that is Cardmarket's, so `lp` is Light Played and `good`, `excellent` and `poor` work, matching the structured `condition` param), `game:` (the game, e.g. `game:pokemon`; Scryfall's `game:` picks a platform such as paper or arena, and the values cannot collide), `type:` (the product category — `card`, `token`, `sealed` or `graded`, a store's own graded slabs; `t:` is deliberately not an alias, since Scryfall's `t:` is a card type line, which this is not), `bin:` and `container:` (where the copies physically are — the location's own name or its `custom_id`, matched as a case-insensitive, diacritic-folded SUBSTRING, so `bin:zendikar` finds `Magic - Zendikar Rising - NM`; a `*` is an explicit wildcard inside the term. `bin:` names the shelf holding the cards and `container:` selects that container's whole subtree at any depth, so `container:\"Back Room\" bin:\"Slot 3\"` is that slot inside that room. Each matches the location's OWN label, never the whole breadcrumb — a bin is reachable by its own name through `bin:` and by any of its ancestors' through `container:`. Quote a label with spaces: unquoted, `bin:Slot 3` searches for a bin matching `Slot` plus the free text `3`. The subtree reading matches the `location_uuid` param's, so a container is selectable in both), `cert:` / `grader:` / `grade:` (a graded slab's own grading: `cert:` matches the certification number with spaces and hyphens ignored, `grader:psa` the grading company, `grade:10` the grade's code or label, all case-insensitively; each narrows to the store's slabs), and the comparators `qty` (quantity on hand; a bare `qty:2` reads as \"at least 2\") / `qty_visible` (whole numbers), `cogs` (average cost; a bare `cogs:5` reads as \"at most 5\") and `updated` / `sold` (last inventoried / last copy sold; ISO dates like `updated>=2026-01-31`, a date naming a whole UTC day, a bare `sold:2026-01-31` meaning that day). Each of these applies ANDed with the structured param of the same meaning when both are sent (the stricter bound wins, list values intersect); two different `lang:`, `cond:`, `finish:` or `is:foil|nonfoil|etched` tokens therefore match nothing — write `(lang:en or lang:ja)` for either. Two `bin:` or two `container:` tokens are the same case for the same reason — a copy sits in exactly one place — so `(bin:a or bin:b)` is how either shelf is asked for. Values of ONE operator can be ORed inside parentheses this way for `set:`, `cn:`, `c:`, `r:`, `type:`, `lang:`, `cond:`, `finish:`, `is:`, `tag:`, `bin:` and `container:` (`(set:woe or set:dsk)`, `(tag:signed or tag:graded)`); each group is one more ANDed clause. A group must hold operators of a single kind, none negated, and not the comparison operators or `game:` — anything else in a group is rejected with 422 rather than half-applied. Parentheses that are not such a group (`Forest (Full Art)`) stay ordinary name text. A leading `-` excludes for `set:`, `cn:`, `r:`, `type:`, `c:`, `tag:`, `lang:`, `cond:`, `finish:` and `is:foil|nonfoil|etched|retail_locked|buylist_locked` (`-set:woe`, `-r:rare`, `-cn:33`, `-type:sealed`, `-c:r`, `-tag:signed`, `-lang:ja`, `-cond:nm`, `-is:foil`). `set:`, `cn:`, `r:`, `type:`, `c:` and `tag:` match on the product, so `-set:woe` is every product not in that set, a product with no set code included — and `-c:r` is every product whose color identity does not include red, a colorless card and a non-Magic product included. `lang:`, `cond:`, `finish:` and `is:foil|nonfoil|etched` narrow which of a product's copies count, so `-lang:ja` is the copies that are not Japanese: a product with only Japanese copies drops out, the totals cover the other copies, and a bulk move or delete acts on those copies only. Several negated tokens all apply (`-set:woe -set:dsk` is neither, `-c:w -c:u` is neither color), and a negated and a positive token of one operator combine (`lang:en -lang:ja`). `-cond:` reads the store's own vocabulary like `cond:`. Negating any other operator (`-is:<treatment>`, `-game:`, `-bin:`, `-container:`, the comparators), or an `or` group, is rejected with 422 — not supported yet. Quote a value to embed spaces, e.g. `set:\"Wilds of Eldraine\"`; quoting otherwise has no effect on this endpoint. Free text uses the catalog search's rules: a double-quoted span is one ordered phrase (#2857). Repeating a comparator operator (`usd`, `buylist_usd`, `qty`, `qty_visible`, `cogs`, `updated`, `sold`) accumulates, and repeating `tag:`, `lang:`, `cond:`, `finish:`, `is:`, `bin:` or `container:` ANDs; repeating `set:`, `cn:` or `c:` overwrites the earlier value, only the last occurrence applying, and two different `r:` or `type:` values are rejected with 422 (a negated token never counts as one of the two, so `r:mythic -r:rare` is fine). Any remaining free text is matched per-word on product name (or a double-faced card's alternate back-face name): the term is split on whitespace and each word must appear in the name or an alt name (case-insensitive, in any order, not necessarily contiguous), so `Avatar Play Display` finds `Avatar The Last Airbender - Play Booster Display`. Results are ordered best-match-first by name similarity (in-stock cards first). When nothing matches exactly, a typo-tolerant fuzzy fallback retries (e.g. `Avatr` still resolves to `Avatar`).\nPrice operators (`usd`, `selling_usd`, `buylist_usd`) match per SKU: a row, its expanded SKU list and a bulk action cover only the copies whose own price passes, and a range needs a copy inside it. `is:whole_card` switches to the card-grain reading -- the card matches if any copy passes, and every copy of it is included. It cannot be negated or grouped.\nFree text of exactly two words that reads as a set code plus a collector number (`MAT 193`, `SVI 74`, `MAT #193`, `NEO 193a`) also matches that printing directly, no operators needed (#2129). It is an addition to the name match, never a replacement, so a card whose name reads the same way (`Munkidori 095`) still resolves by name; quote the phrase to opt out. The free-text minimum term length still applies to the pair as a whole — one of the two words must reach three characters, so `EB 123` resolves but `EB 12` is rejected as too short before the shorthand is read at all.\n\nComposition: an inline operator is ANDed with both the free-text remainder and any matching structured param passed in the same request (e.g. `search=e:WOE&set_name=...` applies both predicates — neither silently overrides the other); catalog search's `q` composes the same way. A search carrying any free text (with or without operators) runs this search path, which also surfaces products with no current stock but a sales history (a card the store sold through or deleted still appears, with zero quantity); a search made up entirely of operators (no free-text remainder) skips that expansion and instead behaves exactly like the equivalent structured filters — live inventory only.\n\nA `<prefix>:` token whose prefix isn't one of the operators above is ordinary free text, not an error — a colon in a name (`Kamigawa: Neon Dynasty`, `Sol Ring:`) just searches normally. This differs from catalog search's `q`, which 422s on an unrecognized operator. 422 here is scoped to a *recognized* operator used wrong: an empty value (e.g. `set:`) or an invalid `c:`/`color:` token — the latter a stricter status than the structured `color` param below, which rejects the same invalid token with 400; every other filter-validation error on this endpoint (bad `sort_by`, a malformed decimal, etc.) also stays 400.\n",
        "schema": {
          "type": "string"
        }
      },
      "QuantityMin": {
        "name": "quantity_min",
        "in": "query",
        "description": "Minimum quantity filter (inclusive)",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "QuantityMax": {
        "name": "quantity_max",
        "in": "query",
        "description": "Maximum quantity filter (inclusive)",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "QuantityVisibleMin": {
        "name": "quantity_visible_min",
        "in": "query",
        "description": "Minimum visible quantity filter (inclusive)",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "QuantityVisibleMax": {
        "name": "quantity_visible_max",
        "in": "query",
        "description": "Maximum visible quantity filter (inclusive)",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "SortBy": {
        "name": "sort_by",
        "in": "query",
        "description": "Field to sort inventory results by (product-level)",
        "schema": {
          "type": "string",
          "enum": [
            "product_name",
            "product_number",
            "rarity",
            "total_quantity",
            "total_quantity_visible",
            "sku_count",
            "price_min",
            "price_max",
            "first_inventoried_at",
            "last_inventoried_at",
            "cogs_avg",
            "last_copy_sold_at"
          ]
        }
      },
      "InventoryRarity": {
        "name": "rarity",
        "in": "query",
        "description": "Filter by rarity (case-insensitive substring match, e.g. \"Rare\")",
        "schema": {
          "type": "string"
        }
      },
      "InventoryColor": {
        "name": "color",
        "in": "query",
        "description": "Filter by Magic color identity. Letters are MTGJSON color-identity codes (W=White, U=Blue, B=Black, R=Red, G=Green); C matches colorless cards and M matches multicolor cards. Multiple values combine as OR. Color data exists only for magic, so combine with the game parameter.\n",
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "W",
              "U",
              "B",
              "R",
              "G",
              "C",
              "M"
            ]
          }
        },
        "style": "form",
        "explode": true
      },
      "InventorySetName": {
        "name": "set_name",
        "in": "query",
        "description": "Filter by set/expansion, matched against either the full set name (\"Wilds of Eldraine\") or the short set code (\"WOE\"). Case-insensitive and exact (full-string) by default; use `*` as a wildcard for a partial match, e.g. \"Commander*\".\n",
        "schema": {
          "type": "string"
        }
      },
      "InventoryProductNumber": {
        "name": "product_number",
        "in": "query",
        "description": "Filter by collector number (case-insensitive exact match, e.g. \"123a\")",
        "schema": {
          "type": "string"
        }
      },
      "InventoryCOGSMin": {
        "name": "cogs_min",
        "in": "query",
        "description": "Minimum weighted-average cost of goods (inclusive)",
        "schema": {
          "type": "number",
          "format": "double",
          "minimum": 0
        }
      },
      "InventoryCOGSMax": {
        "name": "cogs_max",
        "in": "query",
        "description": "Maximum weighted-average cost of goods (inclusive)",
        "schema": {
          "type": "number",
          "format": "double",
          "minimum": 0
        }
      },
      "SortDir": {
        "name": "sort_dir",
        "in": "query",
        "description": "Sort direction",
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ]
        }
      },
      "FirstInventoriedAfter": {
        "name": "first_inventoried_after",
        "in": "query",
        "description": "Include only records first inventoried at or after this timestamp (inclusive, ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "FirstInventoriedBefore": {
        "name": "first_inventoried_before",
        "in": "query",
        "description": "Include only records first inventoried before this timestamp (exclusive, ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "LastInventoriedAfter": {
        "name": "last_inventoried_after",
        "in": "query",
        "description": "Include only records last inventoried at or after this timestamp (inclusive, ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "LastInventoriedBefore": {
        "name": "last_inventoried_before",
        "in": "query",
        "description": "Include only records last inventoried before this timestamp (exclusive, ISO 8601)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "LastCopySoldAfter": {
        "name": "last_copy_sold_after",
        "in": "query",
        "description": "Include only products whose last copy sold at or after this timestamp (inclusive, ISO 8601). \"Last copy sold\" is the most recent non-canceled, non-refunded sale of any SKU variant. Products with no such sale are excluded.\n",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "LastCopySoldBefore": {
        "name": "last_copy_sold_before",
        "in": "query",
        "description": "Include only products whose last copy sold before this timestamp (exclusive, ISO 8601) — i.e. stale stock last sold before the cutoff. Products with no non-canceled, non-refunded sale are excluded (use `never_sold` for those).\n",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "NeverSold": {
        "name": "never_sold",
        "in": "query",
        "description": "When true, include only products that have never had a non-canceled, non-refunded sale of any SKU variant (`last_copy_sold_at` is null). Mutually exclusive with the `last_copy_sold_*` bounds.\n",
        "schema": {
          "type": "boolean"
        }
      },
      "InventoryTags": {
        "name": "tags",
        "in": "query",
        "description": "Filter by store tag. Comma-separated; a product matches if it carries at least one of the given tag slugs, at either product or SKU grain (OR semantics, mirroring how the `color` query parameter combines). Case-insensitive -- slugs are stored lowercase and the filter normalizes on the way in.\n\nThe `tag:` / `-tag:` inline operators on `search` are the AND-ing counterpart: repeated `tag:` tokens each narrow further, and `-tag:` excludes (matching untagged cards, not dropping them). Both apply, ANDed, when a request carries each.\n\nThe two lock-backed system tags, `no-repricing-retail` and `no-repricing-buylist`, are accepted here and by `tag:` like any other slug. They carry no assignment; a product matches when the store has locked the retail price, or the buylist offer, of a copy it holds.\n",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "style": "form",
        "explode": true
      },
      "OrderUuid": {
        "name": "order_uuid",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "RiUuid": {
        "name": "ri_uuid",
        "in": "path",
        "required": true,
        "description": "Reimbursement Invoice UUID (HippoLink's ``ri_uuid`` primary key).",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "CardTraderZeroInvoiceOrderUuid": {
        "name": "invoice_order_uuid",
        "in": "path",
        "required": true,
        "description": "The consolidated invoice's `order_uuid`. It is an order UUID rather than an id of its own because CardTrader delivers the invoice as a real order — there is no separate invoice table.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "AlertUuid": {
        "name": "alert_uuid",
        "in": "path",
        "required": true,
        "description": "Online-sale pull alert UUID (``alert_uuid`` primary key).",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "MarketplaceFilter": {
        "name": "marketplace",
        "in": "query",
        "description": "Filter by marketplace. Accepts one or more values (e.g. ?marketplace=tcgplayer&marketplace=shopify). Includes KIOSK, since this filters orders (see OrderMarketplace) rather than a marketplace listing/sync target.\n",
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/OrderMarketplace"
          }
        },
        "style": "form",
        "explode": true
      },
      "OrderStatusFilter": {
        "name": "status",
        "in": "query",
        "description": "Filter by order status. Accepts one or more values (e.g. ?status=unfulfilled&status=processing).\n",
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/OrderStatus"
          }
        },
        "style": "form",
        "explode": true
      },
      "OrderedAfter": {
        "name": "ordered_after",
        "in": "query",
        "description": "Include only orders placed at or after this timestamp (inclusive, RFC 3339 with a time zone)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "OrderedBefore": {
        "name": "ordered_before",
        "in": "query",
        "description": "Include only orders placed before this timestamp (exclusive, RFC 3339 with a time zone)",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "OrderSortBy": {
        "name": "sort_by",
        "in": "query",
        "description": "Field to sort order results by. `buyer_name` sorts on \"first last\", case-insensitively; `item_count` on the order's billable card quantity.\n",
        "schema": {
          "type": "string",
          "enum": [
            "ordered_at",
            "updated_at",
            "order_total",
            "status",
            "marketplace",
            "fulfillment_method",
            "marketplace_order_id",
            "buyer_name",
            "item_count"
          ]
        }
      },
      "InventorySync": {
        "name": "sync",
        "in": "query",
        "description": "`true` starts a sync of `listInventory`: no rows, and a `next_cursor` to poll from with `after` once the full list has been read. Takes only `limit` beside it.\n",
        "schema": {
          "type": "boolean"
        }
      },
      "InventorySyncCursor": {
        "name": "after",
        "in": "query",
        "description": "The `next_cursor` of the previous sync page or poll of `listInventory`. Opaque: pass it back unchanged. Takes only `limit` beside it.\n",
        "schema": {
          "type": "string"
        }
      },
      "OrderUpdatedAfter": {
        "name": "updated_after",
        "in": "query",
        "description": "Include only orders whose `updated_at` is at or after this timestamp (inclusive, RFC 3339 with a time zone, e.g. `2026-11-26T15:04:05.123456Z`) and at least 60 seconds old. On `listOrders` it lists by `updated_at` ascending and returns `next_cursor` and `has_more`, and cannot be combined with `offset`, another `sort_by`, or `sort_dir=desc`. On `countOrders` it counts the same orders.\n",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "OrderCursor": {
        "name": "after",
        "in": "query",
        "description": "The `next_cursor` from the previous page of an `updated_after` walk. Opaque: pass it back unchanged, with the same `updated_after` and filters. Cannot be combined with `offset`, another `sort_by`, or `sort_dir=desc`.\n",
        "schema": {
          "type": "string"
        }
      },
      "OrderSearch": {
        "name": "search",
        "in": "query",
        "description": "Free-text search on marketplace order ID, buyer name, or product names",
        "schema": {
          "type": "string"
        }
      },
      "ProblematicFilter": {
        "name": "problematic",
        "in": "query",
        "description": "Filter by problematic flag. ?problematic=true returns only orders flagged for operator review (oversells, etc.); ?problematic=false returns only non-flagged orders. Omit to return both.\n",
        "schema": {
          "type": "boolean"
        },
        "style": "form",
        "explode": true
      },
      "ResolvedFilter": {
        "name": "resolved",
        "in": "query",
        "description": "Filter by resolution status. ?resolved=true returns only orders with a resolution recorded (resolution IS NOT NULL); ?resolved=false returns only orders without one. Compose with ?problematic=true&resolved=false for an unresolved-needs-attention view.\n",
        "schema": {
          "type": "boolean"
        },
        "style": "form",
        "explode": true
      },
      "ResolvedAfter": {
        "name": "resolved_after",
        "in": "query",
        "description": "Include only orders whose resolution was recorded at or after this timestamp (inclusive, RFC 3339 with a time zone). Filters on `resolved_at`, when the resolution was recorded, not on `ordered_at`; orders with no resolution never match. Compose with ?problematic=true&resolved=true for the \"resolutions this week\" view.\n",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ResolvedBefore": {
        "name": "resolved_before",
        "in": "query",
        "description": "Include only orders whose resolution was recorded before this timestamp (exclusive, RFC 3339 with a time zone). Filters on `resolved_at`; see `resolved_after`.\n",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ResolutionFilter": {
        "name": "resolution",
        "in": "query",
        "description": "Include only orders recorded with one of these resolutions (comma-separated). `reopened` is a request-side action on updateOrder, not a stored value, and is rejected with 400.\n",
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "alternate_copy_fulfilled",
              "partially_fulfilled",
              "unable_to_fulfill",
              "flagged_in_error"
            ]
          }
        },
        "style": "form",
        "explode": false
      },
      "HeldFilter": {
        "name": "held",
        "in": "query",
        "description": "Filter by presale hold. ?held=true returns only held orders (hold_until in the future); ?held=false returns only not-held orders (hold_until null or in the past). Omit to return both.\n",
        "schema": {
          "type": "boolean"
        },
        "style": "form",
        "explode": true
      },
      "KioskFlaggedFilter": {
        "name": "kiosk_flagged",
        "in": "query",
        "description": "Filter by kiosk stale-order flag. ?kiosk_flagged=true returns only orders flagged for review by the kiosk-stale-flag sweep (kiosk_flagged_at IS NOT NULL); ?kiosk_flagged=false returns only non-flagged orders. Omit to return both.\n",
        "schema": {
          "type": "boolean"
        },
        "style": "form",
        "explode": true
      },
      "ReadyForPickupFilter": {
        "name": "ready_for_pickup",
        "in": "query",
        "description": "Filter by ready-for-pickup state. ?ready_for_pickup=true returns only orders awaiting customer pickup (marked ready and not in a terminal status); ?ready_for_pickup=false returns the complement. Omit to return both.\n",
        "schema": {
          "type": "boolean"
        },
        "style": "form",
        "explode": true
      },
      "FulfillmentMethodFilter": {
        "name": "fulfillment_method",
        "in": "query",
        "description": "Filter by fulfillment method (exact-value match). Orders whose fulfillment method is null/unknown match neither value.\n",
        "schema": {
          "type": "string",
          "enum": [
            "ship",
            "pickup",
            "in_store"
          ]
        }
      },
      "ExpectedShippingClassFilter": {
        "name": "expected_shipping_class",
        "in": "query",
        "description": "Filter by the predicted shipping class (`OrderSummary.expected_shipping_class`, #3585). Accepts one or more values (e.g. ?expected_shipping_class=letter&expected_shipping_class=flat for every PWE order, #3555). Applied in SQL before paging. An order with no prediction (pickup, in-store, not yet computed) matches no value.\n",
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "tracked"
            ]
          }
        },
        "style": "form",
        "explode": true
      },
      "ShippingMethodFilter": {
        "name": "shipping_method",
        "in": "query",
        "description": "Filter by the marketplace-reported shipping method (exact-value match against free-text metadata, e.g. ManaPool's shipping_method). Best-effort and nullable — orders with no captured value match neither value.\n",
        "schema": {
          "type": "string"
        }
      },
      "OrderGameFilter": {
        "name": "game",
        "in": "query",
        "description": "Filter to orders with at least one line of this game (\"order matches if any line matches\").\n",
        "schema": {
          "type": "string",
          "enum": [
            "magic",
            "pokemon",
            "lorcana",
            "onepiece",
            "riftbound",
            "unionarena",
            "pokemonjp",
            "gundam",
            "starwars",
            "yugioh",
            "cyberpunk",
            "palworld",
            "digimon",
            "fleshblood",
            "cookierun",
            "sleeves",
            "sorcery",
            "wow",
            "deckboxes",
            "playmats",
            "binders",
            "colstorage",
            "counters",
            "vanguard",
            "dbsmasters",
            "dbsfusion",
            "weiss"
          ]
        }
      },
      "OrderConditionFilter": {
        "name": "condition",
        "in": "query",
        "description": "Filter to orders with at least one line of this card condition (\"order matches if any line matches\").\n",
        "schema": {
          "$ref": "#/components/schemas/CardCondition"
        }
      },
      "OrderFinishFilter": {
        "name": "finish",
        "in": "query",
        "description": "Filter to orders with at least one line of this finish (\"order matches if any line matches\").\n",
        "schema": {
          "$ref": "#/components/schemas/CardFinish"
        }
      },
      "OrderLanguageFilter": {
        "name": "language",
        "in": "query",
        "description": "Filter to orders with at least one line of this language (\"order matches if any line matches\").\n",
        "schema": {
          "type": "string",
          "enum": [
            "English",
            "Chinese (S)",
            "Chinese (T)",
            "French",
            "German",
            "Italian",
            "Japanese",
            "Korean",
            "Portuguese",
            "Portuguese (Brazil)",
            "Russian",
            "Spanish"
          ]
        }
      },
      "ProductTypeFilter": {
        "name": "product_type",
        "in": "query",
        "description": "Filter to orders with at least one sealed (\"sealed\") or non-sealed (\"single\") line (\"order matches if any line matches\"). A line whose SKU isn't in the catalog counts as \"single\".\n",
        "schema": {
          "type": "string",
          "enum": [
            "sealed",
            "single"
          ]
        }
      },
      "OrderSetCodeFilter": {
        "name": "set_code",
        "in": "query",
        "description": "Filter to orders with at least one line from this set code (\"order matches if any line matches\").\n",
        "schema": {
          "type": "string"
        }
      },
      "OrderTotalMin": {
        "name": "total_min",
        "in": "query",
        "description": "Orders whose `order_total` is at least this (inclusive), in the order's own currency. Negative or above `total_max` is a 422 `query_param_invalid`; not a number is a 400.\n",
        "schema": {
          "type": "number",
          "minimum": 0
        }
      },
      "OrderTotalMax": {
        "name": "total_max",
        "in": "query",
        "description": "Orders whose `order_total` is at most this (inclusive), in the order's own currency.\n",
        "schema": {
          "type": "number",
          "minimum": 0
        }
      },
      "OrderItemCountMin": {
        "name": "item_count_min",
        "in": "query",
        "description": "Orders whose `item_count` (copies on HippoLink lines, the list's Card Items) is at least this (inclusive). Above `item_count_max` is a 422 `query_param_invalid`.\n",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "OrderItemCountMax": {
        "name": "item_count_max",
        "in": "query",
        "description": "Orders whose `item_count` (copies on HippoLink lines) is at most this (inclusive).\n",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid Bearer token. The gateway refuses a bad token before any HippoLink code runs and answers `{\"message\":\"Unauthorized\"}` (`GatewayMessage`): no `error`, no request id in the body, and neither an `X-Request-Id` nor a rate-limit header. A 401 HippoLink itself raises is an `ErrorResponse` and carries `X-Request-Id`; tell the two apart by the missing `error`. Sign in or exchange the key again once. A path no route serves is likewise answered by the gateway, as a 404 `{\"message\":\"Not Found\"}`.\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                {
                  "$ref": "#/components/schemas/GatewayMessage"
                }
              ]
            }
          }
        }
      },
      "Forbidden": {
        "description": "Account not authorized to access this store. For an API key also `api_key_ip_not_allowed` (the key is limited to other IP addresses; `params.source_ip` is yours), `api_key_store_denied` (no grant on this store), `api_key_scope_insufficient` (the grant is below the scope required), `api_access_not_enabled` (the store owner hasn't turned on API access for you there), `api_key_ip_restriction_required` (the store requires keys limited to a list of IP addresses and this key has none) or `api_key_route_not_exposed`.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "SubscriptionRequired": {
        "description": "Store's subscription tier is below this operation's min_subscription (`subscription_required` error).\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found (or store is deactivated). A path or method no route serves is answered by the gateway itself as `{\"message\":\"Not Found\"}` (`GatewayMessage`); that body has no request id.\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ResponseTooLarge": {
        "description": "The answer is larger than the gateway can return. Narrow the request - the `detail` names what made it wide.\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "Resource conflict",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PreconditionFailed": {
        "description": "ETag mismatch — the resource has been modified since the provided If-Match value. Re-fetch and retry.\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PreconditionRequired": {
        "description": "The request needs a version check and carries none. Resend with the version the resource's read returned (see the operation's description for the header or field).\n",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded. `api_rate_limited`: this key's request budget is spent; wait for `Retry-After`. The gateway's own throttle answers `{\"message\":\"Too Many Requests\"}` with no `Retry-After`.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds to wait before retrying"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                {
                  "$ref": "#/components/schemas/GatewayMessage"
                }
              ]
            }
          }
        }
      },
      "BuylistUpdating": {
        "description": "The store's buylist offer projection is rebuilding, so a rule write could not take its lock in time. Transient — retry after `Retry-After` seconds. The `error` field is `buylist_updating`.\n",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Seconds to wait before retrying"
          },
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected error occurred on the server",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "Validation errors in the request body",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "BadRequest": {
        "description": "The request is syntactically invalid or cannot be parsed",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "CustomDomain": {
        "type": "object",
        "required": [
          "domain_uuid",
          "hostname",
          "surface",
          "status"
        ],
        "properties": {
          "domain_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "hostname": {
            "type": "string",
            "description": "The store-owned custom domain, e.g. `buylist.arjen.app`."
          },
          "surface": {
            "type": "string",
            "enum": [
              "buylist",
              "kiosk"
            ],
            "description": "Which storefront this domain renders."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_dns",
              "pending_validation",
              "active",
              "error",
              "deleting"
            ],
            "description": "Provisioning lifecycle state."
          },
          "ssl_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cloudflare certificate status (e.g. pending_validation, active)."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable validation/issuance error when `status` is `error` (e.g. the DNS records are missing or incorrect); `null` otherwise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "dns_provider": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cloudflare",
              "godaddy",
              "namecheap",
              "other",
              "unknown",
              null
            ],
            "description": "Who hosts the domain's DNS, as stated at registration or detected from its nameservers. `other` is a provider we have no specific steps for; `unknown` means detection failed. `null` on a domain registered before this was recorded, until its next detail read."
          }
        }
      },
      "CustomDomainList": {
        "type": "object",
        "required": [
          "custom_domains"
        ],
        "properties": {
          "custom_domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomDomain"
            }
          }
        }
      },
      "CustomDomainDnsRecord": {
        "type": "object",
        "required": [
          "type",
          "name",
          "host",
          "value",
          "purpose"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "CNAME",
              "TXT"
            ]
          },
          "name": {
            "type": "string",
            "description": "The record's full name, e.g. `_cf-custom-hostname.buy.example.com`."
          },
          "host": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name relative to `zone` (`@` for the zone itself), which is what a provider whose `name_form` is `relative` expects in its Name/Host field. `null` when the zone is not known."
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "purpose": {
            "type": "string",
            "enum": [
              "routing",
              "ownership",
              "ssl"
            ],
            "description": "`routing` sends the domain to the storefront; `ownership` and `ssl` are the verification TXT records the certificate waits on."
          }
        }
      },
      "CustomDomainNotice": {
        "type": "object",
        "required": [
          "code",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Warnings: `proxy_must_be_off`, `enter_relative_name`, `propagation_may_be_slow`, `apex_cname_flattened`, `apex_may_need_alias`, `apex_not_supported` (a bare domain registered before such domains were refused, on a provider that can't hold one). DNS check findings: `cname_missing`, `cname_points_elsewhere`, `likely_proxied`, `txt_missing`, `txt_value_mismatch`, `txt_name_doubled`."
          },
          "detail": {
            "type": "string",
            "description": "User-facing explanation of what to do."
          },
          "record": {
            "type": "string",
            "description": "The record a DNS check finding is about (findings only)."
          }
        }
      },
      "CustomDomainProvisioned": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomDomain"
          },
          {
            "type": "object",
            "properties": {
              "dns_instructions": {
                "type": "object",
                "description": "DNS records the store must add before the certificate is issued.",
                "properties": {
                  "cname_target": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "CNAME target (the Cloudflare for SaaS fallback origin)."
                  },
                  "ownership_verification": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": true
                  },
                  "ssl_validation_records": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "provider": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "name_form",
                      "auto_setup"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "enum": [
                          "cloudflare",
                          "godaddy",
                          "namecheap",
                          "other",
                          "unknown"
                        ]
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name, e.g. `GoDaddy`."
                      },
                      "name_form": {
                        "type": "string",
                        "enum": [
                          "relative",
                          "either",
                          "unknown"
                        ],
                        "description": "How the provider's Name/Host field reads a record name. `relative`: enter each record's `host`, the provider appends the zone. `either`: `host` or the full `name` both work."
                      },
                      "auto_setup": {
                        "type": "boolean",
                        "description": "Whether to offer \"Set up automatically\" (Domain Connect, `createBuylistCustomDomainDnsConnect`). A guess from the detected provider while the domain is pending; the POST makes the real check and may still refuse."
                      }
                    }
                  },
                  "zone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The DNS zone that holds the domain, e.g. `example.com`."
                  },
                  "is_apex": {
                    "type": "boolean",
                    "description": "Whether the domain is the zone itself rather than a subdomain."
                  },
                  "records": {
                    "type": "array",
                    "description": "The same records as the three keys above, one entry each, in both name forms.",
                    "items": {
                      "$ref": "#/components/schemas/CustomDomainDnsRecord"
                    }
                  },
                  "warnings": {
                    "type": "array",
                    "description": "The provider's rules that most often break a correct-looking setup.",
                    "items": {
                      "$ref": "#/components/schemas/CustomDomainNotice"
                    }
                  }
                }
              },
              "dns_check": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "Detail read only, while `status` is `pending_validation` or `error`: what public DNS currently shows wrong with the records, one entry per problem, `[]` when they look right. `null` when DNS couldn't be read. Advisory and never stored; `last_error` stays the certificate provider's verdict.",
                "items": {
                  "$ref": "#/components/schemas/CustomDomainNotice"
                }
              }
            }
          }
        ]
      },
      "StorefrontConfig": {
        "type": "object",
        "required": [
          "store_uuid",
          "hotlist_enabled",
          "sorting_fee_pct",
          "min_buylist_margin_pct",
          "mail_in_enabled",
          "is_published",
          "payment_methods",
          "shipping_countries",
          "auto_cogs_enabled",
          "default_buylist_sort",
          "game_order"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store display name on the storefront. Falls back to Store.name when null."
          },
          "hotlist_enabled": {
            "type": "boolean",
            "description": "Whether the hotlist feature is shown on the public storefront."
          },
          "sorting_fee_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Sorting fee percentage charged to sellers (0–100)."
          },
          "min_buylist_margin_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Thin-margin guard threshold (0–100). After each buylist offer rebuild, a SKU the store both buys and sells whose buy price sits within this percent of its sell price raises a BUYLIST_MARGIN_THIN alert banner. Default 20; 0 disables the guard.\n"
          },
          "buylist_guide_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 500,
            "description": "URL to the store's buylist guide page, shown on the public storefront. Writes are validated as absolute https:// since #1569; a value stored before that check is still read back verbatim. Null when unset.\n"
          },
          "condition_guide_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 500,
            "description": "URL to the store's card condition guide, shown on the public storefront. Same validation and grandfather-read behaviour as buylist_guide_url.\n"
          },
          "scheduling_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 500,
            "description": "Per-store walk-in scheduling link (Calendly/Google Calendar/etc, #1397) shown on the public storefront. Server-side validated as an absolute https:// URL only; cleared by writing null or an empty string via PATCH. Null when unset.\n"
          },
          "payment_methods": {
            "type": "array",
            "description": "Accepted payout methods (e.g. PayPal, store credit).",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "mail_in_enabled": {
            "type": "boolean",
            "description": "Whether mail-in submissions are accepted."
          },
          "shipping_countries": {
            "type": "array",
            "description": "Accepted shipping country codes (e.g. `[\"CA\", \"US\"]`).",
            "items": {
              "type": "string"
            }
          },
          "is_published": {
            "type": "boolean",
            "description": "Whether the storefront is publicly visible."
          },
          "auto_cogs_enabled": {
            "type": "boolean",
            "description": "Auto COGS Mode. When true, adding inventory with no cost entered (manual add/update, bulk update, or a CSV import row with a blank cost column) fills the cost from this store's own current buylist price for that card instead of leaving it uncosted. Filled costs are clearly marked as estimates and can always be corrected via the per-SKU/per-lot COGS endpoints. Default false.\n"
          },
          "default_buylist_sort": {
            "type": "string",
            "enum": [
              "set_alpha",
              "tcg_release",
              "card_alpha",
              "condition_first"
            ],
            "description": "Store-configured default order for displaying buylist lines (confirmation page, offer-status page, printed packing slip). set_alpha is today's fixed order (set name, then card name). Default set_alpha.\n"
          },
          "credit_destination": {
            "type": "string",
            "enum": [
              "none",
              "shopify"
            ],
            "description": "Where a pushed purchase's store credit is sent: `none` (the store handles it by hand) or `shopify` (credited to the customer's Shopify store-credit account). `shopify` needs an active Shopify connection (422 `buylist_credit_destination_not_connected` otherwise).\n"
          },
          "scan_batch_name_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Template for the names of Scan & Identify batches this store starts, using {game}, {date}, {time} and {seq}. Null means the default.\n"
          },
          "scan_batch_name_template_default": {
            "type": "string",
            "readOnly": true,
            "description": "The template used while scan_batch_name_template is null."
          },
          "game_order": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Store-configured display order for the storefront's game switcher/settings reorder list (#1420). Games not present here are shown after, alphabetically. Empty means no custom order -- falls back to alphabetical.\n"
          },
          "holding_container_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Default container a push with `create_holding_bin` creates its `Buylist-<n>` holding bin in (#2258). Must be one of the store's containers (422 `validation_error` otherwise); null clears it. Reads as null once the container has been removed.\n"
          },
          "mail_in_address": {
            "description": "Where mail-in buylists are sent, when it differs from the store's business address (Frontend#2340). Null means the business address (`stores.address_*`) is used.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistMailInAddress"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PatchStorefrontConfigRequest": {
        "type": "object",
        "description": "All fields are optional. Only fields present in the request body are updated; absent fields are left unchanged.\n",
        "properties": {
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "hotlist_enabled": {
            "type": "boolean"
          },
          "sorting_fee_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "min_buylist_margin_pct": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Thin-margin guard threshold (0–100). Default 20; 0 disables."
          },
          "buylist_guide_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Absolute https:// URL, or null/empty string to clear. #1569. Same validation as scheduling_url below.\n"
          },
          "condition_guide_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Absolute https:// URL, or null/empty string to clear. #1569. Same validation as scheduling_url below.\n"
          },
          "scheduling_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Absolute https:// URL, or null/empty string to clear. #1397. Surrounding whitespace is trimmed, so a blank string also clears it; anything else that isn't an https URL with a hostname is rejected 400.\n"
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "mail_in_enabled": {
            "type": "boolean"
          },
          "shipping_countries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_published": {
            "type": "boolean",
            "description": "Setting this true fails with 422 when the store has no delivery option (mail-in disabled and no active drop-off location) or no payment method, since a customer could not submit to such a storefront.\n"
          },
          "auto_cogs_enabled": {
            "type": "boolean"
          },
          "default_buylist_sort": {
            "type": "string",
            "enum": [
              "set_alpha",
              "tcg_release",
              "card_alpha",
              "condition_first"
            ]
          },
          "credit_destination": {
            "type": "string",
            "enum": [
              "none",
              "shopify"
            ],
            "description": "Where a pushed purchase's store credit is sent: `none` (the store handles it by hand) or `shopify` (credited to the customer's Shopify store-credit account). `shopify` needs an active Shopify connection (422 `buylist_credit_destination_not_connected` otherwise). Checked only when the value changes; 503 `shopify_unavailable` when Shopify does not answer the check.\n"
          },
          "scan_batch_name_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Template for Scan & Identify batch names, using {game}, {date}, {time} and {seq}. It needs {seq} and at least 2 fixed characters before the first token (422 `validation_error` otherwise). Null or empty resets to the default.\n"
          },
          "game_order": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Store-configured display order for the storefront's game switcher/settings reorder list (#1420). Games not present here are shown after, alphabetically. Empty means no custom order -- falls back to alphabetical.\n"
          },
          "holding_container_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Default container a push with `create_holding_bin` creates its `Buylist-<n>` holding bin in (#2258). Must be one of the store's containers (422 `validation_error` otherwise); null clears it. Reads as null once the container has been removed.\n"
          },
          "mail_in_address": {
            "description": "Set a mail-in address that differs from the store's business address, or null to go back to the business address. The object replaces the whole address (omitted keys are cleared). `address_line1`, `city`, `region`, `postal_code` and `country` are required when set (422 `validation_error` naming `mail_in_address.<field>`).\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistMailInAddress"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BuylistMailInAddress": {
        "type": "object",
        "required": [
          "address_line1",
          "city",
          "region",
          "postal_code",
          "country"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recipient / attention line. Null addresses it to the store."
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "EmailTemplateVariable": {
        "type": "object",
        "required": [
          "name",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The merge variable's name, referenced in a template as `$NAME` (e.g. `CUSTOMER_FIRST_NAME` for `$CUSTOMER_FIRST_NAME`).\n"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "EmailTemplate": {
        "type": "object",
        "required": [
          "template_key",
          "description",
          "default_subject",
          "default_body",
          "subject_template",
          "body_template",
          "is_customized",
          "enabled",
          "variables"
        ],
        "properties": {
          "template_key": {
            "type": "string",
            "description": "Identifies which platform email this is, e.g. `buylist_offer_accepted`."
          },
          "description": {
            "type": "string",
            "description": "What this email is sent for."
          },
          "default_subject": {
            "type": "string",
            "description": "The platform's default subject, used when subject_template is unset."
          },
          "default_body": {
            "type": "string",
            "description": "The platform's default body copy, used when body_template is unset."
          },
          "subject_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "This store's subject override, or null when it has not customized the subject. May reference this template's $VARIABLE merge variables.\n"
          },
          "body_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "This store's body override, or null when it has not customized the body. May reference this template's $VARIABLE merge variables; paragraphs are separated by a blank line.\n"
          },
          "is_customized": {
            "type": "boolean",
            "description": "Whether either subject_template or body_template is set."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether HippoLink sends this email for the store (#4529). True unless the store turned it off. The store-wide switch in order settings (`customer_emails.enabled`) overrides it: with that off, no customer email is sent whatever this says. Turning `order_ready_for_pickup` off also stops HippoLink marking the order ready on Shopify, which would make Shopify email the buyer.\n"
          },
          "variables": {
            "type": "array",
            "description": "The $VARIABLE merge variables this template may reference.",
            "items": {
              "$ref": "#/components/schemas/EmailTemplateVariable"
            }
          }
        }
      },
      "EmailTemplateListResponse": {
        "type": "object",
        "required": [
          "templates"
        ],
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailTemplate"
            }
          }
        }
      },
      "PatchEmailTemplateRequest": {
        "type": "object",
        "description": "Every field optional. subject_template and body_template are independently nullable: an absent field leaves that half unchanged, null (or an empty string) clears it back to the platform default. A non-null value must reference only this template's registered $VARIABLE merge variables. enabled turns the email on or off.\n",
        "properties": {
          "subject_template": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "body_template": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "enabled": {
            "type": "boolean",
            "description": "Turn this email on or off for the store (#4529). Absent leaves it unchanged. Anything but true or false is a 422 on `enabled`.\n"
          }
        }
      },
      "PickupLocation": {
        "type": "object",
        "required": [
          "pickup_location_uuid",
          "name",
          "address_line1",
          "city",
          "region",
          "postal_code",
          "country",
          "is_active"
        ],
        "properties": {
          "pickup_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Display name for the location (e.g. `Downtown Store`)."
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string",
            "description": "State or province code (e.g. `ON`)."
          },
          "postal_code": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code (e.g. `CA`)."
          },
          "is_active": {
            "type": "boolean",
            "description": "When false the location is hidden from the public storefront checkout."
          }
        }
      },
      "PickupLocationList": {
        "type": "object",
        "required": [
          "pickup_locations"
        ],
        "properties": {
          "pickup_locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PickupLocation"
            }
          }
        }
      },
      "CreatePickupLocationRequest": {
        "type": "object",
        "required": [
          "name",
          "address_line1",
          "city",
          "region",
          "postal_code",
          "country"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "PatchPickupLocationRequest": {
        "type": "object",
        "description": "All fields are optional; only supplied fields are updated.",
        "properties": {
          "name": {
            "type": "string"
          },
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "TcgMessageSummary": {
        "type": "object",
        "required": [
          "total",
          "unread",
          "unread_threads",
          "unread_is_authoritative",
          "unanswered"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total non-trashed threads."
          },
          "unread": {
            "type": "integer",
            "description": "Unread **messages**, as reported by TCGPlayer's own unread-count endpoint at the last poll — the same number the seller portal badges. Falls back to `unread_threads` for a store that has not been polled yet; `unread_is_authoritative` says which you got.\n"
          },
          "unread_threads": {
            "type": "integer",
            "description": "Threads holding at least one unread message. This is what the thread list returns for `?unread=true`, and it counts threads, not messages, so it is normally lower than `unread`.\n"
          },
          "unread_is_authoritative": {
            "type": "boolean",
            "description": "True when `unread` is TCGPlayer's count; false when it is standing in as `unread_threads` because the store has never been polled.\n"
          },
          "unread_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When TCGPlayer's unread count was last successfully read. Tracks the fetch, not the poll -- a poll whose count fetch failed advances neither this nor `unread`, so a badge that stops moving here is frozen rather than fresh.\n"
          },
          "unanswered": {
            "type": "integer",
            "description": "Threads where a customer is waiting on the seller: the seller has not replied, the thread was opened in the last 30 days, and it is attached to an order. The recency and order-scoped qualifiers are what make this a to-do list rather than an archive count — buyer messaging on TCGPlayer is order-scoped, so a thread with no `order_type` is a TCGPlayer broadcast nobody replies to. Same predicate as the thread list's `?unanswered=true`. Note this is narrower than a thread's own `is_unanswered`, which stays true for an archived thread the seller never replied to.\n"
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "line1",
          "city",
          "state",
          "country",
          "zip_code"
        ],
        "properties": {
          "line1": {
            "type": "string",
            "description": "Street address line 1"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ],
            "description": "Street address line 2 (apt, suite, etc.), null when the address has none"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "zip_code": {
            "type": "string"
          }
        }
      },
      "AlterPurchaseRequest": {
        "type": "object",
        "description": "Presence decides, not value: a field the body omits keeps its current value, and a field sent as null is cleared. That is how an operator corrects a phone number entered against the wrong customer, or withdraws a note.",
        "properties": {
          "customer_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Customer name to attach to the purchase. Omit to leave unchanged."
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320,
            "description": "Customer email to attach to the purchase. Omit to leave unchanged."
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipping_address": {
            "type": [
              "object",
              "null"
            ],
            "description": "Partial address allowed; each field optional. A null field clears that line; a null address clears the whole thing.",
            "properties": {
              "line1": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "line2": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "fulfillment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"mail_in\" or \"dropoff_<pickup_location_uuid>\". Null clears it, which routes the offer back to a counter sale — the way to record that a customer who was going to post the cards brought them in instead. Changing the intake kind either way is refused once the offer is past draft, since the seller has already been told how to send the cards."
          },
          "pos_customer_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The customer's id in the POS the store credit goes to (a Shopify customer GID picked from searchBuylistShopifyCustomers). Null clears it and the credit finds the customer by email or phone."
          },
          "payout_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment-method id from the store's buylist config."
          },
          "payout_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cash",
              "credit",
              null
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "description": "The authoritative line set for the draft purchase. Lines present are kept and field-updated; lines omitted are deleted; an empty array clears all lines. Omit the field entirely to leave lines unchanged.",
            "items": {
              "type": "object",
              "required": [
                "line_item_uuid"
              ],
              "properties": {
                "line_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "agreed_cash": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total)."
                },
                "agreed_credit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total)."
                },
                "accepted_quantity": {
                  "type": "integer",
                  "minimum": 0
                },
                "condition": {
                  "type": "string"
                },
                "destination_location_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                }
              }
            }
          }
        }
      },
      "AsyncJob": {
        "type": "object",
        "description": "Base schema for all async job resources.",
        "required": [
          "job_uuid",
          "status",
          "type",
          "created_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/JobType"
              }
            ],
            "description": "Discriminator field indicating the job type"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AuditEvent": {
        "type": "object",
        "required": [
          "event_uuid",
          "type",
          "service",
          "user",
          "user_display_name",
          "via",
          "timestamp",
          "status_code",
          "detail"
        ],
        "properties": {
          "event_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "description": "Event type (e.g. rule_update, reprice_execute, inventory_import, store_update, inventory_update, order_created, order_status_changed, shipment_created)\n"
          },
          "service": {
            "type": "string",
            "description": "Service that produced the event"
          },
          "user": {
            "type": "string",
            "description": "Email of the actor the action ran as. Under admin impersonation this is the impersonated user; see `author` for the real human.\n"
          },
          "user_display_name": {
            "type": "string",
            "description": "Display name of the actor the action ran as (\"First Last\"), resolved at read time from the user record. Falls back to the email in `user` when the name is blank or the user record is not found.\n"
          },
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email of the real human who performed the action. The same as `user` for normal requests; the impersonating admin when the action ran under administrator impersonation. Null only for system/internal events with no identifiable user.\n"
          },
          "author_display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name of the real human who performed the action (\"First Last\"), resolved at read time. Falls back to the email in `author` when the name is blank. Null whenever `author` is null.\n"
          },
          "via": {
            "type": "string",
            "enum": [
              "web",
              "api"
            ],
            "description": "How the request reached HippoLink: `api` when it came through a public API key, `web` otherwise. Work a request started (an import, a reprice run) is recorded later without the key, so its rows read `web`.\n"
          },
          "api_key_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current name of the API key the request came through, resolved at read time, so a renamed key shows its new name. Null when `via` is `web`, and when the key has since been deleted.\n"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "status_code": {
            "type": "integer",
            "description": "HTTP status code of the response (e.g. 200, 201, 403, 422)"
          },
          "detail": {
            "type": "object",
            "description": "Event-specific payload"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "SKU this event relates to, when the route's path included one. Null otherwise.\n"
          }
        }
      },
      "BulkReserveInventoryRequest": {
        "type": "object",
        "required": [
          "reserved_for_store"
        ],
        "description": "Provide exactly one of `tcgplayer_sku_ids` or `filters` (both, or neither, is a 422; the cross-field rule is validated server-side).\n",
        "properties": {
          "reserved_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "New reserve quantity for every resolved SKU. `null` or `0` clears the reserve (matching the per-SKU PATCH endpoint's own `reserved_for_store` semantics).\n"
          },
          "tcgplayer_sku_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Explicit SKUs to reserve. Mutually exclusive with `filters`."
          },
          "filters": {
            "$ref": "#/components/schemas/BulkSelectionFilters",
            "description": "Inventory listing-filter criteria resolved server-side, the same vocabulary and semantics as `moveCardsToLocation`'s `filters` (see that schema for the full per-key grammar) — no `color` or `language` key. Capped at 500 resolved SKUs; a larger match, an unrecognized key, or a match of zero in-stock SKUs is rejected with 422. Mutually exclusive with `tcgplayer_sku_ids`.\n"
          }
        },
        "oneOf": [
          {
            "required": [
              "tcgplayer_sku_ids"
            ]
          },
          {
            "required": [
              "filters"
            ]
          }
        ]
      },
      "BulkReserveInventoryResult": {
        "type": "object",
        "required": [
          "inventory",
          "requested_sku_count"
        ],
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`). The listings catch up on the next push sweep, within about 30 minutes. Absent on a clean write and on reads.\n"
          },
          "inventory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventorySummary"
            },
            "description": "Updated summaries for every resolved SKU, same shape as PATCH /inventory's bulk response."
          },
          "requested_sku_count": {
            "type": "integer",
            "format": "int64",
            "description": "Count of SKUs resolved (explicit or via filters) and written."
          }
        }
      },
      "ImportLastSoldDatesRequest": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "last_sold_at"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 1
                },
                "last_sold_at": {
                  "type": "string",
                  "description": "ISO 8601 date (YYYY-MM-DD, read as 00:00 UTC) or date-time."
                }
              }
            }
          }
        }
      },
      "ImportLastSoldDatesResponse": {
        "type": "object",
        "required": [
          "inserted",
          "updated",
          "ignored_older",
          "unknown"
        ],
        "properties": {
          "inserted": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "ignored_older": {
            "type": "integer",
            "description": "Rows whose date was not later than the one already stored."
          },
          "unknown": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "SKU ids the catalog does not know; not written."
          }
        }
      },
      "BulkDeleteInventoryRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "description": "At least one of tcgplayer_sku_ids, tcgplayer_product_ids, or a non-empty filters object must be supplied. Supplying product ids deletes every in-store SKU of those products. The cross-field \"at least one\" rule is enforced by the handler (422); JSON Schema cannot express it. `reason` is required and applies to the whole batch.\n",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/RemovalReason"
          },
          "note": {
            "type": "string",
            "description": "Optional operator note stored on every ledger movement in the batch."
          },
          "tcgplayer_sku_ids": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "SKU ids to delete. No maximum batch size; the delete is a single set-based statement."
          },
          "tcgplayer_product_ids": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Product ids to delete. Every in-store SKU of each product is removed. No maximum batch size; the delete is a single set-based statement."
          },
          "filters": {
            "$ref": "#/components/schemas/InventoryFilter",
            "description": "Resolves to the exact matching in-stock SKU ids (via the same resolver every other bulk engine reuses) and deletes at that precise grain — a `condition`/`finish`/`language` filter never over-deletes a matching product's other variants (#1187). Merged with any explicit `tcgplayer_sku_ids`. Capped at 500 resolved SKUs; a larger match is rejected with 422 asking to narrow the filter. Rejected with 422 rather than deleted when it carries an unrecognized key, when it constrains nothing (so it would mean \"the whole store\"), or when it matches no in-stock SKU.\n"
          }
        }
      },
      "BulkDeleteInventoryResult": {
        "type": "object",
        "required": [
          "deleted",
          "not_found"
        ],
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`). The listings catch up on the next push sweep, within about 30 minutes. Absent on a clean write and on reads.\n"
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "SKU ids that existed and were removed."
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Requested SKU ids that had no stock in the store."
          },
          "deleted_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Present only when tcgplayer_product_ids was supplied. Requested product ids that had in-store stock."
          },
          "not_found_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Present only when tcgplayer_product_ids was supplied. Requested product ids that had no stock in the store."
          }
        }
      },
      "EbayInclusionDecision": {
        "type": "string",
        "enum": [
          "include",
          "exclude"
        ],
        "description": "Whether a SKU is opted in (include) or opted out (exclude) of eBay listing."
      },
      "EbayInclusionSource": {
        "type": "string",
        "enum": [
          "selected",
          "forced"
        ],
        "description": "selected rows are the eBay selection reconcile's own, picked from the store's cap-ranked candidates (sell-on-ebay-tagged cards and cards meeting its price rule). forced is reserved for a later override tag that bypasses the cap entirely; nothing produces it yet.\n"
      },
      "BulkSelectionFilters": {
        "type": "object",
        "description": "Inventory listing-filter criteria resolved server-side -- the shared vocabulary bulkReserveInventory and the eBay inclusion endpoints both accept, no color or language key. Capped at 500 resolved SKUs; a larger match, an unrecognized key, or a match of zero SKUs is rejected with 422 (see the calling operation for the exact in-stock-vs-sold-out semantics of \"zero matches\").\n",
        "properties": {
          "search": {
            "type": "string"
          },
          "condition": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardConditionInput"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "rarity": {
            "type": "string"
          },
          "set_name": {
            "type": "string"
          },
          "product_number": {
            "type": "string"
          },
          "price_min": {
            "type": "number",
            "format": "double"
          },
          "price_max": {
            "type": "number",
            "format": "double"
          },
          "quantity_min": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_max": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_visible_min": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_visible_max": {
            "type": "integer",
            "minimum": 0
          },
          "cogs_min": {
            "type": "number",
            "format": "double",
            "minimum": 0
          },
          "cogs_max": {
            "type": "number",
            "format": "double",
            "minimum": 0
          },
          "first_inventoried_after": {
            "type": "string",
            "format": "date-time"
          },
          "first_inventoried_before": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_after": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_before": {
            "type": "string",
            "format": "date-time"
          },
          "last_copy_sold_after": {
            "type": "string",
            "format": "date-time"
          },
          "last_copy_sold_before": {
            "type": "string",
            "format": "date-time"
          },
          "never_sold": {
            "type": "boolean"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "EbayInclusionItem": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "product_name",
          "set_name",
          "condition",
          "finish",
          "price_cents",
          "quantity",
          "decision",
          "source",
          "below_minimum",
          "live_on_ebay",
          "updated_at"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Effective eBay price in cents (override beats base), or null if unpriced."
          },
          "quantity": {
            "type": "integer",
            "description": "The store's visible quantity for this SKU."
          },
          "decision": {
            "description": "Null on a state=ready row (no decision yet).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EbayInclusionDecision"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "description": "Null on a state=ready row (no decision yet).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EbayInclusionSource"
              },
              {
                "type": "null"
              }
            ]
          },
          "below_minimum": {
            "type": "boolean",
            "description": "True when price_cents is null or under eBay's fixed-price minimum."
          },
          "live_on_ebay": {
            "type": "boolean",
            "description": "True when the last push eBay acknowledged for this SKU holds a quantity above zero -- the card is on eBay now, not only set to list.\n"
          },
          "ebay_listing_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "eBay's public listing id (the {id} in ebay.com/itm/{id}) while the card is live, from what the push recorded when it published or adopted the offer (#2759). Null when not live or not recorded yet.\n"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Catalog product image for the card, or null when the catalog has none."
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The card's product id, for the inventory card page (`/dashboard/inventory/{id}`). Null when the SKU is not in the catalog."
          },
          "tagged": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when the SKU currently carries the sell-on-ebay tag (at product or SKU grain, the same set the selection reconcile reads), false when it does not. On a state=ready row false means the price rule alone selects it; on an included/excluded row false means the card is listed by the price rule (or the tag has since been removed).\n"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the decision was last written. Null on a state=ready row."
          }
        }
      },
      "EbayInclusionListResult": {
        "type": "object",
        "required": [
          "items",
          "total",
          "total_capped",
          "limit",
          "offset",
          "cap",
          "included_total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EbayInclusionItem"
            }
          },
          "total": {
            "type": "integer",
            "description": "Rows matching the query. For state=ready, at most 10000 (see total_capped)."
          },
          "total_capped": {
            "type": "boolean",
            "description": "True when a state=ready count reached its 10,000 cap, so total is a floor rather than the exact count. Always false for decided rows.\n"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The store's eBay listing cap; null means no cap. Not narrowed by the query's filters. With included_total it gives the room left: waiting_beyond_cap = max(ready_total - max(cap - included_total, 0), 0), where ready_total is the total of a state=ready listing. That total is not limited by the cap (only by its own 10,000 count cap).\n"
          },
          "included_total": {
            "type": "integer",
            "description": "Every decision=include row the store holds (all sources), whatever the query's state or filters. These are what occupy the cap.\n"
          }
        }
      },
      "EbayTagPreviewResult": {
        "type": "object",
        "required": [
          "selected_products",
          "selected_skus",
          "would_list",
          "already_listed",
          "already_tagged",
          "over_cap",
          "below_minimum",
          "ineligible",
          "capped"
        ],
        "properties": {
          "selected_products": {
            "type": "integer",
            "description": "Distinct products named in the request."
          },
          "selected_skus": {
            "type": [
              "integer",
              "null"
            ],
            "description": "SKUs the selection covers (a floor when capped). Null when the scan was cut before they were resolved.\n"
          },
          "would_list": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Not yet listed cards the next reconcile would list, within the cap's free slots."
          },
          "already_listed": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Selected SKUs that already have a decision=include row. For do-not-sell-on-ebay these are the cards the next reconcile would take down.\n"
          },
          "already_tagged": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Selected SKUs already carrying the slug, at product or SKU grain. Overlaps the others."
          },
          "over_cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Qualifying cards the cap leaves out right now (0 with no cap)."
          },
          "below_minimum": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Not yet listed cards whose effective eBay price is missing or under $0.99."
          },
          "ineligible": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Not yet listed cards that cannot list for another reason: out of stock, suppressed, outside eBay's scope, or already excluded.\n"
          },
          "capped": {
            "type": "boolean",
            "description": "True when the scan was cut by the statement timeout (every count but selected_products is then null) or the selection exceeded 10,000 SKUs (counts cover the first 10,000).\n"
          }
        }
      },
      "BuylistDslVariables": {
        "type": "object",
        "required": [
          "price_variables",
          "price_variable_kinds",
          "price_functions",
          "arithmetic_operators",
          "date_variables",
          "attribute_names",
          "attribute_operators",
          "comparison_operators",
          "logical_operators",
          "rounding_directions",
          "rounding_increments",
          "language_map",
          "condition_values",
          "finish_values",
          "rarity_values",
          "product_type_values",
          "buylist_keywords"
        ],
        "properties": {
          "price_variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslPriceVarName"
            }
          },
          "price_variable_kinds": {
            "type": "object",
            "description": "Maps every DslPriceVarName value to its unit kind, so the rule builder can group variables and understand which comparisons are meaningful.\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/DslVariableKind"
            }
          },
          "price_functions": {
            "type": "array",
            "description": "Price functions the rule-builder can wrap operands in. FIRST_DEFINED is a first-non-null fallback; LOWEST/HIGHEST/MEDIAN/AVERAGE are \"best of N\" aggregates over 2+ operands. An operand may be one more function -- nesting is capped at a single level (#2263).\n",
            "items": {
              "type": "string"
            },
            "example": [
              "FIRST_DEFINED",
              "LOWEST",
              "HIGHEST",
              "MEDIAN",
              "AVERAGE"
            ]
          },
          "arithmetic_operators": {
            "type": "array",
            "description": "Infix arithmetic operators usable anywhere a price value appears -- both sides of a comparison, an action's price source, and a function's operands. Standard precedence (\"*\" and \"/\" bind tighter than \"+\" and \"-\"), left-associative, parentheses to override. A leading \"-\" negates. Division by a variable that evaluates to zero yields no value for that SKU rather than an error; division by a literal zero is rejected.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "+",
              "-",
              "*",
              "/"
            ]
          },
          "date_variables": {
            "type": "array",
            "description": "Date variables a buylist rule can compare. Omits OLDEST_COPY_INSERTION_DATE and LAST_PRICE_CHANGE_DATE (both present in DslDateVarName): each is a fact about stock the store already holds, and a quote runs over whatever card a customer brings in, so both would resolve to the same fallback for nearly the whole catalog. Rejected at validate/save time too. Every other DslDateVarName value is returned.\n",
            "items": {
              "$ref": "#/components/schemas/DslDateVarName"
            }
          },
          "attribute_names": {
            "type": "array",
            "description": "Attributes a buylist rule can match on. Omits MARKETPLACE (present in DslAttributeName) because buylist rules compile in projection mode, which rejects it, and omits CONDITION because grade selection belongs on a BUY action's CONDITIONS table instead -- see DslBuyAction.conditions. A rule stored before this changed may still carry CONDITION in its IF and keeps working; only a new or re-authored rule is rejected for using it there. Every other DslAttributeName value is returned.\n",
            "items": {
              "$ref": "#/components/schemas/DslAttributeName"
            }
          },
          "attribute_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslAttributeOperator"
            }
          },
          "comparison_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslComparisonOperator"
            }
          },
          "logical_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslLogicalOperator"
            }
          },
          "rounding_directions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslRoundingDirection"
            }
          },
          "rounding_increments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslRoundingIncrement"
            }
          },
          "language_map": {
            "type": "object",
            "description": "Mapping of each supported language to its display label. Keys are the canonical language names stored on `global_identifiers.language` — the value a rule's LANGUAGE condition is matched against verbatim — so the client both stores and displays the key.\n",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "English": "English",
              "Chinese (S)": "Chinese (S)",
              "Japanese": "Japanese",
              "German": "German",
              "French": "French",
              "Spanish": "Spanish"
            }
          },
          "condition_values": {
            "type": "array",
            "description": "Valid card grades for a buylist rule, in the `region` query parameter's vocabulary: the stored US 6 for `usa`, the 7 Cardmarket/MKM grades plus `Unopened` for `eu`. An EU label is translated to its stored US condition when the rule is saved (#1152); the stored vocabulary is always the US 6 (#1150/#1151). This is now the vocabulary a BUY action's CONDITIONS grade table binds against (DslBuyAction.conditions), not the CONDITION attribute -- unaffected by CONDITION's removal from attribute_names above.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "Near Mint",
              "Lightly Played",
              "Moderately Played",
              "Heavily Played",
              "Damaged"
            ]
          },
          "finish_values": {
            "type": "array",
            "description": "Valid values for the FINISH attribute in buylist rules",
            "items": {
              "type": "string"
            },
            "example": [
              "FOIL",
              "NON_FOIL",
              "ETCHED"
            ]
          },
          "rarity_values": {
            "type": "array",
            "description": "Valid values for the RARITY attribute in buylist rules",
            "items": {
              "type": "string"
            },
            "example": [
              "COMMON",
              "UNCOMMON",
              "RARE",
              "MYTHIC"
            ]
          },
          "product_type_values": {
            "type": "array",
            "description": "Valid values for the PRODUCT_TYPE attribute in buylist rules",
            "items": {
              "type": "string"
            },
            "example": [
              "card",
              "token",
              "sealed"
            ]
          },
          "border_color_values": {
            "type": "array",
            "description": "Valid values for the BORDER_COLOR attribute in buylist rules (Magic only). Sourced from MTGJSON's `other_attributes.border_color`.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "black",
              "borderless",
              "gold",
              "silver",
              "white"
            ]
          },
          "frame_effect_values": {
            "type": "array",
            "description": "Discovery values for the FRAME_EFFECT attribute's `CONTAINS` operator (Magic only) -- a curated subset of MTGJSON's `other_attributes.frame_effects` worth offering in a dropdown, not a closed vocabulary.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "showcase",
              "extendedart",
              "shatteredglass"
            ]
          },
          "buylist_keywords": {
            "type": "array",
            "description": "Buylist-specific action keywords recognized by the DSL parser. BUY/DECLINE are the decision outcomes; CASH/CREDIT are the offer type selectors; MAX_STOCK caps how many copies a BUY rule will take against on-hand stock (#1170); CONDITIONS is the per-grade percentage table (#1802/#1804).\n",
            "items": {
              "type": "string",
              "enum": [
                "BUY",
                "DECLINE",
                "CASH",
                "CREDIT",
                "MAX_STOCK",
                "CONDITIONS"
              ]
            },
            "example": [
              "BUY",
              "DECLINE",
              "CASH",
              "CREDIT",
              "MAX_STOCK",
              "CONDITIONS"
            ]
          }
        }
      },
      "BuylistImportCreatedResponse": {
        "type": "object",
        "required": [
          "job_uuid",
          "upload_url"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "description": "Presigned S3 PUT URL for the CSV. Expires per S3_PRESIGN_EXPIRY_SECONDS Lambda env var."
          }
        }
      },
      "BuylistImportBatchCreatedResponse": {
        "type": "object",
        "required": [
          "purchase_uuid"
        ],
        "properties": {
          "purchase_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The empty draft purchase this batch's import jobs should target."
          }
        }
      },
      "BuylistImportRequest": {
        "type": "object",
        "description": "Initiate a buylist CSV import. Returns a presigned S3 PUT URL for the client to upload the CSV file. After upload, call the start endpoint.\n",
        "properties": {
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "If provided, the server POSTs a job status update to this URL when the import completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
          },
          "purchase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Target an existing draft purchase (from createBuylistImportBatch) instead of minting a new one -- used for a multi-file import batch. Must belong to the same store and be status=draft.\n"
          }
        }
      },
      "BuylistUrlImportRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "description": "Initiate a buylist import from a pasted link: an Archidekt or Scryfall deck, a Moxfield deck or binder, or a TCGplayer Collection Tracker collection (#3620). A collection's cards resolve by TCGplayer product id and printing, at Near Mint / English, since a collection records neither.\n",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public Archidekt, Scryfall or Moxfield deck/binder URL, or TCGplayer collection URL."
          },
          "callback_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "If provided, the server POSTs a job status update to this URL when the import completes or fails. It must be an `https://` URL on the default port (443) that names a host, not an IP address, with no `user:pass@`, and every address that host resolves to must be public; anything else is refused with 422 `callback_url_not_allowed`. The host is looked up again before each POST, and redirects are not followed.\n"
          },
          "purchase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Add the deck's cards to this existing draft purchase instead of minting a new one. Same rules as BuylistImportRequest.purchase_uuid: same store, status=draft, otherwise 422.\n"
          }
        }
      },
      "BuylistImportSection": {
        "type": "object",
        "required": [
          "name",
          "count"
        ],
        "description": "A selectable section of the deck (e.g. mainboard, sideboard).",
        "properties": {
          "name": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "Number of importable cards in this section."
          },
          "cards": {
            "type": "array",
            "description": "Per-card names and quantities within the section; quantities sum to `count` (an entry the provider left unnamed is labeled \"Unnamed card\" rather than dropped).\n",
            "items": {
              "$ref": "#/components/schemas/BuylistDeckCard"
            }
          }
        }
      },
      "BuylistUrlImportPreview": {
        "type": "object",
        "required": [
          "job_uuid",
          "provider",
          "deck_name",
          "sections"
        ],
        "description": "The created job plus a preview of the deck's sections so the client can choose which to import. Pass the chosen section names to the start endpoint; omitting them imports every section.\n",
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "type": "string",
            "enum": [
              "archidekt",
              "scryfall",
              "moxfield",
              "moxfield-binder",
              "tcgplayer-collection"
            ]
          },
          "deck_name": {
            "type": "string"
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuylistImportSection"
            }
          }
        }
      },
      "BuylistDeckCard": {
        "type": "object",
        "required": [
          "name",
          "quantity"
        ],
        "description": "One card within a deck/binder URL preview section. A TCGplayer collection (#3620) also names each card's printing by id, and lists a foil and a non-foil copy as two cards; other providers carry the name and quantity only.\n",
        "properties": {
          "name": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGplayer collection only. Look it up with `lookupPublicBuylistProducts`."
          },
          "finish": {
            "type": "string",
            "description": "TCGplayer collection only. The printing, in the catalog's finish vocabulary (`normal`, `foil`, ...)."
          },
          "game": {
            "type": [
              "string",
              "null"
            ],
            "description": "TCGplayer collection only. The game key, or null for a TCGplayer category HippoLink does not carry."
          },
          "set_name": {
            "type": "string",
            "description": "TCGplayer collection only."
          }
        }
      },
      "BuylistImportPreviewRequested": {
        "type": "object",
        "required": [
          "job_uuid",
          "status"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending"
            ]
          }
        }
      },
      "BuylistImportPreview": {
        "type": "object",
        "description": "A buylist import's per-row preview. `rows` and `region` are present when `status` is `ready`; `error_code` and `error` when it is `failed`.\n",
        "required": [
          "job_uuid",
          "status"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "failed"
            ]
          },
          "region": {
            "type": "string",
            "description": "The store's region. Each row's `condition` is in this region's vocabulary, the one `GET /v1/buylist/dsl?region=` lists as `condition_values`.\n"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuylistImportPreviewRow"
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BuylistImportPreviewRow": {
        "type": "object",
        "required": [
          "row_number",
          "quantity"
        ],
        "properties": {
          "row_number": {
            "type": "integer",
            "minimum": 1,
            "description": "The row's key in `condition_overrides` on `startBuylistImport`."
          },
          "section": {
            "type": [
              "string",
              "null"
            ],
            "description": "The deck section the row came from (a deck link's section name); null for a file."
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "source_condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "The condition as the file or link gave it (Near Mint for a deck link)."
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "The condition the row imports at, in the store's region vocabulary; null when `source_condition` is not one the region recognises.\n"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the row would not import as it stands: `invalid_condition` (fixable with an override), `unsupported_product`, `ambiguous_printing` or `invalid_quantity`.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BuylistImportStartRequest": {
        "type": "object",
        "description": "Optional body for the start endpoint. For URL imports, ``sections`` limits the import to the chosen deck sections; omitting it imports every section. ``sections`` is ignored for uploaded-file (CSV) jobs. ``condition_overrides`` sets the condition of chosen rows, keyed by the row's ``row_number`` as the import preview reports it, so it needs a ``ready`` preview (409 ``import_preview_not_ready`` otherwise). The row is priced as the same printing in that condition; a condition the store's region does not recognise is an ``invalid_condition`` row error, and a printing with no SKU in it a ``condition_variant_not_found`` one.\n",
        "properties": {
          "sections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "condition_overrides": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "3": "Lightly Played"
            }
          }
        }
      },
      "ScanBatch": {
        "type": "object",
        "required": [
          "tcgplayer_batch_id",
          "name",
          "created_at",
          "item_count",
          "unidentified_count"
        ],
        "properties": {
          "tcgplayer_batch_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_batch_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "product_line": {
            "type": [
              "string",
              "null"
            ]
          },
          "item_count": {
            "type": "integer"
          },
          "unidentified_count": {
            "type": "integer"
          },
          "total_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "review": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "review_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "enum": [
                  "importing",
                  "ready",
                  "committed",
                  "discarded"
                ]
              }
            }
          }
        }
      },
      "ScanBatchList": {
        "type": "object",
        "required": [
          "batches",
          "scan_truncated",
          "template"
        ],
        "properties": {
          "batches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanBatch"
            }
          },
          "scan_truncated": {
            "type": "boolean",
            "description": "True when the TCGplayer page bound stopped the walk before the window filled."
          },
          "template": {
            "type": "string"
          }
        }
      },
      "ScanDevice": {
        "type": "object",
        "required": [
          "device_id",
          "startable"
        ],
        "properties": {
          "device_id": {
            "type": "string",
            "format": "uuid"
          },
          "nickname": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "startable": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "disconnected",
              "setup_incomplete",
              "maintenance_needed",
              "has_errors",
              "out_of_cards",
              "busy",
              null
            ]
          },
          "last_job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_job_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_batch_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "errors": {
            "type": "array",
            "description": "Every fault the Sifter reports, including the benign hopper-empty one; `reason` says which of them block a start.",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "properties": {
                "code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "message": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ScanDeviceList": {
        "type": "object",
        "required": [
          "devices"
        ],
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanDevice"
            }
          }
        }
      },
      "ScanSettings": {
        "type": "object",
        "required": [
          "games",
          "conditions",
          "languages"
        ],
        "properties": {
          "games": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "game",
                "label",
                "abbreviation",
                "foil_finishes"
              ],
              "properties": {
                "game": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "abbreviation": {
                  "type": "string"
                },
                "foil_finishes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "The printing given to copies the Sifter detects as foil; non-foil copies always come back Normal."
                }
              }
            }
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ScanStartRequest": {
        "type": "object",
        "required": [
          "device_id",
          "game",
          "condition",
          "foil_finish",
          "language",
          "include_bins"
        ],
        "properties": {
          "device_id": {
            "type": "string",
            "format": "uuid"
          },
          "game": {
            "type": "string"
          },
          "condition": {
            "type": "string"
          },
          "foil_finish": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "include_bins": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^Bin\\d+$"
            }
          },
          "name_suffix": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "customer_phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          }
        }
      },
      "ScanStartResult": {
        "type": "object",
        "required": [
          "batch_name",
          "tcgplayer_batch_id",
          "tcgplayer_job_id"
        ],
        "properties": {
          "batch_name": {
            "type": "string"
          },
          "tcgplayer_batch_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_batch_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tcgplayer_job_id": {
            "type": "string"
          }
        }
      },
      "ScanStopResult": {
        "type": "object",
        "properties": {
          "tcgplayer_job_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ScanImportResult": {
        "type": "object",
        "required": [
          "review_uuid",
          "job_uuid"
        ],
        "properties": {
          "review_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ScanReview": {
        "type": "object",
        "required": [
          "review_uuid",
          "status",
          "version",
          "tcgplayer_batch_id",
          "batch_name",
          "created_at"
        ],
        "properties": {
          "review_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "importing",
              "ready",
              "committed",
              "discarded"
            ]
          },
          "version": {
            "type": "integer"
          },
          "tcgplayer_batch_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_batch_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "batch_name": {
            "type": "string"
          },
          "product_line": {
            "type": [
              "string",
              "null"
            ]
          },
          "batch_item_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "unidentified_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "import_job_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "purchase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "committed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "batch_deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "counts": {
            "type": "object",
            "properties": {
              "lines": {
                "type": "integer"
              },
              "copies": {
                "type": "integer"
              },
              "buyable_lines": {
                "type": "integer"
              },
              "unresolved": {
                "type": "integer"
              },
              "corrected": {
                "type": "integer"
              },
              "excluded": {
                "type": "integer"
              },
              "missing_from_batch": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ScanReviewList": {
        "type": "object",
        "required": [
          "reviews",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "reviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanReview"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "ScanReviewLine": {
        "type": "object",
        "required": [
          "line_uuid",
          "quantity",
          "excluded",
          "corrected",
          "missing_from_batch",
          "has_image"
        ],
        "properties": {
          "line_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "import_sequence": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bin": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_image": {
            "type": "boolean"
          },
          "tcgplayer_item_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "suggested_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "suggested_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "scanned_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "scanned_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_set": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_printing": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_language": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "scanned_quantity": {
            "type": "integer"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The catalog name of the card the line currently names."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The collector number."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The catalog image of the line's current SKU; null when the line has no SKU or the catalog has no image. Distinct from the scanned photo behind has_image."
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "excluded": {
            "type": "boolean"
          },
          "corrected": {
            "type": "boolean"
          },
          "missing_from_batch": {
            "type": "boolean"
          },
          "resolve_error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "unknown_sku",
              "unsupported_product",
              "unidentified",
              null
            ]
          }
        }
      },
      "ScanReviewLineList": {
        "type": "object",
        "required": [
          "lines",
          "limit",
          "offset"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanReviewLine"
            }
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "ScanReviewCustomerUpdateRequest": {
        "type": "object",
        "minProperties": 1,
        "description": "Send only the fields to change; null clears one.",
        "properties": {
          "customer_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "customer_phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          }
        }
      },
      "ScanReviewLineEditRequest": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "type": "object",
              "required": [
                "line_uuid"
              ],
              "properties": {
                "line_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "tcgplayer_sku_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64"
                },
                "condition": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "finish": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "language": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                },
                "excluded": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ScanReviewBulkRequest": {
        "type": "object",
        "properties": {
          "bin": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "excluded": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "accept_suggestions": {
            "type": "boolean"
          }
        }
      },
      "ScanReviewBulkResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanReview"
          },
          {
            "type": "object",
            "properties": {
              "unchanged": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "line_uuid": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "no_variant",
                        "no_card"
                      ]
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ScanReviewCommitRequest": {
        "type": "object",
        "properties": {
          "purchase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "ScanReviewCommitResult": {
        "type": "object",
        "required": [
          "purchase_uuid",
          "review"
        ],
        "properties": {
          "purchase_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "review": {
            "$ref": "#/components/schemas/ScanReview"
          }
        }
      },
      "BuylistImportStatus": {
        "type": "object",
        "required": [
          "job_uuid",
          "status"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_upload",
              "pending",
              "running",
              "completed",
              "failed"
            ]
          },
          "rows_total": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rows_processed": {
            "type": [
              "integer",
              "null"
            ]
          },
          "unsupported_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "purchase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set after a successful import. Null until status == completed."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "row": {
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "error_code": {
                  "type": "string",
                  "description": "Row-level codes (row >= 1) are unsupported_product, ambiguous_printing, invalid_condition and invalid_quantity. A failed job carries one row-0 entry naming why: unsupported_marketplace (format not recognized), parse_failed (format recognized, file does not parse), all_rows_unresolved (no row resolved to a card), purchase_not_draft (the target offer left draft while the import ran), or offer_line_limit (the offer would pass 5,000 distinct cards once this import merged in; nothing was added)."
                }
              }
            }
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Job type; for buylist imports this is \"buylist_import\"."
          },
          "location_strategy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Inventory-import field; null for buylist imports."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "imported": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created": {
            "type": [
              "integer",
              "null"
            ]
          },
          "updated": {
            "type": [
              "integer",
              "null"
            ]
          },
          "skipped": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "BuylistLineItem": {
        "type": "object",
        "required": [
          "line_item_uuid",
          "purchase_uuid",
          "line_index",
          "tcgplayer_sku_id",
          "condition",
          "quantity",
          "accepted_quantity",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "line_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "purchase_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "line_index": {
            "type": "integer"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "condition": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "quoted_cash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card (not the line total); null if not set"
          },
          "quoted_credit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card (not the line total); null if not set"
          },
          "agreed_cash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card (not the line total); null if not set"
          },
          "agreed_credit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card (not the line total); null if not set"
          },
          "accepted_quantity": {
            "type": "integer",
            "description": "Copies the store accepts. 0 until the offer is accepted, where it means the full declared quantity; 0 afterwards means the line was rejected."
          },
          "destination_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "unit_cogs": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, cost basis of one card; null if line was rejected"
          },
          "edited": {
            "type": "boolean",
            "description": "True when the store altered this line (price/quantity/condition/destination) from what the seller submitted."
          },
          "rules_overridden": {
            "type": "boolean",
            "description": "True when a manager/owner bought this card although the store's ruleset declined it."
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The SKU's parent product, so a client can load the card's other printings and grades without a name search. Null if the SKU is not yet in the catalog.\n"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card name from catalog; null if SKU is not yet in the catalog"
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number within the set; null when unavailable"
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full set name (e.g. \"Core Set 2021\")"
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set abbreviation (e.g. \"M21\")"
          },
          "set_release_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Chronological release date of the card's set; null if unavailable. Used to render the tcg_release buylist sort order (#2317).\n"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card language (e.g. \"English\"); null if SKU is not yet in the catalog"
          },
          "finish": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card finish (e.g. \"Normal\", \"Foil\"); null if SKU is not yet in the catalog"
          },
          "finish_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display-only finish label, refined to the specific foil treatment when known (e.g. \"Surge Foil\" instead of the generic \"Alternative Foil\"). Derived from the printing's promo types, same as SkuVariant.finish_label; `finish` remains the canonical machine value. Null if the SKU is not yet in the catalog.\n"
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card image URL from catalog; null if SKU is not yet in the catalog"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BuylistFulfillment": {
        "type": "object",
        "required": [
          "kind",
          "label"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "mail_in",
              "drop_off"
            ]
          },
          "label": {
            "type": "string"
          },
          "location": {
            "type": [
              "object",
              "null"
            ],
            "description": "The store's receiving address for this fulfillment option (the pickup location for drop-off, or the store's mailing address for mail-in), so the seller knows where to get their cards. Null only when the store has no address on file.",
            "properties": {
              "id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Pickup-location id for drop-off; null for the mail-in (store) address."
              },
              "name": {
                "type": "string"
              },
              "address_line1": {
                "type": "string"
              },
              "address_line2": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": "string"
              },
              "region": {
                "type": "string"
              },
              "postal_code": {
                "type": "string"
              },
              "country": {
                "type": "string"
              }
            }
          }
        }
      },
      "BuylistPaymentMethod": {
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "BuylistShippingAddress": {
        "type": "object",
        "required": [
          "line1",
          "city",
          "region",
          "postal_code",
          "country"
        ],
        "properties": {
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "BuylistPurchase": {
        "type": "object",
        "required": [
          "purchase_uuid",
          "store_uuid",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "purchase_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "buylist_number": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Short per-store sequential id (#2258), shown as `#0042` (four digits, growing past 9999 rather than wrapping). Null only for an offer written during the release window before numbering shipped.\n"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "changes_proposed",
              "accepted",
              "received",
              "pushed",
              "canceled",
              "declined",
              "returned"
            ]
          },
          "intake_kind": {
            "type": "string",
            "enum": [
              "walk_in",
              "mail_in",
              "drop_off"
            ],
            "description": "How the cards reach the store, and which steps the offer needs. walk_in = customer at the counter: no receipt step, pushes straight from accepted, and nothing is emailed automatically. mail_in = the store approves, the customer ships, the store receives and reconciles. drop_off = the store approves, then checks the cards in when the customer brings them to a branch.\n"
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "quoted_cash_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "quoted_credit_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "cash_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "credit_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "cash_paid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "credit_paid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string; null if not set"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "accepted_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "payout_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cash",
              "credit",
              null
            ],
            "description": "Null for operator-created purchases (no storefront payout choice was made)."
          },
          "fulfillment": {
            "description": "Null for operator-created purchases.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistFulfillment"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_method": {
            "description": "Null for operator-created purchases.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistPaymentMethod"
              },
              {
                "type": "null"
              }
            ]
          },
          "pos_customer_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Shopify customer the store credit is sent to, once chosen or found."
          },
          "credit_issue": {
            "description": "Store credit owed to the customer's POS account; null when the purchase pays no credit or the store's credit destination is none. Returned by the single-purchase GET only.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistCreditIssue"
              },
              {
                "type": "null"
              }
            ]
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipping_address": {
            "description": "Present for mail_in fulfillment; null for drop_off or operator-created purchases.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistShippingAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "decline_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store-provided reason set when the purchase is declined; null otherwise."
          },
          "changes_proposed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set when the store sent revised terms to the seller (status changes_proposed); null otherwise."
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set when the cards were marked physically received (status received); null otherwise."
          },
          "received_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "User who marked the purchase received; null otherwise."
          },
          "returned_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set when the cards were returned to the seller (status returned); null otherwise."
          },
          "return_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason recorded when the offer was returned; null otherwise."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set when the store archived (hid) this finished offer from its offers list; null otherwise. Display-only: the status, totals and audit trail are unchanged and reports still count it.\n"
          },
          "archived_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "User who archived the offer; null when not archived."
          }
        }
      },
      "BulkArchiveBuylistPurchasesResponse": {
        "type": "object",
        "required": [
          "results",
          "succeeded"
        ],
        "properties": {
          "succeeded": {
            "type": "integer",
            "description": "How many offers ended up in the requested state."
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "purchase_uuid",
                "ok"
              ],
              "properties": {
                "purchase_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "ok": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string",
                  "enum": [
                    "purchase_not_found",
                    "purchase_invalid_state"
                  ],
                  "description": "Why this offer was skipped; absent when ok."
                },
                "current_status": {
                  "type": "string",
                  "description": "The offer's status, when it was skipped for not being finished."
                },
                "purchase": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          }
        }
      },
      "KioskBundle": {
        "type": "object",
        "required": [
          "bundle_uuid",
          "name",
          "target_kind",
          "target_value",
          "min_quantity",
          "discount_kind",
          "discount_value",
          "is_active",
          "tag_exists",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "bundle_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Shown to the customer in the kiosk cart."
          },
          "target_kind": {
            "type": "string",
            "enum": [
              "game",
              "tag"
            ]
          },
          "target_value": {
            "type": "string",
            "description": "A game key, or a tag slug."
          },
          "min_quantity": {
            "type": "integer",
            "minimum": 2,
            "description": "Copies of matching items the cart must hold."
          },
          "discount_kind": {
            "type": "string",
            "enum": [
              "percent",
              "fixed_price"
            ]
          },
          "discount_value": {
            "type": "number",
            "description": "Percent off (0-100 exclusive), or the price per item."
          },
          "is_active": {
            "type": "boolean"
          },
          "tag_exists": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Tag bundles only: false when the tag was deleted."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateKioskBundleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "target_kind",
          "target_value",
          "min_quantity",
          "discount_kind",
          "discount_value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "target_kind": {
            "type": "string",
            "enum": [
              "game",
              "tag"
            ]
          },
          "target_value": {
            "type": "string",
            "minLength": 1
          },
          "min_quantity": {
            "type": "integer",
            "minimum": 2
          },
          "discount_kind": {
            "type": "string",
            "enum": [
              "percent",
              "fixed_price"
            ]
          },
          "discount_value": {
            "type": "number",
            "minimum": 0
          },
          "is_active": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "UpdateKioskBundleRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "target_kind": {
            "type": "string",
            "enum": [
              "game",
              "tag"
            ]
          },
          "target_value": {
            "type": "string",
            "minLength": 1
          },
          "min_quantity": {
            "type": "integer",
            "minimum": 2
          },
          "discount_kind": {
            "type": "string",
            "enum": [
              "percent",
              "fixed_price"
            ]
          },
          "discount_value": {
            "type": "number",
            "minimum": 0
          },
          "is_active": {
            "type": "boolean"
          }
        }
      },
      "KioskConfig": {
        "type": "object",
        "required": [
          "store_uuid",
          "is_published",
          "default_sort",
          "require_phone",
          "max_qty_per_line",
          "game_order"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store display name on the kiosk. Falls back to Store.name when null."
          },
          "is_published": {
            "type": "boolean",
            "description": "Whether the kiosk is publicly visible."
          },
          "default_sort": {
            "type": "string",
            "enum": [
              "price_desc",
              "price_asc",
              "cogs_desc",
              "relevance"
            ],
            "description": "The browse default when a shopper's request names no sort. cogs_desc is the only way a public browse page can ever be ranked by cost basis -- a shopper-supplied cogs_desc downgrades to relevance unless this matches it.\n"
          },
          "require_phone": {
            "type": "boolean",
            "description": "Whether phone is required at checkout (First/Last/Email are always required)."
          },
          "pickup_instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "maxLength": 500,
            "description": "Link to the store's terms page, shown at checkout. Null when unset."
          },
          "min_order_total": {
            "type": [
              "number",
              "null"
            ],
            "description": "Minimum order subtotal to check out. Null means no minimum."
          },
          "max_qty_per_line": {
            "type": "integer",
            "minimum": 1,
            "description": "Per-line quantity cap at checkout. Default 4."
          },
          "stale_flag_hours": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Hours an unclaimed pickup order can sit before it's flagged for review. Null means the feature is off for this store.\n"
          },
          "auto_cancel_days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Days an unclaimed pickup order can sit before a daily sweep cancels it on the store's behalf, returning its stock to sellable and emailing the buyer. Measured from when the order was marked ready for pickup, or from when it was placed if it never was. Null means the feature is off for this store. Independent of stale_flag_hours -- neither setting requires or constrains the other. Because the sweep runs once a day, an order is cancelled at least this many days old, not exactly.\n"
          },
          "canceled_order_bin_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Bin a canceled kiosk order's restocked inventory goes into. Must be an existing bin (not a container) belonging to this store. Null means no dedicated bin configured.\n"
          },
          "root_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Location the public kiosk is scoped to: only stock in this bin, or in any bin beneath this container at any depth, is browsed, searched and quoted. Null means the full inventory. Cleared automatically when the location is deleted.\n"
          },
          "game_order": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Store-configured display order for the kiosk's game switcher/settings reorder list (#1420). Games not present here are shown after, alphabetically. Empty means no custom order -- falls back to alphabetical.\n"
          }
        }
      },
      "KioskCanceledBinContents": {
        "type": "object",
        "required": [
          "canceled_bin_location_uuid",
          "items"
        ],
        "properties": {
          "canceled_bin_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin these contents were read from. Null when the store has designated no usable canceled-order bin, in which case items is empty.\n"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KioskCanceledBinItem"
            }
          }
        }
      },
      "KioskCanceledBinItem": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "total_quantity",
          "returnable_quantity",
          "unreturnable_quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "total_quantity": {
            "type": "integer",
            "description": "Copies physically in the canceled-order bin right now."
          },
          "returnable_quantity": {
            "type": "integer",
            "description": "Copies still owed back to a bin that still exists. Capped by total_quantity at the moment the return runs, not here.\n"
          },
          "unreturnable_quantity": {
            "type": "integer",
            "description": "Copies owed back to a bin that has since been deleted. These can only ever be written off.\n"
          }
        }
      },
      "KioskCanceledBinReturnResult": {
        "type": "object",
        "required": [
          "canceled_bin_location_uuid",
          "returned",
          "written_off"
        ],
        "properties": {
          "canceled_bin_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin emptied, or null when the store has designated none."
          },
          "returned": {
            "type": "array",
            "description": "One entry per (SKU, destination bin) actually moved — two claims pointing at the same bin are one trip for the person holding the cards, so they are summed rather than listed separately.\n",
            "items": {
              "$ref": "#/components/schemas/KioskCanceledBinReturnedLine"
            }
          },
          "written_off": {
            "type": "array",
            "description": "One entry per SKU whose still-open claims were closed because the bin ran out of it. Nothing moved for these.\n",
            "items": {
              "$ref": "#/components/schemas/KioskCanceledBinWrittenOffLine"
            }
          }
        }
      },
      "KioskCanceledBinReturnedLine": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "origin_location_uuid",
          "quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "origin_location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The bin the copies were returned to."
          },
          "quantity": {
            "type": "integer"
          }
        }
      },
      "KioskCanceledBinWrittenOffLine": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer"
          }
        }
      },
      "PatchKioskConfigRequest": {
        "type": "object",
        "description": "All fields are optional. Only fields present in the request body are updated; absent fields are left unchanged.\n",
        "properties": {
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_published": {
            "type": "boolean"
          },
          "default_sort": {
            "type": "string",
            "enum": [
              "price_desc",
              "price_asc",
              "cogs_desc",
              "relevance"
            ]
          },
          "require_phone": {
            "type": "boolean"
          },
          "pickup_instructions": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Absolute https:// URL, or null/empty string to clear."
          },
          "min_order_total": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "max_qty_per_line": {
            "type": "integer",
            "minimum": 1
          },
          "stale_flag_hours": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Null clears it (feature off)."
          },
          "auto_cancel_days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Null clears it (feature off)."
          },
          "canceled_order_bin_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null clears it (no dedicated bin)."
          },
          "root_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A bin or container in this store. Null clears it (full inventory).\n"
          },
          "game_order": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Store-configured display order for the kiosk's game switcher/settings reorder list (#1420). Games not present here are shown after, alphabetically. Empty means no custom order -- falls back to alphabetical.\n"
          }
        }
      },
      "BuylistFacets": {
        "type": "object",
        "required": [
          "sets",
          "rarities"
        ],
        "description": "Catalog-wide browse filter options for a store + game (only values with buylist-eligible cards). Codes/values match the products endpoint's ?set=/?rarity= inputs.\n",
        "properties": {
          "sets": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "name"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Set abbreviation; matches the products endpoint ?set= input."
                },
                "name": {
                  "type": "string"
                },
                "release_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date",
                  "description": "Set release date, so a client can offer newest/oldest set ordering without a second round trip. Null where the catalog has no date for the set (older TCGPlayer groups carry no publishedOn), so order those deliberately rather than assuming a date is always present. Optional: absent on responses served before this field existed.\n"
                }
              }
            }
          },
          "rarities": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "value",
                "label"
              ],
              "properties": {
                "value": {
                  "type": "string",
                  "description": "Raw catalog rarity; matches the products endpoint ?rarity= input."
                },
                "label": {
                  "type": "string",
                  "description": "Human-friendly label (frontend may relabel)."
                }
              }
            }
          }
        }
      },
      "BuylistQuoteRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 0,
            "maxItems": 5000,
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "condition",
                "quantity"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "condition": {
                  "$ref": "#/components/schemas/CardConditionInput"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "BuylistQuoteResponse": {
        "type": "object",
        "required": [
          "quotes"
        ],
        "properties": {
          "quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "condition",
                "quantity",
                "accepted_quantity",
                "rejected_quantity",
                "decision"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "condition": {
                  "type": "string",
                  "description": "The submitted condition, region-labelled for display (#1150/#1151 §4): a Cardmarket/MKM label for an `eu` store, the stored US value for `usa`. The request accepts either vocabulary for an `eu` store (#1152) -- an EU label is translated to its stored US grade before evaluation, then displayed back in the same EU vocabulary here."
                },
                "quantity": {
                  "type": "integer",
                  "description": "The submitted quantity."
                },
                "accepted_quantity": {
                  "type": "integer",
                  "description": "How many of the submitted quantity the store will buy after applying a matched BUY rule's MAX_STOCK headroom against current on-hand stock (#1170). Equals quantity when the rule is uncapped; 0 when at/over the stock target. Best-effort (pushed stock only); the authoritative clamp runs at accept."
                },
                "rejected_quantity": {
                  "type": "integer",
                  "description": "The overflow copies not bought (quantity minus accepted_quantity)."
                },
                "decision": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "decline"
                  ],
                  "description": "buy when accepted_quantity > 0, otherwise decline."
                },
                "matched_rule_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "cash_offer": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string e.g. \"1.50\". Null when decision is decline."
                },
                "credit_offer": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string. Null when ruleset has no credit tier OR decision is decline."
                }
              }
            }
          }
        }
      },
      "BuylistDeclineOverrideRequest": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "condition"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "condition": {
            "$ref": "#/components/schemas/CardConditionInput"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "default": 1
          }
        }
      },
      "BuylistDeclineOverrideResponse": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "condition",
          "quantity",
          "was_declined"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "condition": {
            "type": "string",
            "description": "The submitted condition, region-labelled for display (#1150/#1151 §4): a Cardmarket/MKM label for an `eu` store, the stored US value for `usa`. The request accepts either vocabulary for an `eu` store (#1152) -- an EU label is translated to its stored US grade before evaluation, then displayed back in the same EU vocabulary here."
          },
          "quantity": {
            "type": "integer"
          },
          "was_declined": {
            "type": "boolean",
            "description": "True when the ruleset declines this SKU, i.e. the override is a real one."
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "cash_offer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card. Null on a decline — the operator prices it."
          },
          "credit_offer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal string, price of one card. Null on a decline."
          }
        }
      },
      "BuylistRule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "store_uuid",
          "rule_name",
          "rule",
          "name",
          "sequence_index",
          "currency",
          "game",
          "is_enabled",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string",
            "description": "User-defined name for the buylist rule"
          },
          "rule": {
            "type": "string",
            "description": "The DSL source text of the rule."
          },
          "name": {
            "type": "string",
            "description": "Alias of rule_name retained for legacy client compat."
          },
          "sequence_index": {
            "type": "integer"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "game": {
            "type": "string",
            "description": "Game the rule applies to (magic, pokemon, lorcana, onepiece, riftbound, unionarena, pokemonjp, gundam, starwars, yugioh, cyberpunk, palworld, digimon, fleshblood, cookierun, sleeves, sorcery, wow, deckboxes, playmats, binders, colstorage, counters, vanguard, dbsmasters, dbsfusion, weiss).\n"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BuylistRuleInput": {
        "type": "object",
        "description": "An item in a replaceBuylistRules array. Scoped to the request's `game` query parameter -- there is no per-item `game` field; a rule cannot be moved to a different game via this endpoint (use PATCH).\n",
        "oneOf": [
          {
            "required": [
              "rule_uuid"
            ]
          },
          {
            "required": [
              "rule",
              "name"
            ]
          }
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of an existing buylist rule to keep in this position"
          },
          "rule": {
            "type": "string",
            "description": "Buylist DSL rule string (required for new rules)"
          },
          "name": {
            "type": "string",
            "description": "User-defined name (required for new rules)"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "is_enabled": {
            "type": "boolean"
          }
        }
      },
      "BuylistRuleCreateInput": {
        "type": "object",
        "required": [
          "rule",
          "name",
          "game"
        ],
        "properties": {
          "rule": {
            "type": "string",
            "description": "Buylist DSL rule string."
          },
          "name": {
            "type": "string",
            "description": "User-defined name for the buylist rule."
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "description": "1-based position within this game's evaluation order. Appends to the end when omitted.\n"
          }
        }
      },
      "BuylistRulePreview": {
        "type": "object",
        "description": "One previewed SKU: the card, the offer the storefront holds for it today, and what the store's current ruleset computes for it right now.\n",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "condition",
          "finish",
          "decision",
          "locked",
          "current_cash",
          "current_credit",
          "new_cash",
          "new_credit",
          "matched_rule_uuid"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "decision": {
            "type": "string",
            "enum": [
              "buy",
              "decline",
              "no_match"
            ],
            "description": "`buy` -- a BUY rule matched. `decline` -- a DECLINE rule matched, so the store refuses this card on purpose. `no_match` -- nothing matched, which is a rule-coverage gap rather than a policy. A `buy` with a null `new_cash` is the fourth case: the rule matched but its price expression had no value for this printing.\n"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that decided this row, null when nothing matched."
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "matched_rule_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "The DSL source of the matched rule."
          },
          "current_cash": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the storefront offers for this SKU right now, from the materialized offer projection. Null when the store has no offer row for it -- either the rules do not buy it, or the projection has not rebuilt since they started to.\n"
          },
          "current_credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "current_matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that set the stored price. Differs from `matched_rule_uuid` when the ruleset changed since the last rebuild, or when the row is locked and still carries whichever rule priced it before the freeze.\n"
          },
          "new_cash": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the rules compute for this SKU now, at the offer columns' own 4-decimal scale (bulk is bought per thousand, so $12.50/1000 commons is a $0.0125 offer). Null on a decline, on no match, and on a BUY whose price source has no value for this printing.\n"
          },
          "new_credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "new_max_qty": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Headroom the matched rule's `MAX_STOCK` cap leaves against the copies already on hand, computed the same way the rebuild materializes `max_qty`. Null when the rule sets no cap.\n"
          },
          "locked": {
            "type": "boolean",
            "description": "Whether the stored offer is price-locked (#1175). A locked row is not repriced by the rebuild, so `new_cash` there is what the rules say rather than what the store will pay.\n"
          }
        }
      },
      "BuylistRuleOffer": {
        "type": "object",
        "description": "One offer a buylist rule currently owns, read straight off the materialized projection the storefront browses.\n",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "condition",
          "finish",
          "cash",
          "hotlist",
          "locked"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for a SKU whose catalog row is missing -- the rebuild LEFT JOINs `products`, so such a SKU still gets a buy price. Passed through as null rather than backfilled, so this page names cards exactly as the storefront does.\n"
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_icon_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "foil_treatment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Alt-foil treatment (Surge Foil, Etched, ...), null for a plain finish."
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "cash": {
            "type": "number",
            "description": "What the store pays for this card in cash."
          },
          "credit": {
            "type": [
              "number",
              "null"
            ],
            "description": "Store-credit offer, null when the rule offers cash only."
          },
          "max_qty": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Headroom under the rule's `MAX_STOCK` cap as of the last rebuild; null when uncapped."
          },
          "hotlist": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean",
            "description": "Whether this offer's price is frozen against the rebuild (#1175). A locked row keeps whichever rule priced it before the freeze, so it can appear under a rule that would no longer match it.\n"
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PaginatedBuylistRuleOfferList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rule_uuid",
              "game",
              "offers"
            ],
            "properties": {
              "rule_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "The rule these offers are attributed to."
              },
              "game": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GameId"
                  }
                ],
                "description": "The rule's own game, as the rule currently stands. The listing is NOT scoped to it: a rule moved between games keeps owning the frozen rows it priced under the previous one, so an individual offer's `game` can differ from this.\n"
              },
              "offers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BuylistRuleOffer"
                }
              }
            }
          }
        ]
      },
      "CardFinish": {
        "type": "string",
        "description": "A SKU's printing finish, as stored on `global_identifiers.finish`. Mirrors `schemas.models.constants.FINISHES`, which is the source of truth for the vocabulary.\n",
        "enum": [
          "normal",
          "foil",
          "etched",
          "alternative_foil",
          "holofoil",
          "reverse_holofoil",
          "1st_edition",
          "1st_edition_holofoil",
          "unlimited",
          "unlimited_holofoil",
          "cold_foil",
          "limited",
          "rainbow_foil",
          "1st_edition_cold_foil",
          "1st_edition_rainbow_foil",
          "unlimited_rainbow_foil"
        ]
      },
      "CardCondition": {
        "type": "string",
        "description": "A SKU's stored condition. `Graded` marks a graded slab (#2260): its real grade lives on the store item, so it is a response value only and never accepted on a request (see `CardConditionInput`).\n",
        "enum": [
          "Near Mint",
          "Lightly Played",
          "Moderately Played",
          "Heavily Played",
          "Damaged",
          "Unopened",
          "Graded"
        ]
      },
      "CardConditionInput": {
        "type": "string",
        "description": "Accepted condition values on a request. The US six always validate. An `eu` store's request may additionally use the seven Cardmarket/MKM labels (#1152); each is translated server-side to its stored US grade before validation and storage (Cardmarket's \"Light Played\" maps to \"Moderately Played\", not \"Lightly Played\" -- see EU_TO_US).\n\nOn a **write** surface (intake, quote, import, rule authoring) a `usa` store's request using an EU label is rejected. On a **filter** surface (`listInventory`/`countInventory`'s `condition`, `exportInventory`'s `filters.condition`, `moveCardsToLocation`'s `filters.condition`) the same translation happens (#1599) but there is no rejection: an unrecognised label simply matches nothing, exactly as any other non-matching filter value does. Filters have never validated their values, and narrowing that would change `usa` behaviour too.\n",
        "enum": [
          "Near Mint",
          "Lightly Played",
          "Moderately Played",
          "Heavily Played",
          "Damaged",
          "Unopened",
          "Mint",
          "Excellent",
          "Good",
          "Light Played",
          "Played",
          "Poor"
        ]
      },
      "OrderDocumentSection": {
        "type": "string",
        "deprecated": true,
        "description": "Retired. The order document used to render a `packing_slip` and/or an `invoice` page; it is now the one packing slip, and a `sections` value is accepted and ignored.\n",
        "enum": [
          "packing_slip",
          "invoice"
        ]
      },
      "OrderDocumentSortBy": {
        "type": "string",
        "description": "Metric to order an order document's line items by. Mirrors the on-screen line-item sort. Omit to keep the received (as-ordered) order.\n\nPinned to the service's `SORT_METRICS` by `test_line_item_sort_enum_parity`. `release` orders by the line's catalog release date, so `release`+`desc` is the newest-printing-first pull order. Lines sharing a release date -- every non-Magic line, and most Magic ones -- group by set and then A-Z by card; that tiebreak does not reverse with `sort_dir`.\n",
        "enum": [
          "name",
          "set",
          "condition",
          "quantity",
          "price",
          "release"
        ]
      },
      "OrderDocumentSortDir": {
        "type": "string",
        "description": "Sort direction. asc = A-Z / Near-Mint-first / low-to-high / oldest printing first; desc reverses. Line items missing the sorted value always sort last, regardless of direction. Defaults to asc when sort_by is given.\n",
        "enum": [
          "asc",
          "desc"
        ],
        "default": "asc"
      },
      "OrderDocumentLayout": {
        "type": "string",
        "description": "Page layout for the packing slip (#2768). `standard` flows top to bottom. `window_envelope` pins the recipient's name and address where a tri-folded letter page shows through the window of a standard #10 single-window envelope (4.5in x 1.125in window, 7/8in from the left edge and 1/2in from the bottom), drops the SHIP TO heading from that block, and prints labelled fold marks at the two tri-fold creases on every page. Pages a long slip runs onto use the full page. `thermal_4x6` prints the same slip on a 4x6in thermal label (288 x 432pt) to go inside the package: store and buyer side by side, two-line item rows, the order number once under the header, and the HippoLink credit with `Page X of Y` at every foot. A placement-order print (`run_uuid`) works in every layout but the two below. When a request omits it, the store's saved default applies (`document_layout` in the order settings, #2859), which is `standard` unless the store changed it.\n`by_location` and `by_location_window_envelope` (#4125) print the slip with the order's pick list where the items table would be, on the standard and the window-envelope page: the pick list's location bands, Bin column, boxes and legend, laid out by the store's pick list settings, in walking order (`sort_by`, `sort_dir` and `run_uuid` are ignored), with each stop's Price and Total after the store's columns so the lines still add up to the totals. Printing one makes the order's pick run: an order already on an active run prints that run's stops, picked or not; an order Pick Orders would offer gets its own By Location run, assigned to the caller (one run per order in a batch), when the caller may create pick runs (`createFulfillmentRun`); printing again prints that run. Anything else (shipped, canceled, a held preorder, queued in CardChaos, a caller who may not create runs) prints with no run, and every copy no stop covers, including a line HippoLink doesn't stock, prints under a `No bin` band. It never refuses for any of these.\n",
        "enum": [
          "standard",
          "window_envelope",
          "thermal_4x6",
          "by_location",
          "by_location_window_envelope"
        ]
      },
      "CardPeek": {
        "description": "Minimal product snapshot used for bin-card preview strips (first/last card in a bin). Contains just enough to render a label without a separate catalog call.\n",
        "type": "object",
        "required": [
          "sku_id",
          "product_name"
        ],
        "properties": {
          "sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID of this card variant."
          },
          "product_name": {
            "type": "string",
            "description": "Human-readable product name."
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number printed on the card. Null when unavailable."
          }
        }
      },
      "CardChaosOrderState": {
        "description": "Where an order stands in CardChaos's pick queue (CardChaos picking). `state` is its most active line's: `on_picklist` (CardChaos is picking it), `queued` (waiting for a CardChaos picklist), `executed` (CardChaos pulled the cards), `recalled` (taken back for HippoLink to pick, or cancelled).\n",
        "type": "object",
        "required": [
          "state",
          "recall_pending"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "on_picklist",
              "executed",
              "recalled"
            ]
          },
          "recall_pending": {
            "type": "boolean",
            "description": "A Pick in HippoLink instead request is waiting for CardChaos to confirm."
          }
        }
      },
      "CardChaosRecallAccepted": {
        "type": "object",
        "required": [
          "order_uuid",
          "cardchaos"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "cardchaos": {
            "$ref": "#/components/schemas/CardChaosOrderState"
          }
        }
      },
      "CardChaosReleaseResult": {
        "type": "object",
        "required": [
          "order_uuid",
          "released_lines"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "released_lines": {
            "type": "integer",
            "minimum": 0,
            "description": "Lines taken back from CardChaos; 0 when nothing of the order was there."
          }
        }
      },
      "CardChaosConnection": {
        "description": "A store's CardChaos connection. Never carries the API key.",
        "type": "object",
        "required": [
          "connected",
          "cardchaos_account_id",
          "base_url",
          "linked_at",
          "connection_status",
          "cutover_completed_at",
          "cutover_enabled",
          "test_import_enabled",
          "picking_available",
          "picking_enabled_at",
          "last_push",
          "stream_backlog"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "cardchaos_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The linked CardChaos account. Null when not connected."
          },
          "base_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "CardChaos base URL the store is linked through."
          },
          "linked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "connection_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Credential health (`healthy` until a call fails auth). Null when not connected."
          },
          "cutover_completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the store finished migrating off CardChaos. Null until then."
          },
          "cutover_enabled": {
            "type": "boolean",
            "description": "Whether this environment allows a CardChaos cutover at all (the deploy setting `cardchaos_cutover_enabled`). While false, `startCardChaosSync` refuses `mode: cutover` with 403 for every caller. True does not mean the caller may cut over: that also takes the store owner or a sys admin, a preview with nothing blocking, and an empty store.\n"
          },
          "test_import_enabled": {
            "type": "boolean",
            "description": "Whether a CardChaos test import is switched on for this environment (the deploy setting `cardchaos_test_import_enabled`, dev only). While false, `startCardChaosSync` refuses `mode: test_import` with 403 `cardchaos_test_import_disabled`.\n"
          },
          "picking_available": {
            "type": "boolean",
            "description": "Whether this environment offers Pick with CardChaos (the deploy setting `cardchaos_picking_enabled`). While false, turning picking on (`setCardChaosPicking`) and `startCardChaosPush` answer 403.\n"
          },
          "picking_enabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When Pick with CardChaos was turned on. Null while it is off."
          },
          "last_push": {
            "description": "The store's newest push to CardChaos. Null when there has been none.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardChaosPushJob"
              },
              {
                "type": "null"
              }
            ]
          },
          "stream_backlog": {
            "description": "Sales, invoices and recalls waiting to be sent to CardChaos (CardChaos picking). Retried automatically; `last_error` is the newest failure among them. While `connection_status` is `action_needed` nothing is sent until the store reconnects.\n",
            "type": "object",
            "required": [
              "pending",
              "oldest_pending_at",
              "last_error"
            ],
            "properties": {
              "pending": {
                "type": "integer"
              },
              "oldest_pending_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_error": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "CardChaosPushRequest": {
        "type": "object",
        "required": [
          "scope"
        ],
        "additionalProperties": false,
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "import_job",
              "all",
              "locations"
            ]
          },
          "import_job_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Required for `import_job`. A completed import (not a revert or relocation)."
          },
          "location_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Required for `locations`. Every location must belong to this store."
          }
        }
      },
      "CardChaosPushCounts": {
        "type": "object",
        "required": [
          "bins",
          "pushed",
          "deleted",
          "skipped",
          "failed",
          "retrying",
          "cards_added",
          "cards_removed",
          "cards_moved"
        ],
        "properties": {
          "bins": {
            "type": "integer",
            "description": "Bins in the push (0 until the worker has resolved them)."
          },
          "pushed": {
            "type": "integer"
          },
          "deleted": {
            "type": "integer",
            "description": "Bins deleted in CardChaos because they are gone from HippoLink."
          },
          "skipped": {
            "type": "integer",
            "description": "Empty bins CardChaos never had, and pushes a newer push overtook."
          },
          "failed": {
            "type": "integer"
          },
          "retrying": {
            "type": "integer",
            "description": "Bins waiting for the next retry round."
          },
          "cards_added": {
            "type": "integer"
          },
          "cards_removed": {
            "type": "integer"
          },
          "cards_moved": {
            "type": "integer"
          }
        }
      },
      "CardChaosPushBinError": {
        "type": "object",
        "required": [
          "location_uuid",
          "label",
          "code",
          "message",
          "retrying"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "code": {
            "type": "string",
            "description": "CardChaos's code (`reserved_conflict`, `bin_not_empty`, `missing_sku_details`, ...)."
          },
          "message": {
            "type": "string"
          },
          "retrying": {
            "type": "boolean",
            "description": "True while the bin waits for another round."
          }
        }
      },
      "CardChaosPushJob": {
        "description": "One push of HippoLink bins into CardChaos.",
        "type": "object",
        "required": [
          "push_uuid",
          "store_uuid",
          "scope",
          "import_job_uuid",
          "reason",
          "status",
          "retry_round",
          "counts",
          "errors",
          "error",
          "created_at",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "push_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "scope": {
            "type": "string",
            "enum": [
              "import_job",
              "all",
              "locations"
            ]
          },
          "import_job_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "description": "`manual` for a push someone started; otherwise what triggered it (e.g. `restock`)."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "failed"
            ]
          },
          "retry_round": {
            "type": "integer"
          },
          "counts": {
            "$ref": "#/components/schemas/CardChaosPushCounts"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardChaosPushBinError"
            }
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "description": "Why the whole push failed (`phase`, `message`). Null otherwise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CardChaosSyncRequest": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "preview",
              "cutover",
              "test_import"
            ],
            "description": "`test_import` (sys admin, only where `test_import_enabled`) writes the same inventory as `cutover` from a CardChaos preview export: CardChaos is never frozen or locked, the store is not marked cut over, and nothing is pushed to marketplaces.\n"
          },
          "target": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardChaosImportTarget"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CardChaosImportTarget": {
        "description": "Where a cutover or test import puts the CardChaos boxes and bins. Exactly one key. Omitted: a new top-level location named \"CardChaos\". Refused (422 `invalid_target`) on a preview.\n",
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "maxProperties": 1,
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "An existing, undeleted container in this store. Boxes go under it, after its children."
          },
          "new_location_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Name for a new top-level location. Dated if the store already has a root with that name."
          }
        }
      },
      "CardChaosSyncJob": {
        "description": "One CardChaos sync run.",
        "type": "object",
        "required": [
          "job_uuid",
          "store_uuid",
          "mode",
          "target",
          "status",
          "counts",
          "fetch_progress",
          "preview",
          "error",
          "created_at",
          "started_at",
          "finished_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The store holding the CardChaos connection; a cutover writes into it."
          },
          "mode": {
            "type": "string",
            "enum": [
              "preview",
              "cutover",
              "test_import"
            ]
          },
          "target": {
            "type": [
              "object",
              "null"
            ],
            "description": "Where the boxes were sent to go, as requested. Null when none was given.",
            "required": [
              "location_uuid",
              "new_location_name"
            ],
            "properties": {
              "location_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "new_location_name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "fetching",
              "applying",
              "completed",
              "failed"
            ]
          },
          "counts": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the apply produced (containers, bins, storage rows, copies, lots, problems). Empty until completed."
          },
          "fetch_progress": {
            "type": "object",
            "additionalProperties": true,
            "description": "Rows CardChaos reported per section (`counts`) and rows fetched so far (`fetched`)."
          },
          "preview": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "For a preview, or a cutover that was blocked, the before/after diff and its blockers."
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Why the job failed (`phase`, `message`, and phase-specific detail). Null unless failed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CardChaosSyncJobList": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "jobs"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardChaosSyncJob"
            }
          }
        }
      },
      "CostBatch": {
        "description": "A purchase bought for one total whose cards are added over time.",
        "type": "object",
        "required": [
          "batch_uuid",
          "name",
          "notes",
          "status",
          "source",
          "cc_batch_id",
          "total_cost",
          "finish_started_at",
          "finish_error",
          "created_at",
          "finished_at",
          "finished_by",
          "lot_count",
          "copies",
          "copies_remaining",
          "provisional_total",
          "external_units",
          "external_copies",
          "copies_sold",
          "sales_total",
          "hippolink_sales",
          "cardchaos_sales",
          "cost_of_sold",
          "cardchaos_cost_of_sold",
          "unpriced_sold_copies",
          "uncosted_sold_copies",
          "sealed_pool",
          "sealed_units"
        ],
        "properties": {
          "batch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "finishing",
              "finished"
            ],
            "description": "`open` takes cards and keeps a provisional cost on them; `finishing` is being finished; `finished` is locked.\n"
          },
          "source": {
            "type": "string",
            "enum": [
              "hippolink",
              "cardchaos"
            ]
          },
          "cc_batch_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "CardChaos's batch id, for a batch carried over from CardChaos."
          },
          "total_cost": {
            "type": [
              "string",
              "null"
            ],
            "description": "What you paid for the whole batch, decimal as string. Optional: set at create or edit while the batch is open, or at finish; for a CardChaos batch, prefilled with CardChaos's total (null when it was encrypted). While the batch is open with a total, each card's unit_cost is its live market share of it.\n"
          },
          "finish_started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the running (status `finishing`) or last finish started."
          },
          "finish_error": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Why the last finish failed; null when none has, or after a success."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "lot_count": {
            "type": "integer"
          },
          "copies": {
            "type": "integer",
            "description": "Copies the batch received."
          },
          "copies_remaining": {
            "type": "integer",
            "description": "Of those, copies still on hand."
          },
          "provisional_total": {
            "type": "string",
            "description": "Sum of the batch's lots at their current cost, 2 dp."
          },
          "external_units": {
            "type": "integer"
          },
          "external_copies": {
            "type": "integer",
            "description": "Copies sold before they reached HippoLink (CardChaos sales); they weight the finish."
          },
          "copies_sold": {
            "type": "integer",
            "description": "Copies sold in HippoLink (net of cancels and stock-returning refunds) plus external_copies."
          },
          "sales_total": {
            "type": "string",
            "description": "What those copies sold for, before fees, shipping and tax (2 dp): hippolink_sales plus cardchaos_sales. CardChaos copies with no recorded price are left out (unpriced_sold_copies).\n"
          },
          "hippolink_sales": {
            "type": "string",
            "description": "HippoLink sales of the batch's cards, line unit price x copies (2 dp)."
          },
          "cardchaos_sales": {
            "type": "string",
            "description": "What the batch's CardChaos sales sold for (2 dp)."
          },
          "cost_of_sold": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the copies sold in HippoLink cost at their card's cost now (2 dp): the live share of total_cost while open, the final cost once finished. Null while the batch is open with no total_cost.\n"
          },
          "cardchaos_cost_of_sold": {
            "type": "string",
            "description": "What the copies sold in CardChaos cost there (2 dp), for a batch finished in CardChaos; 0.00 otherwise. Copies with no recorded cost are left out (uncosted_sold_copies).\n"
          },
          "unpriced_sold_copies": {
            "type": "integer",
            "description": "Copies sold in CardChaos with no recorded price; counted in copies_sold, not in sales."
          },
          "uncosted_sold_copies": {
            "type": "integer",
            "description": "Copies sold in CardChaos with no recorded cost; counted in copies_sold, not in cardchaos_cost_of_sold."
          },
          "sealed_pool": {
            "type": "string",
            "description": "The cost of the sealed product opened into the batch and not un-opened (2 dp); part of `total_cost`."
          },
          "sealed_units": {
            "type": "integer",
            "description": "Sealed copies opened into the batch and not un-opened."
          },
          "sealed_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatchSealedSource"
            },
            "description": "The batch's live (not un-opened) openings, oldest first. Present on `getCostBatch` and the open and un-open responses only, not on lists or other batch responses.\n"
          }
        }
      },
      "CostBatchList": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "batches"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "batches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatch"
            }
          }
        }
      },
      "CostBatchCard": {
        "description": "One inventory lot in a cost batch.",
        "type": "object",
        "required": [
          "lot_id",
          "tcgplayer_sku_id",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "original_quantity",
          "remaining_quantity",
          "unit_cost",
          "cost_basis_source",
          "received_at",
          "sold_quantity",
          "sales"
        ],
        "properties": {
          "lot_id": {
            "type": "integer"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the catalog has no name for the SKU."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "original_quantity": {
            "type": "integer",
            "description": "Copies the lot arrived with."
          },
          "remaining_quantity": {
            "type": "integer",
            "description": "Of those, copies still on hand."
          },
          "unit_cost": {
            "type": "string",
            "description": "The lot's cost per copy, 6 dp: while the batch is open, its live share of total_cost when one is set (else its provisional cost); the final cost once it is finished.\n"
          },
          "cost_basis_source": {
            "type": "string",
            "enum": [
              "manual",
              "buylist_assumed",
              "buylist_purchase",
              "synthetic_zero",
              "cardchaos_migration",
              "batch_pending",
              "cost_batch"
            ],
            "description": "Where `unit_cost` came from."
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "sold_quantity": {
            "type": "integer",
            "description": "Copies of this card sold in HippoLink (net of cancels and stock-returning refunds)."
          },
          "sales": {
            "type": "string",
            "description": "What they sold for, line unit price x copies (2 dp)."
          }
        }
      },
      "CostBatchExternalUnitRow": {
        "description": "Copies of one card sold before they reached HippoLink (a CardChaos sale); they weigh in the finish.",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "quantity",
          "sale_amount",
          "unpriced_quantity",
          "cost_amount",
          "uncosted_quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "sale_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the priced copies sold for in CardChaos (2 dp); null when none had a recorded price."
          },
          "unpriced_quantity": {
            "type": "integer",
            "description": "Of quantity, the copies sold with no recorded price."
          },
          "cost_amount": {
            "type": [
              "string",
              "null"
            ],
            "description": "What these copies cost in CardChaos (2 dp); null for an open batch or when no cost was recorded."
          },
          "uncosted_quantity": {
            "type": "integer",
            "description": "Of quantity, the copies sold with no recorded cost."
          }
        }
      },
      "CostBatchCardList": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "cards",
          "external_units_total"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Lots in the batch."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatchCard"
            }
          },
          "external_units_total": {
            "type": "integer",
            "description": "External unit rows in the batch, listed by `listCostBatchExternalUnits`; 0 when it has none."
          }
        }
      },
      "CostBatchExternalUnitList": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "units"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "External unit rows in the batch."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatchExternalUnitRow"
            }
          }
        }
      },
      "CreateCostBatchRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "total_cost": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "description": "What you paid for the whole batch (optional): greater than zero, at most 2 decimal places. 422 `invalid_total_cost` otherwise.\n"
          }
        }
      },
      "UpdateCostBatchRequest": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "total_cost": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "description": "What you paid for the whole batch: greater than zero, at most 2 decimal places (422 `invalid_total_cost` otherwise). Only while the batch is open (409 `cost_batch_not_open`). Any non-null total, changed or not, re-spreads the cards' live costs exactly, so re-saving the same total repairs stale live costs. null clears it and stops the live costs: the cards keep the last live cost they were given (their earlier provisional costs are not restored).\n"
          }
        }
      },
      "CostBatchFinishRequest": {
        "type": "object",
        "properties": {
          "total_cost": {
            "type": [
              "number",
              "string"
            ],
            "description": "What the whole batch cost: greater than zero, at most 2 decimal places. Defaults to the batch's `total_cost`, which includes opened sealed product; may not be below the sealed pool (422 `total_below_sealed_pool`). Prefill it from the batch's `total_cost` when CardChaos sent one; an encrypted CardChaos batch has none, so it must be typed in.\n"
          }
        }
      },
      "CostBatchSealedPlan": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "bins",
          "available"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "bins": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "location_uuid",
                "name",
                "full_path",
                "on_hand"
              ],
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "full_path": {
                  "type": "string"
                },
                "on_hand": {
                  "type": "integer"
                }
              }
            }
          },
          "available": {
            "type": "integer",
            "description": "Copies on hand across the bins."
          },
          "split": {
            "type": "array",
            "description": "Present only when `units` was given. The prefilled split, in sale shelf order.",
            "items": {
              "type": "object",
              "required": [
                "location_uuid",
                "units"
              ],
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "units": {
                  "type": "integer"
                }
              }
            }
          },
          "released_cost": {
            "type": "string",
            "description": "Present only when `units` was given. The cost the split releases, costed units only (2 dp)."
          },
          "uncosted_units": {
            "type": "integer",
            "description": "Present only when `units` was given. Copies with no recorded cost; opening needs a `unit_cost_override`."
          }
        }
      },
      "CostBatchSealedOpenRequest": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "units"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "units": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "unit_cost_override": {
            "type": [
              "string",
              "number"
            ],
            "description": "Cost per copy for copies that have no recorded cost."
          },
          "locations": {
            "type": "array",
            "description": "The split from `planSealedOpening`; it must add up to `units`. Leave it out to take copies in sale shelf order.\n",
            "items": {
              "type": "object",
              "required": [
                "location_uuid",
                "units"
              ],
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "units": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "CostBatchRemoveCardsRequest": {
        "type": "object",
        "required": [
          "lots"
        ],
        "properties": {
          "lots": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "The lots to take out; each `lot_id` at most once.",
            "items": {
              "type": "object",
              "required": [
                "lot_id"
              ],
              "properties": {
                "lot_id": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 2147483647
                },
                "unit_cost": {
                  "type": [
                    "number",
                    "string",
                    "null"
                  ],
                  "description": "The lot's cost once it leaves the batch, and what its sold copies cost: zero or more, at most 2 decimal places. Omitted or null: 0 for a lot with copies on hand; for a lot with nothing left, the lot's current cost if it never sold, and a 422 `cost_batch_lot_cost_required` if it has sold copies.\n"
                }
              }
            }
          }
        }
      },
      "CostBatchRemoveCardsResponse": {
        "type": "object",
        "required": [
          "removed",
          "batch"
        ],
        "properties": {
          "removed": {
            "type": "integer",
            "description": "Lots taken out of the batch."
          },
          "batch": {
            "$ref": "#/components/schemas/CostBatch"
          }
        }
      },
      "CostBatchSealedSource": {
        "type": "object",
        "required": [
          "id",
          "tcgplayer_sku_id",
          "source_lot_id",
          "location_uuid",
          "units",
          "unit_cost",
          "released_cost",
          "opened_at",
          "opened_by",
          "reverted_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "source_lot_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "units": {
            "type": "integer"
          },
          "unit_cost": {
            "type": "string",
            "description": "Cost per copy, 6 dp."
          },
          "released_cost": {
            "type": "string",
            "description": "What the copies cost out of stock (2 dp)."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "opened_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "reverted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CostBatchSealedOpenResponse": {
        "type": "object",
        "required": [
          "batch",
          "sources"
        ],
        "properties": {
          "batch": {
            "$ref": "#/components/schemas/CostBatch"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatchSealedSource"
            }
          }
        }
      },
      "CostBatchSealedUnopenResponse": {
        "type": "object",
        "required": [
          "batch",
          "source"
        ],
        "properties": {
          "batch": {
            "$ref": "#/components/schemas/CostBatch"
          },
          "source": {
            "$ref": "#/components/schemas/CostBatchSealedSource"
          }
        }
      },
      "CostBatchFinishCard": {
        "type": "object",
        "required": [
          "lot_id",
          "tcgplayer_sku_id",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "original_quantity",
          "remaining_quantity",
          "price",
          "price_source",
          "current_unit_cost",
          "unit_cost",
          "sales"
        ],
        "properties": {
          "lot_id": {
            "type": "integer"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "original_quantity": {
            "type": "integer",
            "description": "Copies the card arrived with; every one of them takes its share."
          },
          "remaining_quantity": {
            "type": "integer"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "The per-copy price that weighted the card, 6 dp; null for an equal split."
          },
          "price_source": {
            "type": "string",
            "enum": [
              "market_nm",
              "market_lp",
              "market_unopened",
              "average",
              "equal"
            ]
          },
          "current_unit_cost": {
            "type": "string",
            "description": "The provisional cost the card carries now, 6 dp."
          },
          "unit_cost": {
            "type": "string",
            "description": "The cost the finish will set, 6 dp."
          },
          "sales": {
            "type": "string",
            "description": "What HippoLink sold of this card for so far (2 dp), the \"Total return\" column."
          }
        }
      },
      "CostBatchFinishPreview": {
        "type": "object",
        "required": [
          "batch_uuid",
          "total_cost",
          "lot_count",
          "copies",
          "external_units",
          "external_copies",
          "external_share",
          "lots_total",
          "rounding_remainder",
          "fallback_average",
          "fallback_equal",
          "orders_affected",
          "order_lines_affected",
          "gross_profit_change",
          "pending_lines_costed",
          "pending_orders_costed",
          "cards",
          "cards_truncated",
          "sealed_pool",
          "extra_cost",
          "sealed_sources"
        ],
        "properties": {
          "batch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "total_cost": {
            "type": "string"
          },
          "lot_count": {
            "type": "integer"
          },
          "copies": {
            "type": "integer"
          },
          "external_units": {
            "type": "integer"
          },
          "external_copies": {
            "type": "integer",
            "description": "Copies sold before they reached HippoLink (CardChaos sales)."
          },
          "external_share": {
            "type": "string",
            "description": "The part of the total those sold copies absorb (2 dp); it stays on CardChaos's books."
          },
          "lots_total": {
            "type": "string",
            "description": "What the batch's cards will cost in all (6 dp); with `external_share` it adds up to `total_cost`."
          },
          "rounding_remainder": {
            "type": "string",
            "description": "Sub-cent rounding no card's quantity could carry; almost always \"0.000000\"."
          },
          "fallback_average": {
            "type": "integer",
            "description": "Cards with no market price, weighted by the batch's average price."
          },
          "fallback_equal": {
            "type": "integer",
            "description": "Cards split equally per copy because nothing in the batch had a price."
          },
          "orders_affected": {
            "type": "integer",
            "description": "Past orders whose COGS and gross profit the finish rewrites, including the pending_orders_costed orders whose totals it fills for the first time, and orders a settled line belongs to that keep no totals (another line still waits on another unfinished batch, or nothing they sold is still held).\n"
          },
          "order_lines_affected": {
            "type": "integer",
            "description": "Order lines it re-costs, including the pending_lines_costed lines it costs for the first time."
          },
          "gross_profit_change": {
            "type": "string",
            "description": "The change to the gross profit of orders that already had totals (6 dp); negative when the cards cost more. Orders whose cost was pending are not in it: they have no earlier gross profit to change (pending_orders_costed).\n"
          },
          "pending_lines_costed": {
            "type": "integer",
            "description": "Lines sold while the batch was open (\"Cost pending\") that the finish settles: costed, partial, or uncosted when every copy was returned.\n"
          },
          "pending_orders_costed": {
            "type": "integer",
            "description": "Orders whose cogs_total and gross_profit the finish fills for the first time."
          },
          "cards": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/CostBatchFinishCard"
            }
          },
          "cards_truncated": {
            "type": "boolean",
            "description": "True when the batch holds more than the 500 cards listed."
          },
          "sealed_pool": {
            "type": "string",
            "description": "The cost of the opened sealed product (2 dp); the part of `total_cost` the cards share with it."
          },
          "extra_cost": {
            "type": "string",
            "description": "`total_cost` less `sealed_pool`: what was paid beyond the sealed product."
          },
          "sealed_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CostBatchSealedSource"
            },
            "description": "The batch's live openings, without the display fields."
          }
        }
      },
      "AssignImportToCostBatchRequest": {
        "type": "object",
        "required": [
          "cost_batch_uuid"
        ],
        "properties": {
          "cost_batch_uuid": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "CostBatchAssignment": {
        "type": "object",
        "required": [
          "job_uuid",
          "cost_batch_uuid",
          "lots_attached",
          "lots_created",
          "copies"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "cost_batch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "lots_attached": {
            "type": "integer",
            "description": "The import's own (priced) lots that joined the batch."
          },
          "lots_created": {
            "type": "integer",
            "description": "$0 provisional lots made for rows that had no price."
          },
          "copies": {
            "type": "integer"
          }
        }
      },
      "CogsMarginReportResponse": {
        "type": "object",
        "required": [
          "from",
          "to",
          "rows",
          "orders_awaiting_cost_batch",
          "totals"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CogsMarginRow"
            }
          },
          "orders_awaiting_cost_batch": {
            "type": "integer",
            "description": "Orders in the range with a line whose cost waits on a cost batch's finish. Their cogs_usd is null and they are left out of the totals.\n"
          },
          "totals": {
            "$ref": "#/components/schemas/CogsMarginTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/CogsMarginReportCurrency"
            }
          }
        }
      },
      "CogsMarginReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "orders_awaiting_cost_batch",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CogsMarginRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/CogsMarginTotals"
          },
          "orders_awaiting_cost_batch": {
            "type": "integer",
            "description": "This currency's share of the response's `orders_awaiting_cost_batch`."
          }
        }
      },
      "CogsMarginRow": {
        "type": "object",
        "required": [
          "order_uuid",
          "ordered_at",
          "marketplace",
          "revenue_usd",
          "cogs_usd",
          "gross_margin_usd",
          "gross_margin_pct",
          "hl_fee_usd",
          "cc_fee_usd",
          "platform_fee_usd",
          "total_fees_usd",
          "net_profit_usd",
          "cogs_pending"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ordered_at": {
            "type": "string",
            "format": "date-time"
          },
          "marketplace": {
            "type": "string",
            "description": "Marketplace the order came from (drives the fee config lookup)."
          },
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Order subtotal (product revenue, excludes shipping). Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cogs_usd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Total FIFO COGS for this order. Null when no cost data exists. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "gross_margin_usd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "revenue_usd minus cogs_usd. Null when cogs_usd is null. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "gross_margin_pct": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Gross margin as a percentage of revenue, rounded to 1 decimal. Null when cogs_usd is null."
          },
          "hl_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "HippoLink's marginal fee, derived from the store's billing tier. 0 on flat tiers. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cc_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Credit-card / processing fee from the store's configured formula (0 when unconfigured). Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "platform_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Marketplace commission. The provider-reported marketplace_fee_usd when present, otherwise the store's configured platform formula. Amount in the store's currency (the `_usd` suffix is historical).\n"
          },
          "total_fees_usd": {
            "type": "number",
            "format": "double",
            "description": "hl_fee_usd + cc_fee_usd + platform_fee_usd. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "fees_estimated": {
            "type": "boolean",
            "description": "False when this order's configured credit-card and platform fees were not estimated, because their flat fees and caps are in the store's currency and the order is in another (the platform has no exchange rate). Those two fees are then 0; a fee reported by the marketplace and the HL fee are still included. On a total, false when any order in it was not estimated.\n"
          },
          "net_profit_usd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Take-home: order total (incl. shipping) minus cogs_usd minus total_fees_usd. Null when cogs_usd is null. Amount in the store's currency (the `_usd` suffix is historical).\n"
          },
          "cogs_pending": {
            "type": "boolean",
            "description": "True when a line's cost waits on a cost batch's finish; cogs_usd is null until then.\n"
          }
        }
      },
      "CogsMarginTotals": {
        "type": "object",
        "required": [
          "revenue_usd",
          "cogs_usd",
          "gross_margin_usd",
          "gross_margin_pct",
          "hl_fee_usd",
          "cc_fee_usd",
          "platform_fee_usd",
          "total_fees_usd",
          "net_profit_usd"
        ],
        "description": "Aggregated totals computed only from orders that have COGS data (orders with null cogs_usd are excluded).\n",
        "properties": {
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cogs_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "gross_margin_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "gross_margin_pct": {
            "type": "number",
            "format": "double"
          },
          "hl_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cc_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "platform_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "total_fees_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "fees_estimated": {
            "type": "boolean",
            "description": "False when this order's configured credit-card and platform fees were not estimated, because their flat fees and caps are in the store's currency and the order is in another (the platform has no exchange rate). Those two fees are then 0; a fee reported by the marketplace and the HL fee are still included. On a total, false when any order in it was not estimated.\n"
          },
          "net_profit_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "ConnectionTestResult": {
        "description": "Result of a marketplace connectivity test, returned when credentials are validated on save or when an explicit connection test is triggered.\n",
        "type": "object",
        "required": [
          "platform",
          "ok",
          "error_code",
          "tested_at"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "manapool",
              "shopify",
              "square",
              "tcgplayer",
              "card_nexus",
              "misprint",
              "snapcaster",
              "whatnot",
              "sick_deals"
            ],
            "description": "The marketplace platform that was tested."
          },
          "ok": {
            "type": "boolean",
            "description": "Whether the connectivity test passed."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Machine-readable error code when ok is false. Null when the test succeeds. Values include auth_failed, timeout, rate_limited, invalid_credentials, endpoint_unreachable, TCGplayer only, no_seller_key (the session has no LastSeller, so the probe has nothing to check liveness against), and, ManaPool only, token_expired (an OAuth access token HippoLink's refresh schedule let lapse; ours to fix, not the store's), and, Misprint only, insufficient_scope (the key lacks read or write) and account_blocked (Misprint banned or paused the seller). A Misprint auth_failed also raises the MISPRINT_DISCONNECTED banner. For Snapcaster, auth_failed raises the SNAPCASTER_DISCONNECTED banner, account_blocked means Snapcaster suspended the seller, and a pass also refreshes the readiness fields and the SNAPCASTER_NOT_BROWSABLE alert. A Snapcaster pass also re-checks the account like connect does: subscription_excludes_orders (the subscription no longer includes orders) and currency_unsupported (the seller no longer sells in CAD) fail the test without flagging the connection.\n"
          },
          "message": {
            "type": "string",
            "description": "What the failure means and what to do next, written for the store owner. Present only when ok is false.\n"
          },
          "tested_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp when the connectivity test was executed."
          }
        }
      },
      "StoreFxRates": {
        "type": "object",
        "required": [
          "store_currency",
          "rates"
        ],
        "properties": {
          "store_currency": {
            "type": "string",
            "description": "The store's own currency (`USD`, `EUR`, `CAD` or `MXN`)."
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreFxRate"
            }
          }
        }
      },
      "StoreFxRate": {
        "type": "object",
        "required": [
          "currency",
          "display_base",
          "display_quote",
          "mode",
          "fixed_rate",
          "managed_rate",
          "managed_as_of",
          "applied_rate",
          "applied_at"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "The other currency of the pair."
          },
          "display_base": {
            "type": "string",
            "description": "The stronger currency of the pair; the row reads `1 display_base = rate display_quote`."
          },
          "display_quote": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "managed",
              "fixed"
            ]
          },
          "fixed_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The seller's rate in the display direction, up to 6 decimals; null when managed."
          },
          "managed_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "HippoLink's current rate in the display direction, 8 decimals; null when no rate has been fetched."
          },
          "managed_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the provider quoted the managed rate."
          },
          "applied_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rate pricing uses now, in the display direction; null before the first one is applied."
          },
          "applied_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "StoreReferralState": {
        "type": "object",
        "required": [
          "referral",
          "locked"
        ],
        "properties": {
          "referral": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreReferral"
              },
              {
                "type": "null"
              }
            ]
          },
          "locked": {
            "type": "boolean",
            "description": "True when the caller can't change it -- the store has had a paid subscription and the caller isn't a administrator."
          }
        }
      },
      "StoreReferral": {
        "type": "object",
        "required": [
          "partner",
          "partner_name",
          "source",
          "referred_at",
          "fee_free_channel",
          "fee_free_start",
          "fee_free_end"
        ],
        "properties": {
          "partner": {
            "type": "string",
            "enum": [
              "cardnexus",
              "mtgban"
            ]
          },
          "partner_name": {
            "type": "string",
            "description": "Display name, e.g. `CardNexus`."
          },
          "source": {
            "type": "string",
            "enum": [
              "signup",
              "onboarding",
              "admin"
            ],
            "description": "Where it was set -- `createStore`, the owner's `setStoreReferral`,'s."
          },
          "referred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the store was first attributed to a partner (kept across changes); partner commission counts from it."
          },
          "fee_free_channel": {
            "type": [
              "string",
              "null"
            ],
            "description": "The billing channel the partner's fee-free window prices at 0% (`CARD_NEXUS` for CardNexus), or null when the partner has none.\n"
          },
          "fee_free_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First UTC billing day of the fee-free window; null until the first paid subscription."
          },
          "fee_free_end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The day after the window's last day (exclusive)."
          }
        }
      },
      "ContactDetails": {
        "type": "object",
        "description": "Contact details for the store",
        "required": [
          "name",
          "email",
          "phone"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string"
          }
        }
      },
      "CreateDraftPurchaseRequest": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "contact_phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipping_address": {
            "type": [
              "object",
              "null"
            ],
            "description": "Partial address allowed; each field optional.",
            "properties": {
              "line1": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "line2": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postal_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "fulfillment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"mail_in\" or \"dropoff_<pickup_location_uuid>\"."
          },
          "payout_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Payment-method id from the store's buylist config."
          },
          "payout_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cash",
              "credit",
              null
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "description": "An offer holds at most 5,000 lines, the most the quote prices in one call. A longer array is rejected with 422.",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "condition",
                "quantity"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "condition": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                },
                "quoted_cash": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total). Omit both quoted_cash and quoted_credit (or send both as null) and the server prices the line from the store's live buylist rules, the same way the public storefront submit and the CSV import do; send either one and both are stored exactly as given. A SKU the rules decline is stored unpriced."
                },
                "quoted_credit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total). See quoted_cash for what an omitted pair means."
                },
                "override": {
                  "type": "boolean",
                  "default": false,
                  "description": "Buy this card although the ruleset declines it. Only a flagged line is checked: if the ruleset declines it and the caller lacks `overrideBuylistDecline`, the request fails with 403 `decline_override_forbidden`. Unflagged declined lines save normally (a draft commits nothing, and a store with no rules declines everything). On a replace of a draft's lines, a line that already carried an override on that draft (same SKU and condition) keeps it for any caller; making a new override still requires the permission."
                }
              }
            }
          }
        }
      },
      "Currency": {
        "type": "string",
        "enum": [
          "USD",
          "EUR",
          "CAD",
          "MXN"
        ]
      },
      "Region": {
        "type": "string",
        "enum": [
          "usa",
          "eu",
          "ca",
          "mx"
        ],
        "description": "A store's region overlay (#1150/#1151). Captured once at store creation and immutable after -- not accepted by the store PATCH endpoint. Sets the store's currency (usa->USD, eu->EUR, ca->CAD, mx->MXN) and the seller-facing grade vocabulary (Cardmarket/MKM for eu; the US grades for usa, ca and mx). Derived from the store's country at creation (CA -> `ca`, MX -> `mx`); a Canadian store created before `ca` existed stays `usa`.\n"
      },
      "GameId": {
        "type": "string",
        "enum": [
          "magic",
          "pokemon",
          "lorcana",
          "onepiece",
          "riftbound",
          "unionarena",
          "pokemonjp",
          "gundam",
          "starwars",
          "yugioh",
          "cyberpunk",
          "palworld",
          "digimon",
          "fleshblood",
          "cookierun",
          "sleeves",
          "sorcery",
          "wow",
          "deckboxes",
          "playmats",
          "binders",
          "colstorage",
          "counters",
          "vanguard",
          "dbsmasters",
          "dbsfusion",
          "weiss"
        ],
        "description": "TCG game family supported by the HippoLink platform. `pokemonjp` is Japanese-language Pokémon (TCGPlayer's separate \"Pokemon Japan\" category), distinct from the English `pokemon` family. `fleshblood` is Flesh and Blood and `cookierun` is CookieRun: Braverse. `sleeves` is not a card game: it is TCGplayer's Card Sleeves product line (Dragon Shield only). `deckboxes` and `playmats` are likewise not card games: they are TCGplayer's Deck Boxes and Playmats product lines (major supply brands only). `binders`, `colstorage` and `counters` are TCGplayer's Storage Albums, Collectible Storage and Life Counters product lines (every brand). `sorcery` is Sorcery: Contested Realm, `wow` is the World of Warcraft TCG, `vanguard` is Cardfight!! Vanguard, `dbsmasters` is Dragon Ball Super: Masters (the original Dragon Ball Super Card Game), `dbsfusion` is Dragon Ball Super: Fusion World, and `weiss` is Weiss Schwarz."
      },
      "DslAction": {
        "description": "The four rule outcomes a matched DSL rule can produce: SET PRICE (repricing), BUY / DECLINE (buylist), and SUPPRESS_LISTING (repricing). Mirrors rule_engine.ast.models.AnyAction exactly -- each variant's discriminator value is its Pydantic `type` literal.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/DslSetPriceAction"
          },
          {
            "$ref": "#/components/schemas/DslBuyAction"
          },
          {
            "$ref": "#/components/schemas/DslDeclineAction"
          },
          {
            "$ref": "#/components/schemas/DslSuppressListingAction"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "action": "#/components/schemas/DslSetPriceAction",
            "buy": "#/components/schemas/DslBuyAction",
            "decline": "#/components/schemas/DslDeclineAction",
            "suppress_listing": "#/components/schemas/DslSuppressListingAction"
          }
        }
      },
      "DslSetPriceAction": {
        "type": "object",
        "required": [
          "type",
          "set_price"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "action"
          },
          "set_price": {
            "$ref": "#/components/schemas/DslPriceValue"
          },
          "adjust": {
            "$ref": "#/components/schemas/DslAdjustment"
          },
          "price_limit": {
            "$ref": "#/components/schemas/DslPriceLimit"
          },
          "price_guard": {
            "$ref": "#/components/schemas/DslPriceGuard"
          },
          "rounding": {
            "$ref": "#/components/schemas/DslPriceRounding"
          },
          "max_per_day": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 24,
            "description": "The `N PER DAY` clause (#2642): the rule writes a given card in at most this many reprice jobs per UTC day. A card it already wrote N times today is held at its price, and later rules may not take it either. Whole number from 1 to 24; null or absent means no limit."
          }
        }
      },
      "DslBuyAction": {
        "type": "object",
        "required": [
          "type",
          "price_source",
          "cash"
        ],
        "description": "Buylist action: BUY <price_source> CASH <pct> (CREDIT <pct>)? limit? max_stock? conditions? round? cash/credit are percentages with no upper bound (any value > 0), compiled as multiplicative factors (base * pct / 100) -- CASH 200% pays twice the price source. max_stock is the per-rule stock target (a copy-count cap, distinct from the dollar price_limit); null means unlimited. conditions is the per-grade percentage table: a multiplier applied ON TOP OF cash/credit, the same factor for both (final = price_source * cash/100 * condition_percent/100). Unlike cash/credit, a grade factor is capped at 100% -- it is a discount off whatever cash/credit resolved to, and a grade worth more than the rule's own rate is expressed by raising cash. A grade absent from the table means the rule does NOT match that card at all -- evaluation falls through to the next rule by sequence_index, and an unmatched card is declined. Null means no table: every grade the IF admits is priced at cash/credit alone.",
        "properties": {
          "type": {
            "type": "string",
            "const": "buy"
          },
          "price_source": {
            "$ref": "#/components/schemas/DslPriceValue"
          },
          "cash": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0
          },
          "credit": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "exclusiveMinimum": 0
          },
          "price_limit": {
            "$ref": "#/components/schemas/DslPriceLimit"
          },
          "max_stock": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "conditions": {
            "type": [
              "array",
              "null"
            ],
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/DslConditionFactor"
            }
          },
          "rounding": {
            "$ref": "#/components/schemas/DslPriceRounding"
          }
        }
      },
      "DslConditionFactor": {
        "type": "object",
        "required": [
          "type",
          "condition",
          "percent"
        ],
        "description": "One '<condition>' <pct>% entry in a BUY action's CONDITIONS grade table (see DslBuyAction.conditions).",
        "properties": {
          "type": {
            "type": "string",
            "const": "condition_factor"
          },
          "condition": {
            "type": "string"
          },
          "percent": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0,
            "maximum": 100
          }
        }
      },
      "DslDeclineAction": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Buylist DECLINE action -- no offer; the matched rule emits NULL outputs. Optional `conditions` restricts the decline to the listed grades (a grade absent from the list means the rule does not match it).",
        "properties": {
          "type": {
            "type": "string",
            "const": "decline"
          },
          "conditions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DslSuppressListingAction": {
        "type": "object",
        "required": [
          "type",
          "marketplaces"
        ],
        "description": "Repricing action: DO NOT LIST ON marketplace1 (, marketplace2)*. Keeps a matched SKU off the listed marketplace(s) instead of writing a price. Buylist rejects this action outright.",
        "properties": {
          "type": {
            "type": "string",
            "const": "suppress_listing"
          },
          "marketplaces": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Marketplace"
            }
          }
        }
      },
      "DslAdjustDirection": {
        "type": "string",
        "enum": [
          "+",
          "-"
        ]
      },
      "DslAdjustment": {
        "type": "object",
        "required": [
          "type",
          "direction",
          "amount",
          "unit"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "adjust"
          },
          "direction": {
            "$ref": "#/components/schemas/DslAdjustDirection"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0
          },
          "unit": {
            "$ref": "#/components/schemas/DslAdjustUnit"
          }
        }
      },
      "DslAdjustUnit": {
        "type": "string",
        "enum": [
          "%",
          "$",
          "€"
        ]
      },
      "DslAggregateValue": {
        "type": "object",
        "required": [
          "type",
          "op",
          "values"
        ],
        "description": "A price aggregate over 2+ operands (\"best of 3\"). LOWEST/HIGHEST compile to SQL LEAST/GREATEST; MEDIAN/AVERAGE to the middle/mean value. NULL operands are ignored; the result is NULL only when every operand is NULL. An operand is a price var, a number, an arithmetic expression (#2050), or one more price function -- nesting is capped at a single level (#2263), so HIGHEST(AVERAGE(a, b, c), MARKET) is accepted and a third level is rejected.",
        "properties": {
          "type": {
            "type": "string",
            "const": "aggregate"
          },
          "op": {
            "type": "string",
            "enum": [
              "LOWEST",
              "HIGHEST",
              "MEDIAN",
              "AVERAGE"
            ]
          },
          "values": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/DslPriceValue"
            }
          }
        }
      },
      "DslArithmeticOperator": {
        "type": "string",
        "description": "Infix arithmetic operator. Four operators and no modulo: \"%\" is already a suffix unit token (ADJUST + 5 %, CASH 60 %), so an infix meaning for it would be ambiguous at the point the tokenizer cannot back out of.",
        "enum": [
          "+",
          "-",
          "*",
          "/"
        ]
      },
      "DslArithmeticValue": {
        "type": "object",
        "required": [
          "type",
          "operator",
          "left",
          "right"
        ],
        "description": "A binary arithmetic expression over two price values (#2050). Usable anywhere a price value appears -- either side of a comparison, an action's price source, and a function's operands.\nThe tree shape IS the precedence: the parser applies standard precedence (\"*\" and \"/\" bind tighter than \"+\" and \"-\") and left associativity before building this node, and the compiler parenthesizes every node, so nothing downstream re-derives it. There is no unary node -- a leading \"-\" is desugared, folding into a negative number literal or becoming 0 - x.\nNULL propagates as SQL propagates it: a missing price anywhere in the expression makes the whole expression NULL, so the rule does not match that SKU (never treated as $0). Division by a value that evaluates to zero yields NULL for that SKU rather than failing the run; division by a literal zero (a right operand of type \"number\" with value 0) is rejected with 422 on parse and on load of a stored rule.",
        "properties": {
          "type": {
            "type": "string",
            "const": "arithmetic"
          },
          "operator": {
            "$ref": "#/components/schemas/DslArithmeticOperator"
          },
          "left": {
            "$ref": "#/components/schemas/DslPriceValue"
          },
          "right": {
            "$ref": "#/components/schemas/DslPriceValue"
          }
        }
      },
      "DslAttributeCondition": {
        "type": "object",
        "required": [
          "type",
          "attribute",
          "operator",
          "values"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "attribute_condition"
          },
          "attribute": {
            "$ref": "#/components/schemas/DslAttributeName"
          },
          "operator": {
            "$ref": "#/components/schemas/DslAttributeOperator"
          },
          "values": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DslAttributeName": {
        "type": "string",
        "description": "Attribute a DSL condition can match on. This is the full set the repricing DSL supports; the buylist DSL uses every value except MARKETPLACE (buylist rules compile in projection mode, which has no marketplace context) and CONDITION (grade selection belongs on a BUY action's CONDITIONS table instead -- see DslBuyAction.conditions; a rule stored before this changed may still carry CONDITION in its IF and keeps working, but a new or re-authored buylist rule is rejected for using it there) -- see BuylistDslVariables.attribute_names. BORDER_COLOR and FRAME_EFFECT are Magic-only (sourced from MTGJSON's other_attributes); FRAME_EFFECT only supports the CONTAINS operator, since it matches against a JSONB array of effects rather than a single value.\n",
        "enum": [
          "CONDITION",
          "LANGUAGE",
          "FINISH",
          "RARITY",
          "SET_CODE",
          "PRODUCT_TYPE",
          "PRODUCT_NAME",
          "BORDER_COLOR",
          "FRAME_EFFECT",
          "MARKETPLACE"
        ]
      },
      "DslAttributeOperator": {
        "type": "string",
        "enum": [
          "IS",
          "IS_NOT",
          "IN",
          "NOT_IN",
          "CONTAINS"
        ]
      },
      "DslComparisonOperator": {
        "type": "string",
        "enum": [
          ">=",
          "<=",
          ">",
          "<",
          "="
        ]
      },
      "DslCondition": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DslLogicalCondition"
          },
          {
            "$ref": "#/components/schemas/DslPriceCondition"
          },
          {
            "$ref": "#/components/schemas/DslAttributeCondition"
          },
          {
            "$ref": "#/components/schemas/DslDateCondition"
          },
          {
            "$ref": "#/components/schemas/DslNullCheckCondition"
          },
          {
            "$ref": "#/components/schemas/DslHotlistCondition"
          },
          {
            "$ref": "#/components/schemas/DslTagCondition"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "logical": "#/components/schemas/DslLogicalCondition",
            "price_condition": "#/components/schemas/DslPriceCondition",
            "attribute_condition": "#/components/schemas/DslAttributeCondition",
            "date_condition": "#/components/schemas/DslDateCondition",
            "null_check": "#/components/schemas/DslNullCheckCondition",
            "hotlist": "#/components/schemas/DslHotlistCondition",
            "tag": "#/components/schemas/DslTagCondition"
          }
        }
      },
      "DslDateCondition": {
        "type": "object",
        "required": [
          "type",
          "left",
          "operator",
          "right"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "date_condition"
          },
          "left": {
            "$ref": "#/components/schemas/DslDateVar"
          },
          "operator": {
            "$ref": "#/components/schemas/DslComparisonOperator"
          },
          "right": {
            "$ref": "#/components/schemas/DslDateValue"
          }
        }
      },
      "DslDateLiteral": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "date"
          },
          "value": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "DslDateValue": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DslDateVar"
          },
          {
            "$ref": "#/components/schemas/DslDateLiteral"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "date_var": "#/components/schemas/DslDateVar",
            "date": "#/components/schemas/DslDateLiteral"
          }
        }
      },
      "DslDateVar": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "date_var"
          },
          "name": {
            "$ref": "#/components/schemas/DslDateVarName"
          }
        }
      },
      "DslDateVarName": {
        "type": "string",
        "description": "Date variable a DSL condition can compare. OLDEST_COPY_INSERTION_DATE dates the oldest copy of the card the store STILL HOLDS, first-in-first-out: two copies taken in a month apart read as the older one until the older is sold, at which point the card reads as the newer. This is the full set the repricing DSL supports; the buylist DSL uses every value except OLDEST_COPY_INSERTION_DATE and LAST_PRICE_CHANGE_DATE, both of which are facts about stock the store already holds -- a buylist quote runs over whatever card a customer brings in, so both would resolve to the same fallback for nearly the whole catalog. See BuylistDslVariables.date_variables.\n",
        "enum": [
          "OLDEST_COPY_INSERTION_DATE",
          "NEWEST_COPY_INSERTION_DATE",
          "LATEST_COPY_SOLD_DATE",
          "LAST_COPY_BUY_DATE",
          "LAST_PRICE_CHANGE_DATE",
          "PRODUCT_RELEASE_DATE",
          "SET_RELEASE_DATE",
          "TODAY",
          "YESTERDAY",
          "THREE_DAYS_AGO",
          "ONE_WEEK_AGO",
          "TWO_WEEKS_AGO",
          "THREE_WEEKS_AGO",
          "FOUR_WEEKS_AGO",
          "TWO_MONTHS_AGO",
          "THREE_MONTHS_AGO",
          "FOUR_MONTHS_AGO",
          "FIVE_MONTHS_AGO",
          "SIX_MONTHS_AGO"
        ]
      },
      "DslFirstDefinedValue": {
        "type": "object",
        "required": [
          "type",
          "values"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "first_defined"
          },
          "values": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/DslPriceValue"
            }
          }
        }
      },
      "DslLogicalCondition": {
        "type": "object",
        "required": [
          "type",
          "operator",
          "terms"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "logical"
          },
          "operator": {
            "$ref": "#/components/schemas/DslLogicalOperator"
          },
          "terms": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/DslCondition"
            }
          }
        }
      },
      "DslLogicalOperator": {
        "type": "string",
        "enum": [
          "AND",
          "OR"
        ]
      },
      "StoreItemGrading": {
        "type": "object",
        "required": [
          "grader_code",
          "grader_name",
          "grade_code",
          "grade_label",
          "cert_number"
        ],
        "properties": {
          "grader_code": {
            "type": "string"
          },
          "grader_name": {
            "type": "string"
          },
          "grade_code": {
            "type": "string"
          },
          "grade_label": {
            "type": "string"
          },
          "cert_number": {
            "type": "string"
          },
          "cert_lookup_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "subgrades": {
            "type": [
              "object",
              "null"
            ],
            "description": "Keys from centering, corners, edges, surface; values like \"9.5\".",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "StoreItemImage": {
        "type": "object",
        "required": [
          "image_uuid",
          "position",
          "role",
          "status"
        ],
        "properties": {
          "image_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "position": {
            "type": "integer"
          },
          "role": {
            "type": "string",
            "enum": [
              "front",
              "back",
              "extra"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "failed"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          },
          "urls": {
            "type": [
              "object",
              "null"
            ],
            "description": "CDN URLs keyed `thumb.webp`, `card.webp`, `card.jpg` and `full.jpg`; null until the photo is ready.\n",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "StoreItemImageUpload": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StoreItemImage"
          },
          {
            "type": "object",
            "required": [
              "upload_url",
              "expires_in"
            ],
            "properties": {
              "upload_url": {
                "type": "string"
              },
              "expires_in": {
                "type": "integer"
              }
            }
          }
        ]
      },
      "StoreItemSummary": {
        "type": "object",
        "required": [
          "store_item_uuid",
          "kind",
          "status",
          "name",
          "game",
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "quantity"
        ],
        "properties": {
          "store_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "graded",
              "custom"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "name": {
            "type": "string"
          },
          "game": {
            "type": "string"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "base_tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "base_tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The product of the base card, whose detail page shows this item (#3528)."
          },
          "graded": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreItemGrading"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "retail_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The item's sell price; null when unpriced."
          },
          "price_locked": {
            "type": "boolean"
          },
          "locations": {
            "type": "array",
            "description": "The bins holding the item, by breadcrumb.",
            "items": {
              "type": "object",
              "required": [
                "location_uuid",
                "full_path",
                "quantity"
              ],
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "full_path": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                }
              }
            }
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "StoreItemDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StoreItemSummary"
          },
          {
            "type": "object",
            "required": [
              "attributes",
              "images"
            ],
            "properties": {
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "attributes": {
                "type": "object",
                "additionalProperties": true
              },
              "archived_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "images": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoreItemImage"
                }
              }
            }
          }
        ]
      },
      "StoreItemCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StoreItemDetail"
          },
          {
            "type": "object",
            "properties": {
              "placement": {
                "$ref": "#/components/schemas/IntakePlacement",
                "description": "Where the slab went. Present only on a create that used `absolute_chaos`."
              }
            }
          }
        ]
      },
      "StoreItemList": {
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreItemSummary"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "StoreItemAttributes": {
        "type": "object",
        "description": "Optional facts about a slab beyond its grade.",
        "additionalProperties": false,
        "properties": {
          "autograph_grade": {
            "type": "string"
          },
          "label_variant": {
            "type": "string"
          },
          "qualifiers": {
            "type": "array",
            "description": "PSA-style qualifiers such as OC, ST, PD, MC, MK.",
            "items": {
              "type": "string"
            }
          },
          "population": {
            "type": "integer",
            "minimum": 0
          },
          "grader_name_other": {
            "type": "string",
            "description": "The grader's name when grader_code is OTHER."
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          }
        }
      },
      "CreateStoreItemRequest": {
        "type": "object",
        "required": [
          "base_tcgplayer_sku_id",
          "graded",
          "retail_price",
          "unit_cost"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "graded"
            ],
            "default": "graded"
          },
          "base_tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The raw card the slab holds."
          },
          "graded": {
            "type": "object",
            "required": [
              "grader_code",
              "grade_code",
              "cert_number"
            ],
            "properties": {
              "grader_code": {
                "type": "string"
              },
              "grade_code": {
                "type": "string"
              },
              "cert_number": {
                "type": "string",
                "maxLength": 40
              },
              "subgrades": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              }
            }
          },
          "retail_price": {
            "type": "number",
            "minimum": 0.01
          },
          "unit_cost": {
            "type": "number",
            "minimum": 0
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The bin to file the slab into. Exactly one of `location_uuid` or `absolute_chaos` is required (422 otherwise)."
          },
          "absolute_chaos": {
            "$ref": "#/components/schemas/IntakeAbsoluteChaosTarget",
            "description": "File the slab into an Absolute Chaos container instead of a named bin. Exactly one of `location_uuid` or `absolute_chaos` is required. Needs the `locations.manage` permission (403), since it may create a bin. Not allowed beside `insert_position` (422). The container being filled by another request answers 409 `absolute_chaos_container_busy`. With `bin_uuid`, the slab goes at the back of that bin; a full bin answers 422 `absolute_chaos_bin_full`.\n"
          },
          "name": {
            "type": "string",
            "maxLength": 300,
            "description": "Defaults to \"<card> - <set> <number> - <grader> <grade>\"."
          },
          "description": {
            "type": "string"
          },
          "attributes": {
            "$ref": "#/components/schemas/StoreItemAttributes"
          },
          "insert_position": {
            "type": "object",
            "additionalProperties": true,
            "description": "Where the slab lands in the bin, as for intake."
          }
        }
      },
      "UpdateStoreItemRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 300
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "attributes": {
            "$ref": "#/components/schemas/StoreItemAttributes"
          },
          "grade_code": {
            "type": "string"
          },
          "cert_number": {
            "type": "string",
            "maxLength": 40
          },
          "subgrades": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "number"
            }
          },
          "archived": {
            "type": "boolean",
            "description": "`true` archives the item (hides it from the default list and refuses further intake; 409 `store_item_has_stock` while any copy is on hand), `false` returns it to active.\n"
          }
        }
      },
      "StoreTag": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "kind",
          "read_only"
        ],
        "description": "One entry in a store's tag dictionary. `kind` is `custom` for a store-authored tag and `system` for one the platform owns.\n\nA `system` tag is one of two things. A *derived* one (`no-repricing-retail`, `no-repricing-buylist`) reports `read_only: true` and cannot be written here at all. A *behavioral* one (`do-not-sell`, `do-not-buy`) is an ordinary assignment a store makes and removes like any other tag -- the difference is that the platform reads the slug and acts on it. Both are listed in every store without being seeded per store, so a behavioral tag can appear here with `usage_count: 0` and no `created_at` before anything uses it.\n",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The stable lowercase handle. This is what a rule's `TAG` condition matches and what `?tags=` / `tag:` filter on -- never the display name, so a rename changes no rule's behavior.\n"
          },
          "name": {
            "type": "string",
            "description": "Display label. Freely editable."
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "system",
              "custom"
            ]
          },
          "read_only": {
            "type": "boolean",
            "description": "True for a derived system tag. Its membership is computed from state another table owns (`no-repricing-retail` from the retail price lock, `no-repricing-buylist` from the buylist offer lock), so it appears in chips, filters and search but cannot be written here -- set it through the corresponding lock endpoint instead.\n"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a derived tag, why it is read-only and what to use instead. For a behavioral one (`do-not-sell`, `do-not-buy`), what applying it does. Null for a store-authored tag.\n"
          },
          "usage_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Assignments this tag has. Null for a derived tag, whose membership is a live predicate rather than a set of rows.\n"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "StoreTagAssignmentEntry": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "kind",
          "read_only"
        ],
        "description": "One tag a card carries, with the grain it was assigned at.",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "system",
              "custom"
            ]
          },
          "product_grain": {
            "type": "boolean",
            "description": "True when the tag is on the whole product (every variant carries it), false when it is on this specific SKU.\n"
          },
          "read_only": {
            "type": "boolean"
          }
        }
      },
      "StoreTagAssignmentInput": {
        "type": "object",
        "required": [
          "slug",
          "tcgplayer_product_id"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "The slug of a tag this store already has, or one of the behavioral system slugs (`do-not-sell`, `do-not-buy`), whose dictionary row is created on first use. A slug that names nothing is a 422; derived and reserved slugs are refused.\n"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "The card. Resolved against `global_identifiers`; an id the catalog does not know is a 422 rather than an orphaned row.\n"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "One condition/language/finish variant. Omit or send null to tag the whole product.\n"
          }
        }
      },
      "DslTagCondition": {
        "type": "object",
        "required": [
          "type",
          "operator",
          "values"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "tag"
          },
          "operator": {
            "$ref": "#/components/schemas/DslAttributeOperator",
            "description": "IS / IN match a card carrying any of the slugs; IS_NOT / NOT_IN match one carrying none of them. CONTAINS is rejected — a tag is matched whole, by slug."
          },
          "values": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "Tag **slugs**, lowercase, never display names. A rule keeps matching when a tag is renamed, which is why the slug cannot be changed while a rule references it."
          }
        },
        "description": "Matches whether the card carries one of the store's tags (`store_tag_assignments`), at either product or SKU grain — a SKU carries its own tags plus the ones assigned to its whole product. Available to both repricing and buylist rules. Reserved slugs (`hotlist`, `no-repricing-retail`, `no-repricing-buylist`, `do-not-sell`, `do-not-buy`) are rejected at parse time: their state lives elsewhere, so a rule naming one would compile cleanly and match nothing."
      },
      "DslHotlistCondition": {
        "type": "object",
        "required": [
          "type",
          "is_hotlisted"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "hotlist"
          },
          "is_hotlisted": {
            "type": "boolean",
            "description": "true = card is on the store's hotlist (HOTLIST), false = NOT HOTLIST. Matches the store's `hotlist` tag for the SKU's product."
          }
        },
        "description": "Matches whether the store has flagged the card as hotlist (set via the inventory-details hotlist toggle). Buylist-only condition."
      },
      "DslNullCheckCondition": {
        "type": "object",
        "required": [
          "type",
          "variable",
          "is_null"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "null_check"
          },
          "variable": {
            "$ref": "#/components/schemas/DslPriceVarName"
          },
          "is_null": {
            "type": "boolean",
            "description": "true = IS_NULL, false = IS_NOT_NULL"
          }
        }
      },
      "DslNumberLiteral": {
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "number"
          },
          "value": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DslParseRequest": {
        "type": "object",
        "required": [
          "rule"
        ],
        "properties": {
          "rule": {
            "description": "A single DSL rule string to parse, or an array of DSL rule strings to parse as a batch. A single string returns a `DslRuleAst`; an array returns a `DslBatchParseResult` with one entry per rule, partial success on individual parse failures.\n",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 250,
                "items": {
                  "type": "string"
                }
              }
            ]
          }
        },
        "example": {
          "rule": "IF TCGPLAYER_LOW_NEAR_MINT >= 10.00 AND CONDITION IS 'Near Mint' THEN SET PRICE TCGPLAYER_LOW_NEAR_MINT ADJUST -10%"
        }
      },
      "DslParseResultItem": {
        "type": "object",
        "required": [
          "sequence_index",
          "rule"
        ],
        "properties": {
          "sequence_index": {
            "type": "integer",
            "description": "1-based position of the rule in the submitted array"
          },
          "rule": {
            "type": "string",
            "description": "The DSL rule string that was parsed"
          },
          "ast": {
            "$ref": "#/components/schemas/DslRuleAst"
          },
          "error": {
            "type": "string",
            "description": "Present when this rule failed to parse; `ast` is absent in that case"
          },
          "line": {
            "type": "integer",
            "description": "1-based source line of the parse error (absent for a semantic error)"
          },
          "column": {
            "type": "integer",
            "description": "1-based source column of the parse error (absent for a semantic error)"
          },
          "validation_errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "description": "One entry per distinct cause, present on a multi-field constraint violation"
          }
        }
      },
      "DslBatchParseResult": {
        "type": "object",
        "required": [
          "type",
          "results"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "batch_result"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslParseResultItem"
            }
          }
        }
      },
      "DslPriceCondition": {
        "type": "object",
        "required": [
          "type",
          "left",
          "operator",
          "right"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "price_condition"
          },
          "left": {
            "$ref": "#/components/schemas/DslPriceValue"
          },
          "operator": {
            "$ref": "#/components/schemas/DslComparisonOperator"
          },
          "right": {
            "$ref": "#/components/schemas/DslPriceValue"
          }
        }
      },
      "DslPriceGuard": {
        "type": "object",
        "description": "At least one of max_increase or max_decrease must be set.",
        "minProperties": 1,
        "properties": {
          "max_increase": {
            "$ref": "#/components/schemas/DslPriceGuardBound"
          },
          "max_decrease": {
            "$ref": "#/components/schemas/DslPriceGuardBound"
          }
        }
      },
      "DslPriceGuardBound": {
        "type": "object",
        "required": [
          "amount",
          "unit"
        ],
        "properties": {
          "amount": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0
          },
          "unit": {
            "$ref": "#/components/schemas/DslAdjustUnit"
          }
        }
      },
      "DslPriceLimit": {
        "type": "object",
        "description": "At least one of min or max must be set. When both are present, min must be <= max.\n",
        "minProperties": 1,
        "properties": {
          "min": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "max": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "DslPriceRounding": {
        "type": "object",
        "required": [
          "increment",
          "direction"
        ],
        "description": "Price rounding configuration applied as the final step after all other calculations.\n",
        "properties": {
          "increment": {
            "$ref": "#/components/schemas/DslRoundingIncrement"
          },
          "direction": {
            "$ref": "#/components/schemas/DslRoundingDirection"
          }
        }
      },
      "DslPriceValue": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DslPriceVar"
          },
          {
            "$ref": "#/components/schemas/DslNumberLiteral"
          },
          {
            "$ref": "#/components/schemas/DslFirstDefinedValue"
          },
          {
            "$ref": "#/components/schemas/DslAggregateValue"
          },
          {
            "$ref": "#/components/schemas/DslArithmeticValue"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "price_var": "#/components/schemas/DslPriceVar",
            "number": "#/components/schemas/DslNumberLiteral",
            "first_defined": "#/components/schemas/DslFirstDefinedValue",
            "aggregate": "#/components/schemas/DslAggregateValue",
            "arithmetic": "#/components/schemas/DslArithmeticValue"
          }
        }
      },
      "DslPriceVar": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "price_var"
          },
          "name": {
            "$ref": "#/components/schemas/DslPriceVarName"
          }
        }
      },
      "DslPriceVarName": {
        "type": "string",
        "enum": [
          "CARDKINGDOM_RETAIL_NEAR_MINT",
          "CARDKINGDOM_RETAIL_LIGHTLY_PLAYED",
          "CARDKINGDOM_RETAIL_QUANTITY_NEAR_MINT",
          "CARDKINGDOM_RETAIL_QUANTITY_LIGHTLY_PLAYED",
          "CARDKINGDOM_BUYLIST_NEAR_MINT",
          "CARDKINGDOM_BUYLIST_QUANTITY_NEAR_MINT",
          "TCGPLAYER_LOW_NEAR_MINT",
          "TCGPLAYER_LOW_LIGHTLY_PLAYED",
          "TCGPLAYER_LOW_WITH_SHIPPING_NEAR_MINT",
          "TCGPLAYER_LOW_WITH_SHIPPING_LIGHTLY_PLAYED",
          "TCGPLAYER_MARKET_NEAR_MINT",
          "TCGPLAYER_MARKET_LIGHTLY_PLAYED",
          "TCGPLAYER_DIRECT_LOW_NEAR_MINT",
          "TCGPLAYER_DIRECT_LOW_LIGHTLY_PLAYED",
          "TCGPLAYER_RETAIL_QUANTITY_NEAR_MINT",
          "TCGPLAYER_RETAIL_QUANTITY_LIGHTLY_PLAYED",
          "TCGPLAYER_DELUXE_LOW_NEAR_MINT",
          "TCGPLAYER_DELUXE_LOW_LIGHTLY_PLAYED",
          "MANAPOOL_LOW_NEAR_MINT",
          "MANAPOOL_LOW_LIGHTLY_PLAYED",
          "MANAPOOL_MARKET",
          "MANAPOOL_RETAIL_QUANTITY_NEAR_MINT",
          "MANAPOOL_RETAIL_QUANTITY_LIGHTLY_PLAYED",
          "CARDTRADER_LOW_NEAR_MINT",
          "CARDTRADER_LOW_LIGHTLY_PLAYED",
          "CARDTRADER_MEDIAN_NEAR_MINT",
          "CARDTRADER_MEDIAN_LIGHTLY_PLAYED",
          "CARDTRADER_RETAIL_QUANTITY_NEAR_MINT",
          "CARDTRADER_RETAIL_QUANTITY_LIGHTLY_PLAYED",
          "CARDKINGDOM_RETAIL_UNOPENED",
          "CARDKINGDOM_RETAIL_MODERATELY_PLAYED",
          "CARDKINGDOM_RETAIL_HEAVILY_PLAYED",
          "CARDKINGDOM_RETAIL_QUANTITY_UNOPENED",
          "CARDKINGDOM_RETAIL_QUANTITY_MODERATELY_PLAYED",
          "CARDKINGDOM_RETAIL_QUANTITY_HEAVILY_PLAYED",
          "CARDKINGDOM_BUYLIST_UNOPENED",
          "CARDKINGDOM_BUYLIST_QUANTITY_UNOPENED",
          "TCGPLAYER_LOW_UNOPENED",
          "TCGPLAYER_LOW_MODERATELY_PLAYED",
          "TCGPLAYER_LOW_HEAVILY_PLAYED",
          "TCGPLAYER_LOW_DAMAGED",
          "TCGPLAYER_LOW_WITH_SHIPPING_UNOPENED",
          "TCGPLAYER_LOW_WITH_SHIPPING_MODERATELY_PLAYED",
          "TCGPLAYER_LOW_WITH_SHIPPING_HEAVILY_PLAYED",
          "TCGPLAYER_LOW_WITH_SHIPPING_DAMAGED",
          "TCGPLAYER_MARKET_UNOPENED",
          "TCGPLAYER_MARKET_MODERATELY_PLAYED",
          "TCGPLAYER_MARKET_HEAVILY_PLAYED",
          "TCGPLAYER_MARKET_DAMAGED",
          "TCGPLAYER_DIRECT_LOW_UNOPENED",
          "TCGPLAYER_DIRECT_LOW_MODERATELY_PLAYED",
          "TCGPLAYER_DIRECT_LOW_HEAVILY_PLAYED",
          "TCGPLAYER_DIRECT_LOW_DAMAGED",
          "TCGPLAYER_DELUXE_LOW_UNOPENED",
          "MANAPOOL_LOW_UNOPENED",
          "MANAPOOL_MARKET_UNOPENED",
          "CARDTRADER_LOW_UNOPENED",
          "CARDTRADER_LOW_MODERATELY_PLAYED",
          "CARDTRADER_LOW_HEAVILY_PLAYED",
          "CARDTRADER_LOW_DAMAGED",
          "CARDTRADER_MEDIAN_UNOPENED",
          "CARDTRADER_MEDIAN_MODERATELY_PLAYED",
          "CARDTRADER_MEDIAN_HEAVILY_PLAYED",
          "CARDTRADER_MEDIAN_DAMAGED",
          "CARDKINGDOM_RETAIL",
          "CARDKINGDOM_RETAIL_QUANTITY",
          "CARDKINGDOM_BUYLIST",
          "CARDKINGDOM_BUYLIST_QUANTITY",
          "TCGPLAYER_LOW",
          "TCGPLAYER_LOW_WITH_SHIPPING",
          "TCGPLAYER_MARKET",
          "TCGPLAYER_DIRECT_LOW",
          "TCGPLAYER_RETAIL_QUANTITY",
          "TCGPLAYER_DELUXE_LOW",
          "MANAPOOL_LOW",
          "MANAPOOL_RETAIL_QUANTITY",
          "CARDTRADER_LOW",
          "CARDTRADER_MEDIAN",
          "CARDTRADER_RETAIL_QUANTITY",
          "CURRENT_PRICE",
          "CURRENT_QUANTITY",
          "UNITS_SOLD_LAST_7_DAYS",
          "UNITS_SOLD_LAST_30_DAYS",
          "SELL_THROUGH_30_DAYS",
          "AVG_SALE_PRICE_LAST_7_DAYS",
          "AVG_SALE_PRICE_LAST_30_DAYS",
          "LAST_SALE_PRICE",
          "FX_USD",
          "FX_CAD",
          "FX_EUR",
          "FX_MXN"
        ]
      },
      "DslRoundingDirection": {
        "type": "string",
        "description": "Which direction to round the price.",
        "enum": [
          "up",
          "down",
          "nearest"
        ]
      },
      "DslRoundingIncrement": {
        "type": "string",
        "description": "The increment to round the price to. \\\"penny\\\" rounds to whole cents, which is what a BUY rule usually wants: buylist cash/credit offers are stored to four decimal places, so an ordinary percentage of a price source lands on fractions of a cent. \\\"charm\\\" rounds to the nearest $0.50 then subtracts $0.01, producing prices ending in .49 or .99.\n",
        "enum": [
          "penny",
          "nickel",
          "dime",
          "quarter",
          "half_dollar",
          "dollar",
          "charm"
        ]
      },
      "DslRuleAst": {
        "type": "object",
        "required": [
          "type",
          "if",
          "then"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "rule"
          },
          "if": {
            "$ref": "#/components/schemas/DslCondition"
          },
          "then": {
            "$ref": "#/components/schemas/DslAction"
          }
        }
      },
      "DslVariableKind": {
        "type": "string",
        "description": "Unit class of a DSL price variable. \"price\" is a dollar amount, \"quantity\" is a count of copies available, \"velocity\" is a sales-rate count or percentage over a trailing window, and \"rate\" is an exchange rate (the FX_ variables: one unit of a currency in the store's currency).\n",
        "enum": [
          "price",
          "quantity",
          "velocity",
          "rate"
        ]
      },
      "DslVariables": {
        "type": "object",
        "required": [
          "price_variables",
          "price_variable_kinds",
          "price_functions",
          "arithmetic_operators",
          "date_variables",
          "attribute_names",
          "attribute_operators",
          "comparison_operators",
          "logical_operators",
          "adjust_directions",
          "adjust_units",
          "language_map",
          "condition_values",
          "finish_values",
          "rarity_values",
          "product_type_values",
          "marketplace_values",
          "suppress_marketplace_values",
          "max_per_day"
        ],
        "properties": {
          "price_variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslPriceVarName"
            }
          },
          "price_variable_kinds": {
            "type": "object",
            "description": "Maps every DslPriceVarName value to its unit kind, so the rule builder can group variables and understand which comparisons are meaningful.\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/DslVariableKind"
            }
          },
          "price_functions": {
            "type": "array",
            "description": "Price functions the rule-builder can wrap operands in. FIRST_DEFINED is a first-non-null fallback; LOWEST/HIGHEST/MEDIAN/AVERAGE are \"best of N\" aggregates over 2+ operands. An operand may be one more function -- nesting is capped at a single level (#2263).\n",
            "items": {
              "type": "string"
            },
            "example": [
              "FIRST_DEFINED",
              "LOWEST",
              "HIGHEST",
              "MEDIAN",
              "AVERAGE"
            ]
          },
          "arithmetic_operators": {
            "type": "array",
            "description": "Infix arithmetic operators usable anywhere a price value appears -- both sides of a comparison, an action's price source, and a function's operands. Standard precedence (\"*\" and \"/\" bind tighter than \"+\" and \"-\"), left-associative, parentheses to override. A leading \"-\" negates. Division by a variable that evaluates to zero yields no value for that SKU rather than an error; division by a literal zero is rejected.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "+",
              "-",
              "*",
              "/"
            ]
          },
          "date_variables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslDateVarName"
            }
          },
          "attribute_names": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslAttributeName"
            }
          },
          "attribute_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslAttributeOperator"
            }
          },
          "comparison_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslComparisonOperator"
            }
          },
          "logical_operators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslLogicalOperator"
            }
          },
          "adjust_directions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslAdjustDirection"
            }
          },
          "adjust_units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DslAdjustUnit"
            }
          },
          "language_map": {
            "type": "object",
            "description": "Mapping of each supported language to its display label. Keys are the canonical language names stored on `global_identifiers.language` — the value a rule's LANGUAGE condition is matched against verbatim — so the client both stores and displays the key.\n",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "English": "English",
              "Chinese (S)": "Chinese (S)",
              "Chinese (T)": "Chinese (T)",
              "French": "French",
              "German": "German",
              "Italian": "Italian",
              "Japanese": "Japanese",
              "Korean": "Korean",
              "Portuguese": "Portuguese",
              "Portuguese (Brazil)": "Portuguese (Brazil)",
              "Russian": "Russian",
              "Spanish": "Spanish"
            }
          },
          "condition_values": {
            "type": "array",
            "description": "Valid values for the CONDITION attribute in repricing rules, in the `region` query parameter's vocabulary: the stored US 6 for `usa`, the 7 Cardmarket/MKM grades plus `Unopened` for `eu`. An EU label is translated to its stored US condition when the rule is saved (#1152); the stored vocabulary is always the US 6 (#1150/#1151).\n",
            "items": {
              "type": "string"
            },
            "example": [
              "Near Mint",
              "Lightly Played",
              "Moderately Played",
              "Heavily Played",
              "Damaged"
            ]
          },
          "finish_values": {
            "type": "array",
            "description": "Valid values for the FINISH attribute in repricing rules",
            "items": {
              "type": "string"
            },
            "example": [
              "FOIL",
              "NON_FOIL",
              "ETCHED"
            ]
          },
          "rarity_values": {
            "type": "array",
            "description": "Valid values for the RARITY attribute in repricing rules",
            "items": {
              "type": "string"
            },
            "example": [
              "COMMON",
              "UNCOMMON",
              "RARE",
              "MYTHIC"
            ]
          },
          "product_type_values": {
            "type": "array",
            "description": "Valid values for the PRODUCT_TYPE attribute in repricing rules",
            "items": {
              "type": "string"
            },
            "example": [
              "card",
              "token",
              "sealed"
            ]
          },
          "border_color_values": {
            "type": "array",
            "description": "Valid values for the BORDER_COLOR attribute in repricing rules (Magic only). Sourced from MTGJSON's `other_attributes.border_color`.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "black",
              "borderless",
              "gold",
              "silver",
              "white"
            ]
          },
          "frame_effect_values": {
            "type": "array",
            "description": "Discovery values for the FRAME_EFFECT attribute's `CONTAINS` operator (Magic only) -- a curated subset of MTGJSON's `other_attributes.frame_effects` worth offering in a dropdown, not a closed vocabulary: any raw `frame_effects` value can still be matched by hand-authoring `FRAME_EFFECT CONTAINS '<value>'`.\n",
            "items": {
              "type": "string"
            },
            "example": [
              "showcase",
              "extendedart",
              "shatteredglass"
            ]
          },
          "marketplace_values": {
            "type": "array",
            "description": "Valid values for the MARKETPLACE condition in sell/reprice rules. The sell-rule builder should source its marketplace picker from this list rather than hardcoding it.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceMarketplace"
            },
            "example": [
              "TCGPLAYER",
              "TCGPLAYER_DIRECT",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "KIOSK",
              "EBAY"
            ]
          },
          "suppress_marketplace_values": {
            "type": "array",
            "description": "Valid values for a DO NOT LIST ON action's marketplace list. Same vocabulary as `marketplace_values` minus TCGPLAYER_DIRECT, which suppression does not support -- TCGplayer Direct listings are the seller's same TCGplayer inventory, not a separate listing. The DO NOT LIST ON rule builder should source its marketplace picker from this list, not `marketplace_values`. `KIOSK` is included and enforced: a suppressed SKU leaves the kiosk browse projection and quotes as unavailable.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceMarketplace"
            },
            "example": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "KIOSK",
              "EBAY"
            ]
          },
          "max_per_day": {
            "type": "integer",
            "description": "Largest N a SET PRICE action's `N PER DAY` clause accepts (#2642). The rule builder offers 1 through this value.\n",
            "example": 24
          }
        }
      },
      "EasyPostConnectionStatus": {
        "type": "object",
        "required": [
          "connected"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "webhook_configured": {
            "type": "boolean",
            "description": "Whether a per-store EasyPost webhook secret is stored, enabling inbound tracking webhooks at /webhooks/easypost/{token}.\n"
          },
          "verified": {
            "type": "boolean",
            "description": "Only on a successful key PUT. True when the provider accepted the key; false when the provider could not be reached (the key is saved anyway) and `warning` says so.\n"
          },
          "warning": {
            "$ref": "#/components/schemas/CarrierKeyWarning"
          }
        }
      },
      "ShippoConnectionStatus": {
        "type": "object",
        "required": [
          "connected"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "test_mode": {
            "type": "boolean",
            "description": "True when the stored token is a Shippo test token (`shippo_test_...`). Labels bought with one are not real postage.\n"
          },
          "verified": {
            "type": "boolean",
            "description": "Only on a successful token PUT. True when Shippo accepted the token; false when Shippo could not be reached (the token is saved anyway) and `warning` says so.\n"
          },
          "warning": {
            "$ref": "#/components/schemas/CarrierKeyWarning"
          }
        }
      },
      "ClickShipPaymentMethod": {
        "type": "object",
        "required": [
          "id",
          "type",
          "label"
        ],
        "description": "A way the store's Freightcom account pays for ClickShip labels (#4081), as `GET /finance/payment-methods` lists it. A Prepaid account cannot book with a card even though the card is still listed, so the store chooses which one labels use.\n",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Freightcom's type: `credit-card`, `net-terms` or `prepaid`. Any other value Freightcom adds is passed through as it comes.\n",
            "example": "prepaid"
          },
          "label": {
            "type": "string",
            "description": "The card's label as set in the Freightcom portal, or the system's name for the method. May be empty."
          }
        }
      },
      "ClickShipConnectionStatus": {
        "type": "object",
        "required": [
          "connected",
          "payment_method"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "payment_method": {
            "description": "The payment method ClickShip labels are bought with, or null until the store chooses one (a key with a single method has it chosen for it). Labels cannot be bought while null.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ClickShipPaymentMethod"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClickShipPaymentMethod"
            },
            "description": "Only on a key PUT: the key's payment methods, so the store can choose one straight away. Empty when Freightcom could not be reached.\n"
          },
          "verified": {
            "type": "boolean",
            "description": "Only on a key PUT. True when Freightcom accepted the key; false when it could not be reached (the key is saved anyway) and `warning` says so.\n"
          },
          "warning": {
            "$ref": "#/components/schemas/CarrierKeyWarning"
          }
        }
      },
      "CarrierKeyWarning": {
        "type": "object",
        "required": [
          "code",
          "detail"
        ],
        "description": "Returned on a carrier key PUT that was saved without the provider confirming it (`<carrier>_unverified`). Show `detail` to the user.\n",
        "properties": {
          "code": {
            "type": "string",
            "example": "easypost_unverified"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ShipStationConnectionStatus": {
        "type": "object",
        "required": [
          "connected"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "service_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "description": "Store-configured allow-list of ShipStation service_codes to rate-shop (#1533). Empty means unfiltered — every connected carrier's every service, same as before this field existed.\n"
          },
          "verified": {
            "type": "boolean",
            "description": "Only on a successful key PUT. True when the provider accepted the key; false when the provider could not be reached (the key is saved anyway) and `warning` says so.\n"
          },
          "warning": {
            "$ref": "#/components/schemas/CarrierKeyWarning"
          }
        }
      },
      "ShippingCatalogService": {
        "type": "object",
        "required": [
          "service_code",
          "service"
        ],
        "properties": {
          "service_code": {
            "type": "string",
            "description": "Stable provider identifier — what a shipping rule stores and matches on."
          },
          "service": {
            "type": "string",
            "description": "Display label. May change without notice; never match on it."
          }
        }
      },
      "ShippingCatalogCarrier": {
        "type": "object",
        "required": [
          "carrier_code",
          "carrier",
          "services"
        ],
        "properties": {
          "carrier_code": {
            "type": "string",
            "description": "Stable provider identifier for the carrier, and the value a `ShippingRate` carries in its own `carrier_code`.\n\n**Compare it case-insensitively.** On EasyPost the catalog derives this from the connected account while rates report the carrier's own spelling, and the two differ in case — the account is `FedexDefaultAccount`, the rate says `FedExDefault`. Verified in #1672: *no* EasyPost catalog code equals its rate counterpart as an exact string. The rule engine already lowercases before comparing; a UI grouping rates under catalog carriers must do the same or it will match nothing.\n"
          },
          "carrier": {
            "type": "string",
            "description": "Display name, taken from the store's own connected account where the provider gives one — two accounts can map to the same underlying carrier (e.g. FedEx and FedEx Default), and the account's label is what distinguishes them.\n"
          },
          "services": {
            "type": "array",
            "description": "The services this carrier offers. **May be empty**: a carrier the store has genuinely connected but whose service list the provider does not expose is kept here rather than hidden, because dropping it would tell the seller they cannot ship with something they can (#1672). A rule naming such a carrier with no service can never match a rate, and no backend guard catches that — so a picker should not let one be saved.\n",
            "items": {
              "$ref": "#/components/schemas/ShippingCatalogService"
            }
          }
        }
      },
      "ShippingCatalog": {
        "type": "object",
        "required": [
          "provider",
          "carriers",
          "stale"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "description": "The store's active shipping provider this catalog was read from."
          },
          "carriers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShippingCatalogCarrier"
            }
          },
          "fetched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this catalog was read from the provider."
          },
          "stale": {
            "type": "boolean",
            "description": "True when the provider could not be reached and a previously cached catalog is being served instead. The data is still usable; it may just be missing a carrier connected since `fetched_at`.\n"
          },
          "services": {
            "type": "array",
            "description": "The HippoLink shipping services this store can use right now (#4588): the provider-neutral services whose codes appear in `carriers` (so after the ShipStation `service_codes` allow-list), in display order. Same ids and names under every provider, so a rule naming one keeps working after the store switches provider. Derived per response from `carriers`.\n",
            "items": {
              "$ref": "#/components/schemas/ShippingCatalogEntry"
            }
          },
          "packaging": {
            "type": "array",
            "description": "The packaging tiers a rule's `then.packaging` may name, in display order. Provider-independent, so unlike `carriers` this is neither per-store nor affected by `stale`: it rides along here because the rule editor needs both to build a rule, and one read is cheaper than two.\n",
            "items": {
              "$ref": "#/components/schemas/ShippingPackagingTier"
            }
          }
        }
      },
      "ShippingCatalogEntry": {
        "type": "object",
        "required": [
          "service_id",
          "name",
          "carrier"
        ],
        "description": "One HippoLink shipping service a store can ship with.",
        "properties": {
          "service_id": {
            "type": "string",
            "description": "Stable, provider-neutral id (e.g. `usps_ground_advantage`): the value `ShippingAction.service_id` / `service_ids` take. The backend maps it to the current provider's own carrier and service codes when it rate-shops.\n"
          },
          "name": {
            "type": "string",
            "description": "Display name, the same under every provider (e.g. `USPS Ground Advantage`)."
          },
          "carrier": {
            "type": "string",
            "enum": [
              "USPS",
              "UPS",
              "FedEx",
              "DHL"
            ],
            "description": "The carrier that runs the service, for grouping in a picker."
          }
        }
      },
      "ShippingPackagingTier": {
        "type": "object",
        "required": [
          "key",
          "label",
          "help",
          "is_stamp_tier"
        ],
        "description": "One packaging option offered in the shipping-rule editor. A stamp tier is estimate-only: the seller applies real postage and no label is bought, so it carries an estimate and no carrier. A label tier is rate-shopped through the store's provider, so its price is whatever the rates call returns.\n",
        "properties": {
          "key": {
            "type": "string",
            "description": "Stable identifier, and the exact value `ShippingAction.packaging` takes. Only surfaced tiers appear here: `physical_postage` and `bubble_mailer`. The retired stamp keys still validate on a stored rule (see `ShippingAction.packaging`) but are never returned by this endpoint.\n",
            "enum": [
              "physical_postage",
              "bubble_mailer"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name, e.g. `Bubble mailer (tracked)`. Every stamp tier's label is prefixed `[PHYSICAL STAMP]` — picking one means the seller affixes real postage by hand and nothing is printed, and the label is the only field the rate picker, the pack page, and shipment history all render. Render it verbatim rather than reconstructing a name from `key`.\n"
          },
          "help": {
            "type": "string",
            "description": "One-line guidance on when to pick this tier, e.g. `Up to ~12 cards`."
          },
          "is_stamp_tier": {
            "type": "boolean",
            "description": "True when the tier is estimate-only and resolves to the synthetic stamp option rather than a rate-shopped label. A stamp tier needs no carrier or service, which is why the editor hides that picker for one.\n"
          },
          "estimated_postage_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "Approximate USPS retail postage for a stamp tier, or null for a rate-shopped one, whose price is not known until rates are fetched. An estimate for the seller to sanity-check against, never a billed amount.\n"
          }
        }
      },
      "ShipStationCarrierService": {
        "type": "object",
        "required": [
          "service_code",
          "name"
        ],
        "properties": {
          "service_code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ShipStationAvailableCarrier": {
        "type": "object",
        "required": [
          "carrier_id",
          "friendly_name",
          "services"
        ],
        "properties": {
          "carrier_id": {
            "type": "string"
          },
          "friendly_name": {
            "type": "string"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShipStationCarrierService"
            }
          }
        }
      },
      "ShipStationAvailableServices": {
        "type": "object",
        "required": [
          "carriers"
        ],
        "properties": {
          "carriers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShipStationAvailableCarrier"
            }
          }
        }
      },
      "PitneyBowesConnectionStatus": {
        "type": "object",
        "required": [
          "connected"
        ],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "last_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "carrier_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Shipping 360 USPS carrier account labels are bought on."
          },
          "verified": {
            "type": "boolean",
            "description": "Only on a successful EasyPost or ShipStation key PUT. True when the provider accepted the key; false when the provider could not be reached (the key is saved anyway) and `warning` says so. Pitney Bowes never saves unverified, so its PUT carries neither field.\n"
          },
          "warning": {
            "$ref": "#/components/schemas/CarrierKeyWarning"
          }
        }
      },
      "ShippingProviderSelection": {
        "type": "object",
        "required": [
          "provider"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "description": "The store's active shipping/label provider."
          }
        }
      },
      "MarketplaceFee": {
        "type": "object",
        "description": "A fee formula evaluated as `flat_fee + pct_rate * order_total`, optionally capped at `max_cap`. Expresses all four shapes: X% (flat 0), Flat + X%, X% capped (max_cap set), Flat (pct 0). Amounts are USD strings.\n",
        "required": [
          "flat_fee",
          "pct_rate",
          "max_cap"
        ],
        "properties": {
          "flat_fee": {
            "type": "string",
            "description": "Flat component in USD, e.g. \"0.30\". Non-negative."
          },
          "pct_rate": {
            "type": "string",
            "description": "Fraction of the order total, e.g. \"0.029\" for 2.9%. Between 0 and 1."
          },
          "max_cap": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional USD cap on the computed fee; null means uncapped."
          }
        }
      },
      "MarketplaceFeeConfig": {
        "type": "object",
        "required": [
          "platform",
          "platform_fee",
          "cc_fee"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "description": "Marketplace this config applies to (e.g. TCGPLAYER, MANA_POOL)."
          },
          "platform_fee": {
            "$ref": "#/components/schemas/MarketplaceFee"
          },
          "cc_fee": {
            "$ref": "#/components/schemas/MarketplaceFee"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MarketplaceFeeConfigList": {
        "type": "object",
        "required": [
          "marketplace_fees"
        ],
        "properties": {
          "marketplace_fees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceFeeConfig"
            }
          }
        }
      },
      "Warning": {
        "type": "object",
        "required": [
          "code",
          "detail"
        ],
        "description": "A non-fatal note on a successful response. The request did what was asked.",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable code, for example `marketplace_sync_not_queued`."
          },
          "detail": {
            "type": "string",
            "description": "Plain-language message for the user."
          }
        }
      },
      "MarketplacePriceConverted": {
        "type": "object",
        "description": "A per-marketplace price typed in the store's currency and saved in the marketplace's. Every field but `warnings` is present when the price was converted; a response with only `warnings` means the save needed no conversion but its sync event was not queued.\n",
        "properties": {
          "price": {
            "type": "number",
            "format": "double",
            "description": "The saved override, in `currency`, rounded to the penny."
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "EUR",
              "CAD",
              "MXN"
            ],
            "description": "The marketplace's currency the override is saved in."
          },
          "store_currency_price": {
            "type": "number",
            "format": "double",
            "description": "The price as the seller typed it, in `store_currency`."
          },
          "store_currency": {
            "type": "string",
            "enum": [
              "USD",
              "EUR",
              "CAD",
              "MXN"
            ]
          },
          "rate": {
            "type": "number",
            "format": "double",
            "description": "The store's applied rate used, 1 `store_currency` = `rate` `currency`."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            }
          }
        }
      },
      "EffectiveMarketplacePrice": {
        "type": "object",
        "required": [
          "marketplace",
          "price",
          "currency",
          "source",
          "store_currency_price",
          "store_currency",
          "rate"
        ],
        "description": "The price the marketplace push sends for one SKU, and where it came from. Read from the same SQL the push uses, so it matches what the marketplace is sent.\n",
        "properties": {
          "marketplace": {
            "$ref": "#/components/schemas/RepriceMarketplace"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The price sent, in `currency`. eBay's $0.99 minimum is applied, as the push applies it. Null when `source` is `none`.\n"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "The currency `price` is in, an ISO 4217 code. Not limited to the store currencies: a CardNexus row is in the account's own selling currency, which CardNexus decides. With `source: none`, the currency a converted price would be listed in, or null when the marketplace converts nothing.\n"
          },
          "source": {
            "type": "string",
            "enum": [
              "override",
              "converted",
              "base",
              "none"
            ],
            "description": "`override`: a per-marketplace price in a currency the marketplace accepts. `converted`: the store-currency price (its override for this marketplace, else the base) converted at the store's applied rate and rounded by its rule's ROUND clause. `base`: the base price, in the store's currency. `none`: no price this marketplace can take (no price, or no applied rate to convert with).\n"
          },
          "store_currency_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The store-currency price `price` comes from. Null for an override saved in another currency, and when `source` is `none`.\n"
          },
          "store_currency": {
            "type": "string",
            "enum": [
              "USD",
              "EUR",
              "CAD",
              "MXN"
            ]
          },
          "rate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The applied rate a converted price used, 1 `store_currency` = `rate` `currency`. Null unless `source` is `converted`.\n"
          }
        }
      },
      "WarningsOnlyResponse": {
        "type": "object",
        "required": [
          "warnings"
        ],
        "description": "Answered with 200 instead of the route's usual 204 when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`).\n",
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            }
          }
        }
      },
      "OrderItemCancellationCause": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "customer_declined",
          "store_cannot_fill",
          null
        ],
        "description": "Why cards came off a Kiosk order: `customer_declined` (the customer did not want them) or `store_cannot_fill` (not in stock, damaged, not found). Null for removals made before this was recorded, or by a caller that did not say."
      },
      "GatewayMessage": {
        "type": "object",
        "description": "An answer from the API gateway itself, before HippoLink's code runs (a refused token, an unknown route). It carries no `request_id` and no rate-limit headers, and no `error` code: a client that branches on `error` should treat a 401 without one as \"token refused\".\n",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "examples": [
              "Unauthorized"
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "request_id"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Stable machine-readable code naming the specific failure, in `<resource>_<condition>` form (e.g. \"location_not_found\", \"stock_committed_to_orders\", \"validation_error\"). Clients branch on this, never on `detail`. A small set of generic codes (\"unexpected_error\", \"resource_conflict\", \"request_value_invalid\") remains for failures the server could not name.\n"
          },
          "detail": {
            "type": "string",
            "description": "Message written for the person using the app: what went wrong and what to do next. Never carries SQL, exception text or internal ids.\n"
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "Values a client needs to render or act on this error (e.g. `{\"max\": 150}` for a limit, `{\"required_plan\": \"pro\"}` for `subscription_required`). Keys are fixed per error code.\n"
          },
          "request_id": {
            "type": "string",
            "description": "Opaque identifier for this request (for support/debugging). It is the API Gateway request id (for example `HefroiDwIAMEMzw=`), or a UUID when the request did not come through the gateway. Quote it as is; do not parse it.\n"
          },
          "line": {
            "type": "integer",
            "description": "1-based source line of a DSL syntax error (parse_error only; absent or 0 when the error has no source position, e.g. a semantic check)\n"
          },
          "column": {
            "type": "integer",
            "description": "1-based source column of a DSL syntax error (parse_error only)"
          },
          "validation_errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Field name (for single-object validation)"
                },
                "index": {
                  "type": "integer",
                  "description": "Array position (for batch/array validation)"
                },
                "code": {
                  "type": "string",
                  "description": "Why the field was refused: required, invalid_format, invalid_uuid, invalid_choice, invalid_type, out_of_range, too_long, too_short, read_only\n"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "description": "Present when error is \"validation_error\" or \"query_param_invalid\", or on a multi-field DSL constraint violation (a rule that violates more than one clause at once, e.g. an out-of-range ADJUST amount alongside an inverted LIMIT) -- one entry per distinct cause\n"
          }
        }
      },
      "InventoryFilter": {
        "type": "object",
        "description": "The same filter set `GET /v1/stores/{store_uuid}/inventory` accepts as query parameters, as a JSON object for use in a request body (e.g. `POST .../inventory/export`). Semantics are identical to the list endpoint: quantity/price/date-range bounds are evaluated as product-level aggregates (a product matches `price_max` if *any* of its SKUs is at or under that price, not every SKU) — the export applies exactly the same rule, so a product's export rows can include a SKU outside a given range if a sibling SKU is what satisfied it. `condition`, `language`, and `location_uuid` are the filters re-applied at the individual row/SKU level in the export (a product can hold both matching and non-matching stock).\n",
        "properties": {
          "condition": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardConditionInput"
            },
            "description": "Match products/rows with at least one SKU of this condition. An `eu` store may use its own Cardmarket/MKM vocabulary; values are translated to the stored US grades at request time, so the job row records the canonical filter (#1599).\n"
          },
          "language": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Match products/rows with at least one SKU in one of these languages."
          },
          "finish": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardFinish"
            },
            "description": "Match products/rows with at least one SKU of one of these finishes."
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Scope to this location and everything beneath it. Pass a bin for that bin alone, or a container for its whole subtree. Row quantities in the export are the matched bins' own counts, not the SKU's store-wide total.\n"
          },
          "search": {
            "type": "string",
            "description": "Search string with the same semantics as `GET /inventory`'s `search` parameter — per-word product-name matching plus the inline Scryfall-style operators (`set:`/`e:`, `cn:`/`number:`, `c:`/`color:`), so the grid's search box can be forwarded verbatim. See that parameter for the full grammar. A recognized operator with an unusable value (`set:`, `c:x`) fails the export job rather than the create request: the job's `error_message` names the operator. `bin:` and `container:` also narrow the file row by row, like the `location_uuid` key: a card split across two bins contributes only the named one's line.\n"
          },
          "rarity": {
            "type": "string"
          },
          "set_name": {
            "type": "string"
          },
          "product_number": {
            "type": "string"
          },
          "color": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "W",
                "U",
                "B",
                "R",
                "G",
                "C",
                "M"
              ]
            },
            "description": "Match products with at least one of these MTGJSON color-identity letters (W/U/B/R/G), C (colorless), or M (multicolor); multiple values combine as OR. Same semantics as `GET /inventory`'s `color` query parameter (comma-separated there; an array here).\n"
          },
          "quantity_min": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_max": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_visible_min": {
            "type": "integer",
            "minimum": 0
          },
          "quantity_visible_max": {
            "type": "integer",
            "minimum": 0
          },
          "price_min": {
            "type": "number",
            "format": "double"
          },
          "price_max": {
            "type": "number",
            "format": "double"
          },
          "first_inventoried_after": {
            "type": "string",
            "format": "date-time"
          },
          "first_inventoried_before": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_after": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_before": {
            "type": "string",
            "format": "date-time"
          },
          "cogs_min": {
            "type": "number",
            "format": "double",
            "minimum": 0
          },
          "cogs_max": {
            "type": "number",
            "format": "double",
            "minimum": 0
          },
          "last_copy_sold_after": {
            "type": "string",
            "format": "date-time"
          },
          "last_copy_sold_before": {
            "type": "string",
            "format": "date-time"
          },
          "never_sold": {
            "type": "boolean"
          }
        }
      },
      "InventoryDeleteJobRequest": {
        "type": "object",
        "required": [
          "filters",
          "reason"
        ],
        "description": "`filters` is required and must resolve to at least one in-stock product (checked server-side via the same preview `HEAD /inventory` serves) -- there is no explicit-id form here, this endpoint exists specifically for \"select all N matching a filter\". Unlike the synchronous `bulk-delete` route's `filters`, there is no 500-SKU cap: the job keyset-paginates and can cover a whole store.\n",
        "properties": {
          "filters": {
            "$ref": "#/components/schemas/InventoryFilter",
            "description": "Resolves to every matching in-stock product, deleted in keyset-paginated chunks. Rejected with 422 when it carries an unrecognized key, when it constrains nothing (so it would mean \"the whole store\"), or when it matches no in-stock product.\n"
          },
          "exclude_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Products to exclude from the match -- the \"select all, then un-check a few\" set a Gmail-style select-everything UI produces.\n"
          },
          "reason": {
            "$ref": "#/components/schemas/RemovalReason"
          },
          "note": {
            "type": "string",
            "description": "Optional operator note stored on every ledger movement the job writes."
          }
        }
      },
      "InventoryDeleteJob": {
        "description": "An async \"delete everything matching this filter\" job and its current progress (#1164 Phase 1).\n",
        "type": "object",
        "required": [
          "job_uuid",
          "status",
          "filters",
          "reason",
          "deleted_count",
          "stalled",
          "created_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The store the job was authorized against."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "Current lifecycle state. \"cancelled\" is a terminal state reached when a caller cancels a still-pending or running job.\n"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true,
            "description": "The filter set this job deletes by, as stored -- the normalized internal form, not the wire form that was submitted. Inline search operators are expanded here (`{\"search\": \"e:WOE\"}` is stored as `{\"op_set_name\": \"WOE\"}`), so this object is NOT re-submittable to `POST .../inventory/delete-jobs`, which accepts only the `InventoryFilter` wire keys. Echoed for display and auditing.\n"
          },
          "exclude_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "actor_supabase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The user who created the job."
          },
          "cursor": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Internal keyset position the worker resumes from (`after_product_id`, `fuzzy`). Present for debugging a stalled job; not part of any client contract.\n"
          },
          "reason": {
            "$ref": "#/components/schemas/RemovalReason"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "deleted_count": {
            "type": "integer",
            "description": "Products deleted so far."
          },
          "delete_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total products to delete, resolved via `count_inventory` (the same number `HEAD /inventory` previewed) once the first chunk claims the job. Null until then.\n"
          },
          "stalled": {
            "type": "boolean",
            "description": "True when the job is pending/running and hasn't advanced in over 30 minutes -- most likely a lost queue message. This job type has no automatic revival; cancel it and create a new one.\n"
          },
          "summary": {
            "type": [
              "object",
              "null"
            ],
            "description": "Present once the job is completed."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable snake_case code for why the job failed (`delete_job_claim_failed`, `delete_job_store_mismatch`, `delete_job_timed_out`, `delete_job_resolve_failed`, `delete_job_chunk_failed`, `job_never_started`). Null until the job fails, and on jobs that failed before codes existed.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-facing explanation of the failure, populated when the job fails. Plain language, safe to show to the store; never raw exception text. Products deleted before the failure stay deleted.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "InventoryDeleteJobList": {
        "description": "A store's inventory delete-all jobs, newest first.",
        "type": "object",
        "required": [
          "jobs"
        ],
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryDeleteJob"
            }
          }
        }
      },
      "InventoryLabelExportJobRequest": {
        "type": "object",
        "oneOf": [
          {
            "required": [
              "filters"
            ],
            "not": {
              "required": [
                "location_uuid"
              ]
            }
          },
          {
            "required": [
              "location_uuid"
            ],
            "not": {
              "required": [
                "filters"
              ]
            }
          }
        ],
        "description": "Exactly one of `filters` and `location_uuid`; sending both or neither is a 422. `filters` must constrain something (an empty or unrecognized-only filter is rejected rather than treated as \"the whole store\"). Unlike the synchronous `labels` route's body, which prints at most 250 labels, there is no label cap at request time: the job resolves the match count once it runs, and fails with `label_export_too_many_labels` if it exceeds the server's ceiling of 100,000 labels.\n",
        "properties": {
          "filters": {
            "$ref": "#/components/schemas/InventoryFilter",
            "description": "Resolves to every matching product's SKUs (per `label_filter`), printed as one PDF or, past 500 labels, a ZIP of PDFs. Rejected with 422 when it carries an unrecognized key or constrains nothing.\n"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Prints one label per stocked entry in this bin, or in every bin of this container's subtree, in shelf order. The location is checked when the job is created: a malformed id is a 422, and one that is missing, deleted or another store's is a 404 `location_not_found`. `label_filter` and `exclude_product_ids` do not apply to a location job.\n"
          },
          "label_filter": {
            "type": "string",
            "enum": [
              "in_stock",
              "ever_stocked",
              "all"
            ],
            "default": "in_stock",
            "description": "Which SKUs of each matching product to print labels for: `in_stock` (the store currently holds it), `ever_stocked` (any storage row ever, including depleted), or `all` (every SKU of the product in the catalog, regardless of whether the store has stocked it). Same semantics as the synchronous `labels` route's `filter` field: whichever it matches, a SKU with nothing on hand (non-holding bins) never prints (#4415).\n"
          },
          "exclude_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Products to exclude from the match -- the \"select all, then un-check a few\" set a Gmail-style select-everything UI produces.\n"
          },
          "copies": {
            "type": "string",
            "enum": [
              "one",
              "on_hand"
            ],
            "default": "one",
            "description": "`one` prints one label per card (per SKU, or per storage entry for `location_uuid`). `on_hand` prints one label per copy the store holds, a card's copies next to each other (#4415): a location entry's own `total_quantity`, or a matched SKU's `total_quantity` summed over the store's live, non-holding bins. A SKU with nothing on hand prints no label. The 100,000-label ceiling counts labels after this expansion, and parts still split at 500 labels, so one card's copies can span two PDFs of the ZIP.\n"
          }
        }
      },
      "InventoryLabelExportJob": {
        "description": "An async \"print labels for everything matching this filter\" job and its current status (#1164 Phase 2). One-shot: unlike `InventoryDeleteJob` there is no `cursor`/chunk progress to poll -- a job goes straight from `pending`/`running` to `completed` or `failed`.\n",
        "type": "object",
        "required": [
          "job_uuid",
          "status",
          "filters",
          "label_filter",
          "stalled",
          "file_count",
          "created_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The store the job was authorized against."
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The location a location job prints; null for a filter job."
          },
          "skipped_count": {
            "type": "integer",
            "description": "Cards left off the print because they couldn't be rendered, counted once the job is completed; 0 before then.\n"
          },
          "file_count": {
            "type": "integer",
            "minimum": 1,
            "description": "How many PDFs the result holds: 1 for a single PDF, more for a ZIP. 1 until the job has been split, so it is always present.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "description": "Current lifecycle state."
          },
          "filters": {
            "type": "object",
            "additionalProperties": true,
            "description": "The filter set this job resolves by, as stored -- the normalized internal form, not the wire form that was submitted. Empty for a location job. Inline search operators are expanded here (`{\"search\": \"e:WOE\"}` is stored as `{\"op_set_name\": \"WOE\"}`), so this object is NOT re-submittable to `POST .../inventory/label-jobs`, which accepts only the `InventoryFilter` wire keys. Echoed for display and auditing.\n"
          },
          "exclude_product_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "label_filter": {
            "type": "string",
            "enum": [
              "in_stock",
              "ever_stocked",
              "all"
            ]
          },
          "copies": {
            "type": "string",
            "enum": [
              "one",
              "on_hand"
            ],
            "description": "How many labels each card gets, as requested: `one`, or `on_hand` for one per copy the store holds (#4415).\n"
          },
          "actor_supabase_uuid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The user who created the job."
          },
          "label_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Labels printed, once the job is completed."
          },
          "download_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Presigned S3 GET URL for the PDF, or for the ZIP when `file_count` is more than 1. Present only once `status` is `completed`, and presigned afresh on every read; each link expires after 1 hour, so re-read the job for a new one. A job finished before this change keeps the link it was stored with.\n"
          },
          "stalled": {
            "type": "boolean",
            "description": "True when the job is pending/running and hasn't advanced in over 30 minutes -- most likely a lost queue message. This job type has no automatic revival; create a new one.\n"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable snake_case code for why the job failed (`label_export_claim_failed`, `label_export_store_mismatch`, `label_export_timed_out`, `label_export_resolve_failed`, `label_export_nothing_to_print`, `label_export_too_many_labels`, `label_export_render_failed`, `label_export_storage_unavailable`, `label_export_upload_failed`, `label_export_completion_failed`, `label_export_stalled`, `job_never_started`). Null until the job fails, and on jobs that failed before codes existed.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-facing explanation of the failure, populated when the job fails. Plain language, safe to show to the store; never raw exception text.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ExportJob": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncJob"
          },
          {
            "type": "object",
            "properties": {
              "completed_at": {
                "type": "string",
                "format": "date-time"
              },
              "filters": {
                "$ref": "#/components/schemas/InventoryFilter",
                "description": "The filters this export was scoped to, or absent for a whole-store export.\n"
              },
              "total_inventory": {
                "type": "integer",
                "description": "Number of CSV rows written. One row per (SKU, bin), so a SKU stocked in several bins counts once per bin.\n"
              },
              "download_url": {
                "type": "string",
                "format": "uri",
                "description": "Pre-signed download URL for the CSV file. Present only when status is \"completed\".\n"
              },
              "download_expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the CSV is purged from storage, after which `download_url` no longer resolves. Present only alongside `download_url`. Approximate: the purge runs asynchronously and can lag by up to a day.\n"
              },
              "error": {
                "type": "string",
                "description": "User-facing error message. Present when status is \"failed\", or \"pending\" while an automatic retry waits."
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Stable `<resource>_<condition>` code, e.g. `import_file_unreadable` or `job_retries_exhausted`. Present when status is \"failed\", beside the user-facing `error` message, and while a pending job waits for an automatic retry (`*_attempt_failed`).\n"
              }
            }
          }
        ]
      },
      "FulfillmentSortItem": {
        "type": "object",
        "description": "One pick task in the packer's pile, with the package it belongs to. A task can be several physical cards (quantity), which is why pile_index is not the row number.\n",
        "required": [
          "pile_index",
          "package_number",
          "stack_number",
          "quantity",
          "pick_item_uuid",
          "tcgplayer_sku_id"
        ],
        "properties": {
          "pile_index": {
            "type": "integer",
            "description": "1-based position of this task's FIRST physical card in the pile, counting cards rather than rows, so a 3-of line advances the next task's index by three. Against pile_total this is also the progress reading (\"142 of 384\").\n"
          },
          "package_number": {
            "type": "integer",
            "description": "1-based, assigned by first appearance in the pile. The order this belongs to is on the matching packages[] entry rather than repeated on every row.\n"
          },
          "stack_number": {
            "type": "integer",
            "description": "1-based stack this card is in; matches stacks[].stack_number. Always 1 on a run that isn't split.\n"
          },
          "quantity": {
            "type": "integer",
            "description": "Physical cards this task represents, all going to the same package."
          },
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Pass this to PATCH .../sort to record how far the packer has got."
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (Magic only), when it has one."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number — with variant_label, what tells two printings apart."
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Frame/border treatment, for telling two printings of one card apart."
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Region-translated for display, matching the picklist the card came from."
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display finish (\"Non-Foil\", \"Foil\")."
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_substitute": {
            "type": "boolean",
            "description": "True when the picker grabbed a different condition than ordered, so the card in hand will not match the order line exactly.\n"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bin the card was picked from, so a card that turns out to be wrong can go back to it. Null when the pick item has no bin.\n"
          },
          "location_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ancestor-qualified path of that bin, when known."
          },
          "slot_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order slots: the tray slot this card goes into (\"A\" ... \"Z\", then \"AA\" ... \"AZ\"), the same as its package's. Null for a set-aside card. Present only when the run has order slots. On a pre-pull run it is the card's set slot, uncapped.\n"
          },
          "set_aside": {
            "type": "boolean",
            "description": "Pre-pull run only: true for a card whose order stopped being held since the run was built (canceled), which goes back to the shelf instead of into a holding bin; its `slot_label` is then null. Absent on ordinary runs.\n"
          },
          "placed": {
            "type": "boolean",
            "description": "Order slots: true once the packer has dropped this card into its slot. Present only when the run has order slots.\n"
          }
        }
      },
      "PackSortPlacement": {
        "type": "object",
        "description": "Order slots: one motion for the packer. Back-to-back pile rows of one SKU going to one slot are grouped into a single placement (\"3 x Sol Ring into A\"). A placement never spans two stacks. Set-aside cards are never placements. Card fields are taken from the placement's first pick item.\n",
        "required": [
          "slot_label",
          "slot_seq",
          "slot_total",
          "stack_number",
          "quantity",
          "pick_item_uuids",
          "placed",
          "tcgplayer_sku_id",
          "product_name",
          "set_code",
          "product_number",
          "variant_label",
          "condition",
          "language",
          "finish_label",
          "image_uri",
          "is_substitute"
        ],
        "properties": {
          "slot_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The tray slot these cards go into."
          },
          "slot_seq": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based position of this placement within an unbroken stretch of one SKU that spans several placements (\"Slot 2 of 3\"). Null when the stretch is a single placement.\n"
          },
          "slot_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Placements in that same-SKU stretch. Null whenever slot_seq is null."
          },
          "stack_number": {
            "type": "integer",
            "description": "1-based stack this card is in; matches stacks[].stack_number. Always 1 on a run that isn't split.\n"
          },
          "quantity": {
            "type": "integer",
            "description": "Physical cards in this placement, summed across its pick items."
          },
          "pick_item_uuids": {
            "type": "array",
            "description": "The pick items this placement covers, in pile order. Pass them to POST .../sort/placed.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "placed": {
            "type": "boolean",
            "description": "True only when every one of its pick items is placed."
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Region-translated for display, matching the picklist the card came from."
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_substitute": {
            "type": "boolean"
          }
        }
      },
      "FulfillmentSortStack": {
        "type": "object",
        "description": "One picker's cards in the pile. Within a stack, cards are in the order they were picked.",
        "required": [
          "stack_number",
          "stretch_uuid",
          "picker_name",
          "card_count",
          "first_pile_index"
        ],
        "properties": {
          "stack_number": {
            "type": "integer",
            "description": "1-based; the order the stacks are put together, stack 1 on top."
          },
          "stretch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The stretch that picked these cards. Null for a run that isn't split, or cards picked from the pool."
          },
          "picker_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The stretch's picker, as on the run's stretches[]. Null when stretch_uuid is null."
          },
          "card_count": {
            "type": "integer",
            "description": "Physical cards in this stack."
          },
          "first_pile_index": {
            "type": "integer",
            "description": "pile_index of the stack's top card."
          }
        }
      },
      "FulfillmentSortPackage": {
        "type": "object",
        "description": "One destination pile. Strictly one per order.",
        "required": [
          "package_number",
          "card_count",
          "disposition"
        ],
        "properties": {
          "package_number": {
            "type": "integer"
          },
          "order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set instead of order_uuid on a TCGplayer Direct RI run, which is one shipment back to TCGplayer and therefore a single package.\n"
          },
          "marketplace": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "buyer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_count": {
            "type": "integer",
            "description": "Physical cards in this package."
          },
          "disposition": {
            "type": "string",
            "enum": [
              "pack",
              "set_aside"
            ],
            "description": "set_aside when the order was cancelled after the run was packed. Its cards are still in the pile because the stock was already pulled, but no packing slip will print for them, so they go to restock rather than onto a pile.\n"
          },
          "dest_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Order slots: the 1-based tray slot this order was dealt into when the run was created. Null for a set-aside package. Present only when the run has order slots, in which case packages[] is ordered by dest_slot (null last), then by first appearance in the pile, and package_number follows that order.\n"
          },
          "slot_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order slots: dest_slot as a letter (\"A\" for 1 ... \"Z\", then \"AA\" ... \"AZ\"). Present only when the run has order slots.\n"
          }
        }
      },
      "FulfillmentRunSort": {
        "type": "object",
        "required": [
          "run_uuid",
          "pile_total",
          "packages",
          "stacks",
          "items",
          "total",
          "prepull_program",
          "legend",
          "missing"
        ],
        "properties": {
          "missing": {
            "description": "The whole run's missing cards, not paged: a missing card is never in the pile. Set only on a ready_to_pack order run; null on any other status and on RI, pre-pull and Zero invoice runs.\n",
            "anyOf": [
              {
                "$ref": "#/components/schemas/FulfillmentRunMissing"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "prepull_program": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "direct",
              "ct_zero",
              null
            ],
            "description": "The run's holding program when it is a pre-pull run; null otherwise."
          },
          "legend": {
            "type": "array",
            "description": "Pre-pull run: the set-slot tray legend, one entry per set slot in slot order. Always present; empty on a run that is not a pre-pull run.\n",
            "items": {
              "$ref": "#/components/schemas/PrepullSortLegendEntry"
            }
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "pile_total": {
            "type": "integer",
            "description": "Physical cards in the pile, across every page. The denominator for a packer's progress reading against items[].pile_index.\n"
          },
          "cursor_pick_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The stored resume anchor, or null if never set — also null when the stored anchor no longer names a card in this pile, which is reported as no cursor rather than an error.\n"
          },
          "cursor_pile_index": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The anchor resolved to a position in the pile."
          },
          "packages": {
            "type": "array",
            "description": "Every package on the run (empty on a pre-pull run, which has no orders to pack), in package_number order, on every page — assignment runs over the whole run before the page is cut, so numbering never shifts as the packer scrolls.\n",
            "items": {
              "$ref": "#/components/schemas/FulfillmentSortPackage"
            }
          },
          "stacks": {
            "type": "array",
            "description": "The pile as stacks, in the order they go together (stack 1 on top). On a split run each stretch that picked cards is one stack, ordered by when the stretch was taken; cards picked from the pool, or before pick order was recorded, form a first stack with a null stretch. A run that isn't split has exactly one stack with a null stretch. Empty when the pile is empty.\n",
            "items": {
              "$ref": "#/components/schemas/FulfillmentSortStack"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FulfillmentSortItem"
            }
          },
          "total": {
            "type": "integer",
            "description": "Pick tasks across every page (not physical cards — see pile_total)."
          },
          "placements": {
            "type": "array",
            "description": "Order slots: the pile as card-by-card placements, computed over the whole pile and cut with the same limit/offset as items[]. Present only when the run has order slots.\n",
            "items": {
              "$ref": "#/components/schemas/PackSortPlacement"
            }
          },
          "placements_total": {
            "type": "integer",
            "description": "Placements across every page. Present only when the run has order slots."
          },
          "placed_count": {
            "type": "integer",
            "description": "Physical cards already placed into their slots (set-aside cards excluded). Present only when the run has order slots.\n"
          },
          "placeable_total": {
            "type": "integer",
            "description": "Physical cards the placements cover: the pile less its set-aside cards. Progress is placed_count / placeable_total, which reaches 100% even with a set-aside package in the pile. Present only when the run has order slots.\n"
          },
          "resume_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "0-based index, into the whole placements list, of the first placement not fully placed; null when every placement is placed. Present only when the run has order slots.\n"
          }
        }
      },
      "PrepullSortLegendEntry": {
        "type": "object",
        "required": [
          "slot_label",
          "set_name",
          "holding_bin"
        ],
        "properties": {
          "slot_label": {
            "type": "string",
            "description": "The set slot letter (\"A\" ... \"Z\", \"AA\" ...)."
          },
          "set_name": {
            "type": "string"
          },
          "holding_bin": {
            "type": "string",
            "description": "The set's existing holding bin name, or \"new\" when complete-prepull will create it."
          }
        }
      },
      "FulfillmentRunPutaway": {
        "type": "object",
        "required": [
          "run_uuid",
          "prepull_program",
          "container_uuid",
          "container_name",
          "rows",
          "return_to_shelf"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "prepull_program": {
            "type": "string",
            "enum": [
              "direct",
              "ct_zero"
            ]
          },
          "container_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The program's holding container."
          },
          "container_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "type": "array",
            "description": "One row per set slot, in slot order.",
            "items": {
              "type": "object",
              "required": [
                "dest_slot",
                "slot_label",
                "set_name",
                "holding_location_uuid",
                "holding_bin_name",
                "holding_bin_number",
                "card_count"
              ],
              "properties": {
                "dest_slot": {
                  "type": "integer",
                  "description": "1-based set slot."
                },
                "slot_label": {
                  "type": "string",
                  "description": "dest_slot as a letter (\"A\" ... \"Z\", \"AA\" ...), uncapped."
                },
                "set_name": {
                  "type": "string"
                },
                "holding_location_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The set's holding bin; null when complete-prepull will create it."
                },
                "holding_bin_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "holding_bin_number": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "1-based position of the bin among the holding container's bins, in walking order. For a set with no bin yet, the position complete-prepull will give the bin it creates; null when the set has no cards to move."
                },
                "card_count": {
                  "type": "integer",
                  "description": "Picked copies in this slot whose order is still held, capped per line at what it still owes."
                }
              }
            }
          },
          "return_to_shelf": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrepullReturnToShelfItem"
            }
          }
        }
      },
      "PrepullReturnToShelfItem": {
        "type": "object",
        "description": "A picked card whose order stopped being held since the run was built, or a copy past what its line still owes; it goes back to the bin it came from.",
        "required": [
          "pick_item_uuid",
          "location_uuid",
          "location_name",
          "tcgplayer_sku_id",
          "quantity"
        ],
        "properties": {
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          }
        }
      },
      "FulfillmentPrepullComplete": {
        "type": "object",
        "required": [
          "run_uuid",
          "status",
          "moved",
          "return_to_shelf",
          "created_bins"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "complete"
            ]
          },
          "moved": {
            "type": "array",
            "description": "One entry per set slot that received cards, in slot order.",
            "items": {
              "type": "object",
              "required": [
                "slot_label",
                "set_name",
                "holding_location_uuid",
                "holding_bin_number",
                "card_count"
              ],
              "properties": {
                "slot_label": {
                  "type": "string",
                  "description": "The set slot as a letter (\"A\" ... \"Z\", \"AA\" ...), uncapped."
                },
                "set_name": {
                  "type": "string"
                },
                "holding_location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "holding_bin_number": {
                  "type": "integer",
                  "description": "1-based position of the bin among the holding container's bins, in walking order."
                },
                "card_count": {
                  "type": "integer"
                }
              }
            }
          },
          "return_to_shelf": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrepullReturnToShelfItem"
            }
          },
          "created_bins": {
            "type": "array",
            "description": "Holding bins this completion created.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "HoldingReturnItem": {
        "type": "object",
        "required": [
          "commitment_uuid",
          "order_uuid",
          "marketplace_order_id",
          "tcgplayer_sku_id",
          "product_name",
          "set_name",
          "quantity",
          "holding_location_uuid",
          "holding_bin_name",
          "return_location_uuid",
          "return_location_name",
          "released_at"
        ],
        "properties": {
          "commitment_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "holding_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "holding_bin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "return_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Where Return from holding will put the copies; null when there is no destination."
          },
          "return_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "holding_bin_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full location path of the holding bin, e.g. \"TCGplayer Direct Holding > Aetherdrift\"."
          },
          "return_location_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full location path of the return destination; null when there is no destination."
          },
          "released_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the commitment was released (the order was canceled)."
          }
        }
      },
      "HoldingReturnList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HoldingReturnItem"
            }
          }
        }
      },
      "HoldingReturnResult": {
        "type": "object",
        "required": [
          "returned"
        ],
        "properties": {
          "returned": {
            "type": "array",
            "description": "The commitments walked back, canonical uuids.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "FulfillmentPackSortCursor": {
        "type": "object",
        "required": [
          "run_uuid",
          "cursor_pick_item_uuid"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "cursor_pick_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "FulfillmentRunPlaced": {
        "type": "object",
        "required": [
          "placed_count",
          "placeable_total",
          "pile_total"
        ],
        "properties": {
          "placed_count": {
            "type": "integer",
            "description": "Physical cards placed into their slots after this write (set-aside cards excluded), the same value the sort read's placed_count reports.\n"
          },
          "placeable_total": {
            "type": "integer",
            "description": "Physical cards the placements cover (the pile less its set-aside cards), the same value the sort read's placeable_total reports.\n"
          },
          "pile_total": {
            "type": "integer",
            "description": "Physical cards in the pile, the same value the sort read's pile_total reports."
          }
        }
      },
      "FulfillmentPickItem": {
        "type": "object",
        "required": [
          "pick_item_uuid",
          "tcgplayer_sku_id",
          "quantity",
          "ordered_quantity",
          "status"
        ],
        "properties": {
          "walk_seq": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Invoice runs of a holding-enabled program: the stop's position in the invoice walk (0-based, the order the picker follows and the order the parcel is packed in). Null on every other run, and on invoice runs when holding is off.\n"
          },
          "pick_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "holding",
              "shelf",
              null
            ],
            "description": "Invoice runs of a holding-enabled program: `holding` when the stop takes a copy pre-pulled into a holding box, `shelf` when it takes a bin copy. Null when holding is off for the program, and on every non-invoice run.\n"
          },
          "holding_bin_number": {
            "type": [
              "integer",
              "null"
            ],
            "description": "A holding stop's bin number: the bin's 1-based position among the holding container's live bins in walking order, the same number put-away shows. Null on a shelf stop and on every run without holding stops.\n"
          },
          "box_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin's box (its parent container; a root bin is its own box). Null when the item has no bin."
          },
          "stretch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "On a split run, the stretch holding this card's box; null for a pool card or an unsplit run."
          },
          "pin_mismatch": {
            "type": "boolean",
            "description": "CardChaos picking: CardChaos's copy could not be matched to an exact HippoLink row (the bin is not linked or holds fewer copies than CardChaos counts), so the pick points at the bin's front-most copy of the card, or at no bin. Shown on the run; re-push the bin to resolve. Always false on a HippoLink run.\n"
          },
          "cc_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bin",
              "holding",
              null
            ],
            "description": "Where the CardChaos card filling this copy sat; `holding` copies are never pulled again."
          },
          "cc_assignment_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The CardChaos assignment this pick item mirrors."
          },
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The order this pick task fulfills. Null on an RI (TCGplayer Direct) pick run — ri_item_uuid is set instead."
          },
          "order_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The order line this pick task fulfills. Null on an RI pick run."
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order's number on its marketplace, as the packing slip prints it. Null on an RI pick run and on an order the marketplace sent without one; show the order uuid then.\n"
          },
          "ri_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The Reimbursement Invoice line item this pick task pulls for. Null on a normal order run."
          },
          "slot_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Order slots: the tray slot this card's order was dealt into when the run was created (\"A\" for slot 1 ... \"Z\", then \"AA\" ... \"AZ\"). Null when the run has no order slots (see `FulfillmentRun.has_order_slots`), on an RI pick task, and once the order is released from the run. On a pre-pull run (`FulfillmentRun.prepull_program`) it is the card's set slot instead, uncapped (\"A\" ... \"Z\", \"AA\" ... \"AZ\", \"BA\" ...).\n"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of the SKU's positions in the bin this pick is from (storage slots). 0 unless a bin holds the same card at more than one position.\n"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Copies this stop pulls from its bin. A multi-copy line is split into one task per bin, and reporting a partial found rewrites this down to what was found — so it is NOT the line total. Use ordered_quantity for a \"found N of M\" progress denominator.\n"
          },
          "ordered_quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "The order line's total ordered quantity (order_items.quantity), identical on every task sharing an order_item_uuid. Stable across bin splits, not-found tombstones, and re-sourcing — the denominator for per-line \"found N of M\" progress.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "picked"
            ]
          },
          "condition": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "game": {
            "type": "string"
          },
          "unit_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The order line's unit price, in `currency`. Null on an RI pick run (an RI has no per-line price)."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 currency of the line's order, which may differ from the store's (a CAD Snapcaster order on a USD store). Null on an RI pick run."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (Magic only), when it has one."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display-only treatment of the printing — Art Card, Reversible, Double-Faced, Borderless, Showcase, Extended Art, Retro Frame, Full Art, Textless -- with a hand-kept detail the catalog cannot record appended after a comma (\"Reversible, Signature\"). Pairs with product_number to tell two printings of one card in one set apart on the picklist. Null when the printing has no named treatment, and on every non-Magic line."
          },
          "product_set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "sequence_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "location_full_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "bin_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based place of this card among the copies physically in its bin, counted from the front (1 + copies stored ahead of its row; a 2-copy row counts twice). Null when no location or the storage row is gone."
          },
          "bin_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Copies physically in this card's bin (sum of every stocked row's quantity). Null when no location."
          },
          "bin_position": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 1,
            "description": "Copy-depth of this card within its bin, 0.0 (front) to ~1.0 (back) = copies stored ahead of it / total copies in the bin. Reflects how far a picker flips through physical copies, so a card behind a large stack reads as mid-bin regardless of its own copy count. Null when the bin has no counted copies."
          },
          "copies_ahead": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Live copies stored ahead of this card's row in its bin, net of copies other active runs have picked but not yet pulled off the shelf. This run's own picks are NOT subtracted; the client does that from its own state. Null when the item has no bin or no known position.\n"
          },
          "bin_copies": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Live copies in this card's bin, on the same basis as copies_ahead. Null when the item has no bin.\n"
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "URI for the card's product image, or null if unavailable"
          },
          "substitution_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Legacy manual substitution recorded on the item itself, or (on a tombstoned original) the substitute that replaced it.\n"
          },
          "is_missing": {
            "type": "boolean",
            "description": "True if the item was marked missing by the picker"
          },
          "resolution_notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes recorded at substitution or mark-missing time"
          },
          "phase": {
            "type": "integer",
            "description": "Route phase. 0 = the original sweep (original + reused-in-place stops), 1 = the appended tail (new bins + backtracks). Route order is (phase, bin sequence_index).\n"
          },
          "is_substitute": {
            "type": "boolean",
            "description": "This stop picks a substitute: an engine condition fallback, or a manual substitute when substitutes_pick_item_uuid is set. Its tcgplayer_sku_id is the substitute's.\n"
          },
          "substitutes_pick_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set on a manual substitute stop: the original pick item it replaced (hidden as a tombstone). Revert with revertPickItemSubstitution.\n"
          }
        }
      },
      "FulfillmentBinPosition": {
        "type": "object",
        "required": [
          "pick_item_uuid",
          "copies_ahead",
          "bin_copies"
        ],
        "properties": {
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "copies_ahead": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Same as FulfillmentPickItem.copies_ahead."
          },
          "bin_copies": {
            "type": "integer",
            "minimum": 0,
            "description": "Same as FulfillmentPickItem.bin_copies, but never null here: this endpoint only returns pick items located in the requested bin, and every located item has a bin total."
          }
        }
      },
      "FulfillmentRunStretch": {
        "type": "object",
        "required": [
          "stretch_uuid",
          "picker_uuid",
          "picker_name",
          "status",
          "requested_cards",
          "card_count",
          "picked_count",
          "first_box_name",
          "last_box_name"
        ],
        "properties": {
          "stretch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "picker_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "picker_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "done",
              "released"
            ]
          },
          "requested_cards": {
            "type": "integer",
            "minimum": 1,
            "description": "The N the picker asked for. They hold at least that many (whole boxes)."
          },
          "card_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Cards in the stretch's boxes (open + picked). Null once the stretch is not active."
          },
          "picked_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Of those, picked. Null once the stretch is not active."
          },
          "first_box_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The stretch's first box in walk order; null for the unlocated box."
          },
          "last_box_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FulfillmentStretchRequest": {
        "type": "object",
        "required": [
          "cards"
        ],
        "properties": {
          "cards": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "FulfillmentStretchPreview": {
        "type": "object",
        "required": [
          "cards",
          "box_count",
          "first_box_name",
          "last_box_name"
        ],
        "properties": {
          "cards": {
            "type": "integer",
            "description": "Cards the request would get (0 when the pool is empty)."
          },
          "box_count": {
            "type": "integer"
          },
          "first_box_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_box_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FulfillmentStretchFinish": {
        "type": "object",
        "required": [
          "next",
          "pool_cards",
          "active_stretches",
          "run"
        ],
        "properties": {
          "next": {
            "type": "string",
            "enum": [
              "take_more",
              "wait",
              "complete"
            ]
          },
          "pool_cards": {
            "type": "integer"
          },
          "active_stretches": {
            "type": "integer"
          },
          "run": {
            "$ref": "#/components/schemas/FulfillmentRun"
          }
        }
      },
      "FulfillmentBinPositions": {
        "type": "object",
        "required": [
          "positions"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FulfillmentBinPosition"
            }
          }
        }
      },
      "ProblematicOrderSummary": {
        "type": "object",
        "required": [
          "order_uuid",
          "problematic_reason"
        ],
        "description": "One order locked into a run (fulfillment_run_orders) that Order.is_problematic currently flags -- independent of whether it has any pick items. An order whose lines are all non-catalog-matched, or whose lines came up with no stock anywhere, produces zero pick items and so would otherwise be invisible in a run's payload; this is how the run surfaces \"this order has nothing to pick, and why\" without a second per-order lookup.\n",
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order's number on its marketplace, as the packing slip prints it. Null on an order the marketplace sent without one; show the order uuid then.\n"
          },
          "problematic_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Same value as Order.problematic_reason at read time."
          }
        }
      },
      "CancelRunUnpulledShippedLine": {
        "type": "object",
        "description": "One picked line, on a run being cancelled, whose order already shipped out of band. `quantity` is what was picked, not a guarantee of what `pull_shipped` will actually pull — the pull can still come up short on an intervening oversell, exactly like `completeFulfillmentRun`'s own decrement.\n",
        "required": [
          "order_uuid",
          "tcgplayer_sku_id",
          "quantity"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer"
          }
        }
      },
      "FulfillmentRunRenameRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The run's new name; trimmed before saving."
          }
        }
      },
      "FulfillmentRunName": {
        "type": "object",
        "required": [
          "run_uuid",
          "name"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "FulfillmentRun": {
        "type": "object",
        "required": [
          "run_uuid",
          "store_uuid",
          "strategy",
          "status",
          "created_at",
          "updated_at",
          "remaining_stops",
          "pick_items",
          "problematic_orders",
          "is_pickup_run",
          "has_order_slots",
          "executor",
          "split",
          "pool_cards",
          "stretches",
          "prepull_program",
          "root_location_uuid",
          "walk_order",
          "pending_marketplace_notifications",
          "missing",
          "departed_parts",
          "consolidation_orders",
          "name"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run's name: `LABEL - YYMMDD - N` by default (renameFulfillmentRun changes it), a CardChaos run's picklist name, or null on a run created before run names existed.\n"
          },
          "left_out_order_uuids": {
            "type": "array",
            "description": "Location picking, on the `createFulfillmentRun` response of a location-scoped run only: the selected orders with nothing left this location can supply, left out of the run and still in the order list. Empty when none; absent on a store-wide run and on every other response.\n",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "consolidation_orders": {
            "type": "array",
            "description": "Location picking. On a `consolidation` run: its orders, each with the staging slot where its staged part waits and the transfers it received, so the packer knows where to fetch each part (a slot is null once the order ships, or when nothing was staged). On a location-scoped run: the orders that stayed in it holding a staging slot (bundles received here), a gather row in Ship Review. Empty otherwise.\n",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunConsolidationOrder"
            }
          },
          "departed_parts": {
            "type": "array",
            "description": "Location picking: one entry per order that left this run at pick-complete -- staged here (its ship location) or sent on an order transfer to its ship location -- with the cards picked for it here, so the packer knows where each goes. Empty on a store-wide run, on a scoped run nothing left, and on a consolidation run.\n",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunDepartedPart"
            }
          },
          "missing": {
            "description": "The run's missing cards (`FulfillmentRunMissing`). Set only on a ready_to_pack order run; null on any other status and on RI, pre-pull and Zero invoice runs.\n",
            "anyOf": [
              {
                "$ref": "#/components/schemas/FulfillmentRunMissing"
              },
              {
                "type": "null"
              }
            ]
          },
          "pending_marketplace_notifications": {
            "type": "integer",
            "minimum": 0,
            "description": "Labels bought in this run's Ship Review whose shipped + tracking notification to the marketplace is waiting for `shipFulfillmentRun` (not voided, order still `label_purchased`, or `shipped` for a label bought before that status existed). Non-zero on an abandoned ready_to_pack run; `cancelFulfillmentRun` refuses to dismiss it unless `notify_marketplaces` is true. 0 once the run has shipped or been dismissed with the notifications sent.\n"
          },
          "walk_order": {
            "type": "boolean",
            "description": "True on an invoice run of a holding-enabled program: its items are in invoice order (`walk_seq`), each tagged `holding` or `shelf` in `pick_source`, and the pick list is printed in that order. False on every other run.\n"
          },
          "prepull_program": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "direct",
              "ct_zero",
              null
            ],
            "description": "Set on a pre-pull run: the holding program whose held orders it pulls ahead of the sale. A pre-pull run picks into set slots (each pick item's `slot_label` is its set's slot letter, \"A\" ... \"Z\", \"AA\" ..., uncapped), never substitutes, never decrements stock at pick complete and is never shipped; `completeFulfillmentPrepull` moves its cards into holding. Null on every other run.\n"
          },
          "root_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Location picking: the top-level location this order run picks from (every pick item is in a bin under it). Null on a store-wide run and on every pre-pull, RI, CardTrader Zero invoice and CardChaos run.\n"
          },
          "has_order_slots": {
            "type": "boolean",
            "description": "Order slots: true when `createFulfillmentRun` dealt this run's orders into tray slots (the store had order slots on at creation). Each pick item then carries its order's `slot_label`. The slots are stored when the run is created, and changing the store setting never changes an existing run. They stop showing once the run's orders are released: after the run ships or is cancelled, or when every order on it is cancelled, this is false and each `slot_label` is null. Always false on an RI or CardTrader Zero invoice run.\n"
          },
          "split": {
            "type": "boolean",
            "description": "A Walk Path run shared by several pickers as stretches of whole boxes. Each picker sees the pick items whose stretch_uuid is their active stretch.\n"
          },
          "pool_cards": {
            "type": "integer",
            "description": "Open cards nobody holds yet (split runs; 0 otherwise)."
          },
          "stretches": {
            "type": "array",
            "description": "Every stretch of a split run, oldest first (empty otherwise).",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunStretch"
            }
          },
          "executor": {
            "type": "string",
            "enum": [
              "hippolink",
              "cardchaos"
            ],
            "description": "Who picks this run. `cardchaos`: the run mirrors a CardChaos picklist (CardChaos picking). While it is `picking`, every HippoLink pick action answers 409 `run_at_cardchaos` (\"Picking in CardChaos\"); it reaches `ready_to_pack` (or `complete`, for a pre-pull) when the picklist is executed in CardChaos, and `cancelled` when it is deleted there.\n"
          },
          "cc_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "orders",
              "prepull",
              "invoice",
              null
            ],
            "description": "The CardChaos picklist kind; null for a HippoLink run."
          },
          "cc_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The CardChaos picklist's name (e.g. Auto-2026-10-15-2)."
          },
          "cc_session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cc_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When HippoLink last applied a snapshot of this picklist."
          },
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set when this run picks a TCGplayer Direct Reimbursement Invoice (its pick items carry ri_item_uuid, not order fields); null for a normal order run.\n"
          },
          "zero_invoice_order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set when this run picks a CardTrader Zero weekly invoice — the invoice's own order uuid; null for a normal order run or an RI run. The sibling of `ri_uuid` for the other hub program, and the only thing that tells a Zero invoice run apart: it carries ordinary order demand, so without this the payload is identical in shape to a customer order run. Stays set for the run's whole life, including the `shipFulfillmentRun` response after the order lock is released, so a client can route back to the invoice.\n"
          },
          "is_pickup_run": {
            "type": "boolean",
            "description": "True when every order on this run is collected in the shop rather than mailed (`fulfillment_method` \"pickup\" — every kiosk order, plus any marketplace order whose buyer chose in-store collection). Such a run has no Ship Review stage: `completeFulfillmentRun` already stamped each order ready for pickup and emailed the customer, and there is no label to buy — `purchaseShippingLabel` and `getShippingRates` refuse a kiosk order outright. Close the run out from Package Sort with `shipFulfillmentRun`, which releases the locks without shipping anything. `createFulfillmentRun` refuses a batch that mixes the two methods, so this is never partially true. Read over the run's orders (locks plus pick items), so it stays correct after the locks are released.\n"
          },
          "picker_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The assigned picker, or null while the run is unassigned (released, awaiting claim)."
          },
          "strategy": {
            "type": "string",
            "enum": [
              "by_order",
              "by_game_set_alpha",
              "by_location",
              "consolidation"
            ],
            "description": "`consolidation`: a location-picking run that picks nothing, made from the consolidation queue; its cards are the ones its orders' earlier runs pulled.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "picking",
              "unassigned",
              "ready_to_pack",
              "complete",
              "cancelled"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "cancel_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the run was cancelled (only set when status is cancelled)."
          },
          "cancelled_by_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "released_by_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Who last released the run to the unassigned pool."
          },
          "released_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "remaining_stops": {
            "type": "integer",
            "minimum": 0,
            "description": "Count of pick items the picker still has to walk to — pending tasks that are not already resolved-as-missing. Hidden reallocation not-found tombstones (picked + is_missing) and mark-missing rows (pending + is_missing) do not count. When 0, the run has no walkable work left and the UI should offer \"All Done\" (complete the run) even if pick_items is empty (e.g. every line ended up unfulfillable).\n"
          },
          "pick_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FulfillmentPickItem"
            }
          },
          "problematic_orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProblematicOrderSummary"
            },
            "description": "Every order locked into this run that is currently flagged problematic, whether or not it produced any pick_items. See ProblematicOrderSummary.\n"
          }
        }
      },
      "TemplateRelocationRequest": {
        "type": "object",
        "required": [
          "location_uuid"
        ],
        "description": "The scope and the template, shared by the preview and the apply. Both must be given the same values, or the apply's `plan_digest` check fails.\n",
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The container or bin to re-shelve, meaning that location **and everything beneath it**. Required: there is no whole-store shorthand.\n"
          },
          "template_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "One of your saved bin templates. Mutually exclusive with `template`; omit both to use your default template.\n"
          },
          "template": {
            "type": "string",
            "description": "A bin-name template passed inline, validated exactly as `createBinTemplate` validates one — a template you could not save is not one you can move by. Mutually exclusive with `template_uuid`.\n"
          },
          "create_missing_locations": {
            "type": "boolean",
            "default": true,
            "description": "Create a bin the template names but the store does not have, under `Unassigned`. Defaults **true**: filing cards into bins that do not exist yet is half of what this feature is for. Set false to have those rows report `unknown_destination_location` instead.\n"
          },
          "resolutions": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Your answer for each split the preview could not resolve, keyed by the `binning_key` it reported: a `location_uuid` picks one of the candidates, and `null` means \"create a new bin under `Unassigned` beside them\" — always an implicit extra candidate, since a store with two full Zendikar boxes may well want a third.\n\nA resolution lives for one run; nothing remembers it. A choice naming a location that has since left the split is not honoured — the split blocks again and the next preview shows you the new candidates.\n"
          }
        }
      },
      "ResolveBinsByTemplateRequest": {
        "type": "object",
        "required": [
          "sku_ids"
        ],
        "properties": {
          "sku_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "TCGplayer SKU ids. Duplicates are collapsed; more than 1000 distinct ids is a 422."
          },
          "create": {
            "type": "boolean",
            "default": false,
            "description": "false previews (writes nothing); true creates the bins the preview reported as `new`.\n"
          },
          "bin_template_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A saved bin template of this store to resolve under. Omitted or null uses the store's default template.\n"
          }
        }
      },
      "ResolveBinsByTemplateResponse": {
        "type": "object",
        "required": [
          "template_uuid",
          "template_name",
          "results"
        ],
        "properties": {
          "template_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "template_name": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedBin"
            }
          }
        }
      },
      "ResolvedBin": {
        "type": "object",
        "required": [
          "sku_id",
          "status",
          "location_uuid",
          "path",
          "reason"
        ],
        "properties": {
          "sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "enum": [
              "existing",
              "new",
              "created",
              "unresolved"
            ],
            "description": "`existing` the bin is there; `new` it would be created (preview only); `created` this call created it; `unresolved` the template cannot render for this SKU.\n"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set for `existing` and `created`; null for `new` and `unresolved`."
          },
          "path": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Level names, outermost container first and the bin last. Empty when `unresolved`."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only when `unresolved`: `unknown_sku`, or `missing_catalog_product: <missing parts>`.\n"
          }
        }
      },
      "TemplateRelocationPlan": {
        "type": "object",
        "description": "The diff between a location subtree's stock and where the template says it belongs.",
        "properties": {
          "plan_digest": {
            "type": "string",
            "description": "Send this back to the apply route. It covers which cards move from where to where plus the inputs that decided it — deliberately not the quantities, since a sale between preview and apply moves a number without changing a single routing decision.\n"
          },
          "scope": {
            "type": "object",
            "properties": {
              "location_uuid": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "template": {
            "type": "object",
            "properties": {
              "template_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "template": {
                "type": "string"
              }
            }
          },
          "create_missing_locations": {
            "type": "boolean"
          },
          "scan_ceiling": {
            "type": "integer",
            "description": "How many stocked rows one plan will walk before refusing."
          },
          "scanned_rows": {
            "type": "integer",
            "description": "In-scope `(bin, SKU)` rows holding at least one copy. Rows a pick emptied to zero are excluded — they are the normal steady state, and planning them would mint bins for cards that are not there.\n"
          },
          "scanned_quantity": {
            "type": "integer"
          },
          "already_shelved": {
            "type": "object",
            "description": "Cards already sitting in their split — in **any** member of it, so a legitimate overflow box counts. Not a conflict and not an error: on a healthy store this is nearly everything and `moves.rows` is 0.\n",
            "properties": {
              "rows": {
                "type": "integer"
              },
              "quantity": {
                "type": "integer"
              }
            }
          },
          "moves": {
            "type": "object",
            "properties": {
              "rows": {
                "type": "integer"
              },
              "quantity": {
                "type": "integer"
              },
              "destination_bins": {
                "type": "integer"
              },
              "new_bins": {
                "type": "integer"
              }
            }
          },
          "new_bin_paths": {
            "type": "array",
            "description": "Bins the template names that the store does not have yet.",
            "items": {
              "type": "object",
              "properties": {
                "full_path": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                }
              }
            }
          },
          "blocked": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Counts keyed by `RelocationOutcome`, omitting reasons with no rows.\n"
          },
          "ambiguities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateRelocationAmbiguity"
            }
          },
          "emptied_sources": {
            "type": "array",
            "description": "Bins that would lose all or nearly all of their stock, by name and count. A bin being dismantled is the signal that something a person built on purpose is being undone — a hand-made overflow box carries no template identity, so it is neither a member of the split nor a candidate for it and nothing else would mention it.\n\nNever includes the scope root: emptying the bin you pointed at is the whole intake fan-out workflow, and a warning that is wrong every time is one people learn to click past.\n",
            "items": {
              "type": "object",
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "full_path": {
                  "type": "string"
                },
                "leaving": {
                  "type": "integer"
                },
                "on_hand": {
                  "type": "integer"
                }
              }
            }
          },
          "rows": {
            "type": "array",
            "description": "The first 250 planned rows — movers and blocked rows only. Already-shelved rows are counted above and never listed.\n",
            "items": {
              "$ref": "#/components/schemas/TemplateRelocationRow"
            }
          }
        }
      },
      "TemplateRelocationAmbiguity": {
        "type": "object",
        "description": "One split the store holds in more than one location and has not chosen between. Grouped per split rather than per SKU.\n",
        "properties": {
          "binning_key": {
            "type": "string",
            "description": "The group identifier, and what you put in `resolutions`. Round-trip it; do not render it — show `rendered_name` and each candidate's `full_path` instead. It is the key rather than a plan-scoped index because it is stable across plans, so a client can compare this run's ambiguities against the last one's.\n"
          },
          "rendered_name": {
            "type": "string"
          },
          "level": {
            "type": "string",
            "enum": [
              "bin",
              "container"
            ],
            "description": "An unresolved container blocks every bin beneath it, so this is not always the leaf.\n"
          },
          "full_path": {
            "type": "string"
          },
          "affected_sku_count": {
            "type": "integer"
          },
          "affected_quantity": {
            "type": "integer"
          },
          "candidates": {
            "type": "array",
            "description": "Ordered by `sequence_index` — the picker's own walking route, so \"the first box you reach on the shelf\" means something to whoever is choosing. `maximum_capacity` is advisory everywhere in HippoLink and is here only so a person can judge which box has room.\n",
            "items": {
              "type": "object",
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "full_path": {
                  "type": "string"
                },
                "sequence_index": {
                  "type": "integer"
                },
                "card_count": {
                  "type": "integer"
                },
                "maximum_capacity": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "suggested": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "TemplateRelocationRow": {
        "type": "object",
        "description": "One in-scope storage row's planned verdict.",
        "properties": {
          "row_number": {
            "type": "integer"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "source_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "destination_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null when the destination does not exist yet; `destination_path` names it."
          },
          "destination_path": {
            "type": "string"
          },
          "requested_quantity": {
            "type": "integer"
          },
          "resolved_quantity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "outcome": {
            "$ref": "#/components/schemas/RelocationOutcome"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReidentifyLocationProductsRequest": {
        "type": "object",
        "required": [
          "from_tcgplayer_sku_id",
          "to_tcgplayer_sku_id",
          "quantity"
        ],
        "properties": {
          "from_tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU the copies are recorded as now."
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of the SKU's rows in this bin. Omitted, the SKU must have only one stocked row here (else 422 `slot_ambiguous`).\n"
          },
          "to_tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU the copies really are."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "How many copies on the row to change."
          }
        }
      },
      "ReidentifyLocationRow": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "slot",
          "total_quantity",
          "quantity_visible"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "slot": {
            "type": "integer",
            "minimum": 0
          },
          "total_quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          }
        }
      },
      "ReidentifyLocationProductsResponse": {
        "type": "object",
        "required": [
          "from",
          "to",
          "unit_costs",
          "first_priced"
        ],
        "properties": {
          "from": {
            "description": "The source row after the change; null when every copy on it changed.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReidentifyLocationRow"
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "$ref": "#/components/schemas/ReidentifyLocationRow"
          },
          "unit_costs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The distinct per-copy costs carried to the new SKU, oldest first, as decimal strings."
          },
          "first_priced": {
            "type": "boolean",
            "description": "True when the new SKU had no price and this call gave it one from the store's rules."
          }
        }
      },
      "RelocationOutcome": {
        "type": "string",
        "enum": [
          "moved",
          "skipped",
          "already_at_destination",
          "no_stock",
          "insufficient_stock",
          "active_fulfillment_run",
          "unknown_source_location",
          "ambiguous_source_location",
          "unknown_destination_location",
          "ambiguous_destination_location",
          "destination_is_container",
          "invalid_row",
          "ambiguous_destination",
          "missing_catalog_product"
        ],
        "description": "One row's verdict in a relocation job. Three of these are not failures: `moved`, `skipped` (the row's `New Location` was blank, or named the bin it is already in — ignored, not counted, not an error), and `already_at_destination` (the source holds none of the card but the destination already holds at least the requested quantity, which is what re-uploading an applied file looks like). Everything else is a conflict.\nOn a dry run every value means \"would\": the preview is authoritative about resolution and advisory about quantities, since a blank `Move Quantity` resolves against live stock and something may sell between the preview and the apply.\n\nThe last two are reachable only from a template plan (#2346). `ambiguous_destination` is **not** a spelling of `ambiguous_destination_location` above: that one is two bins sharing a NAME under one parent, which `Location Id` exists to disambiguate, while this one is a split the store legitimately holds in two bins — a shelf box and an overflow box — where picking either would undo an arrangement the store built on purpose. `missing_catalog_product` is a stocked card whose printing the catalog has not ingested yet, so the template cannot name its bin; the card stays exactly where it is.\n"
      },
      "RelocationJobRow": {
        "type": "object",
        "required": [
          "row_number",
          "outcome"
        ],
        "properties": {
          "row_number": {
            "type": "integer",
            "description": "The row's line number in the uploaded file, counting the header as row 1 — the number the store sees in their own spreadsheet.\n"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Null only when the row's own `TCGplayer Id` cell could not be read."
          },
          "source_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "destination_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null when the destination could not be resolved, and also on a dry run whose `New Location` names a bin that does not exist yet and would be created — a dry run writes nothing, so there is no id to report. `detail` names the path in that case.\n"
          },
          "requested_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What the file asked for. Null when `Move Quantity` was blank, which means the whole of what the source bin holds — read live at apply time, never from the file's own `On Hand` cell.\n"
          },
          "resolved_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What actually moved, or on a dry run what would have."
          },
          "outcome": {
            "$ref": "#/components/schemas/RelocationOutcome"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable reason, for the outcomes that have one."
          }
        }
      },
      "RelocationJob": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncJob"
          },
          {
            "type": "object",
            "properties": {
              "dry_run": {
                "type": "boolean",
                "description": "True when the job resolved every row and reported the plan without moving anything.\n"
              },
              "create_missing_locations": {
                "type": "boolean",
                "description": "Whether a destination the store does not have was created rather than reported `unknown_destination_location`.\n"
              },
              "plan_source": {
                "type": "string",
                "enum": [
                  "file",
                  "template",
                  "move_undo"
                ],
                "description": "`file` for the CSV round-trip (#2333); `template` for a move planned from the store's bin template (#2346); `move_undo` for `undoLocationMove`, a bulk move's own record reversed (#3373). One job type with several plan sources — everything after the plan is identical.\n"
              },
              "already_shelved": {
                "type": "integer",
                "description": "Template plans only: rows already sitting in the split their template names. A count rather than per-row detail, because on a reconcile run that is nearly every row and \"0 moved, 150,000 already shelved\" is the whole report. 0 on a CSV job.\n"
              },
              "scope_deleted": {
                "type": "boolean",
                "description": "Template plans only: true when the job was asked to `delete_scope_when_empty` and the scope bin was empty and removed. False otherwise, including when the bin was kept because it still held stock.\n"
              },
              "scope_delete_failed": {
                "type": "boolean",
                "description": "Template plans only: true when the scope bin was empty enough to try but the delete raised, so the bin is still there. The move itself is unaffected. Distinguishes a failure from a bin kept because it still held stock (`scope_deleted` false and this false).\n"
              },
              "completed_at": {
                "type": "string",
                "format": "date-time"
              },
              "rows_total": {
                "type": "integer"
              },
              "rows_processed": {
                "type": "integer"
              },
              "moved": {
                "type": "integer",
                "description": "Rows whose cards moved (or, on a dry run, would move)."
              },
              "skipped": {
                "type": "integer",
                "description": "Rows with a blank `New Location`, or one naming the row's current bin."
              },
              "already_at_destination": {
                "type": "integer"
              },
              "quantity_moved": {
                "type": "integer",
                "description": "Physical copies that changed shelf, not rows — a store re-shelving 5,000 copies across 900 rows wants this number.\n"
              },
              "conflicts": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "Conflict counts keyed by `RelocationOutcome`, omitting reasons with no rows. Every non-conflict outcome has its own field above.\n"
              },
              "rows": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RelocationJobRow"
                },
                "description": "Per-row detail, oldest file row first, capped at the first 250 rows. The full set is in the downloadable report.\n"
              },
              "report_url": {
                "type": "string",
                "format": "uri",
                "description": "Pre-signed download URL for the report CSV — the store's own columns plus `Result` and `Detail`. Present only when status is \"completed\".\n"
              },
              "error": {
                "type": "string",
                "description": "User-facing reason the whole job failed — a file the worker could not read, a missing required column, or a row count over the 20,000 cap (which fails with nothing moved). Present when status is \"failed\". Never raw exception text.\n"
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Stable `<resource>_<condition>` code, e.g. `import_file_unreadable` or `job_retries_exhausted`. Present when status is \"failed\", beside the user-facing `error` message, and while a pending job waits for an automatic retry (`*_attempt_failed`).\n"
              }
            }
          }
        ]
      },
      "ImportJob": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncJob"
          },
          {
            "type": "object",
            "properties": {
              "job_type": {
                "type": "string",
                "enum": [
                  "import",
                  "revert"
                ],
                "description": "`import` for a normal CSV/API import, `revert` for a job that undoes a completed import's recorded effects (#1366). A relocation job (#2333) is also an `import_jobs` row but is never returned here — it has its own routes and its own `RelocationJob` shape.\n"
              },
              "source_job_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "Present only on a `revert` job — the import job it targets.\n"
              },
              "reverted_at": {
                "type": "string",
                "format": "date-time",
                "description": "Present only on a source import job once a revert job for it has completed. The import can be reverted again only when `revert_retryable` is true.\n"
              },
              "tag_review_state": {
                "type": "string",
                "enum": [
                  "none",
                  "processing",
                  "pending",
                  "applied",
                  "discarded",
                  "expired",
                  "reverted"
                ],
                "description": "Present on an import job (`job_type: import`), on both the status route and each import row of `listJobs`; absent on a revert job. What became of the tag changes the file's `HippoLink Tags` column staged: `none` when it staged nothing, otherwise the review's state (see `getImportTagReview`). Link to the review unless it is `none` or `processing`.\n"
              },
              "revert_retryable": {
                "type": "boolean",
                "description": "Present on an import job. True when the latest completed revert left work a later run could finish (a pick run or open order held copies, or a row changed since), so the import can be reverted again.\n"
              },
              "location_strategy": {
                "type": "string",
                "enum": [
                  "single",
                  "set_code",
                  "csv_location",
                  "split_bins",
                  "smart_binning",
                  "template",
                  "absolute_chaos"
                ],
                "description": "The location strategy used for this import job. `set_code` and `smart_binning` are frozen aliases that compile to `template`; both report the template they ran with in `bin_name_template`.\n"
              },
              "bin_name_template": {
                "type": "string",
                "description": "The bin-name template this job actually ran with — a snapshot of the text, not a reference to a saved template, so it still says what the job built after the saved row is edited or deleted. Absent for `single` / `csv_location` / `split_bins`, and for jobs that ran before templates existed.\n"
              },
              "sync_columns": {
                "type": "boolean",
                "description": "Present and true when this job read its rows under the sync contract (`Add to Quantity` as a strict delta where the file carried that column and the file's own quantity column where it did not, `TCG Marketplace Price` as a price override where the file carried that column and the file's own price column where it did not, `My Store Reserve Quantity` as the store reserve). True for every `template` job created since the contract stopped being a request's choice; false only for ones queued before that, and for `set_code`.\n"
              },
              "lock_prices": {
                "type": "boolean",
                "description": "Present and true when this job was created with `lock_prices` and so wrote no price from its file.\n"
              },
              "price_from_rules": {
                "type": "boolean",
                "description": "Present and true when this job was created with `price_from_rules`.\n"
              },
              "rules_pricing_status": {
                "type": "string",
                "enum": [
                  "completed",
                  "failed",
                  "skipped_too_large"
                ],
                "description": "What a completed `price_from_rules` job's rule pricing did. `failed` and `skipped_too_large` (more than 50,000 cards to consider) leave the import itself complete, with its cards unpriced until the next scheduled reprice. Only cards stocked in a listable bin are considered.\n"
              },
              "rules_priced": {
                "type": "integer",
                "description": "Cards the store's repricing rules priced as this import finished. Present when `rules_pricing_status` is `completed`.\n"
              },
              "rules_needs_attention": {
                "type": "integer",
                "description": "Cards this import left in stock without a price that no rule priced. Present with `rules_priced`.\n"
              },
              "cost_batch_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "Present when this import's cards joined a cost batch, at create time or afterwards (`assignImportToCostBatch`).\n"
              },
              "cost_batch_copies": {
                "type": "integer",
                "description": "Copies this import added to its cost batch. Present with `cost_batch_uuid`."
              },
              "bin_size": {
                "type": "integer",
                "description": "Cards per bin. `split_bins` and `absolute_chaos` only."
              },
              "bin_name_prefix": {
                "type": "string",
                "description": "The bin label prefix, when one was given. `split_bins` and `absolute_chaos` only."
              },
              "start_new_bin": {
                "type": "boolean",
                "description": "`absolute_chaos` only: true when the import starts in a new bin instead of topping off the container's last one.\n"
              },
              "dry_run": {
                "type": "boolean",
                "description": "`absolute_chaos` only: true on a preview, which planned the bins and wrote nothing else; false on the job `applyImportPreview` created from one.\n"
              },
              "plan_digest": {
                "type": "string",
                "description": "`absolute_chaos` previews only, once completed: send it to `applyImportPreview`.\n"
              },
              "preview_job_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "`absolute_chaos` applies only: the preview this job was created from."
              },
              "bins_topped_off": {
                "type": "integer",
                "description": "`absolute_chaos` only, when completed: existing bins the plan tops off (0 or 1, the container's last bin).\n"
              },
              "bins_created": {
                "type": "integer",
                "description": "`absolute_chaos` only, when completed: bins the plan creates."
              },
              "copies_planned": {
                "type": "integer",
                "description": "`absolute_chaos` only, when completed: copies the plan files."
              },
              "unmatched": {
                "type": "array",
                "description": "`absolute_chaos` only, when the job failed with `unmatched_skus`: every file row whose SKU HippoLink's catalog does not have (or that names none). Nothing was imported.\n",
                "items": {
                  "type": "object",
                  "required": [
                    "file_row",
                    "sku_id"
                  ],
                  "properties": {
                    "file_row": {
                      "type": "integer",
                      "description": "1-based data row of the file."
                    },
                    "sku_id": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "format": "int64"
                    }
                  }
                }
              },
              "location_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Destination location UUID from the request (set for 'single', 'split_bins' and 'absolute_chaos'; null for the strategies that fan out across many locations).\n"
              },
              "location_parent_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Parent container of location_uuid, resolved server-side. Null if location_uuid sits at the root level or is itself null.\n"
              },
              "completed_at": {
                "type": "string",
                "format": "date-time"
              },
              "rows_processed": {
                "type": "integer",
                "description": "Number of rows processed so far"
              },
              "rows_total": {
                "type": "integer",
                "description": "Total rows in the CSV"
              },
              "imported": {
                "type": "integer",
                "description": "Present when status is completed"
              },
              "created": {
                "type": "integer",
                "description": "Present when status is completed"
              },
              "updated": {
                "type": "integer",
                "description": "Present when status is completed — only applicable in merge mode"
              },
              "skipped": {
                "type": "integer",
                "description": "Present when status is completed"
              },
              "unsupported_count": {
                "type": "integer",
                "description": "Number of rows skipped because their SKU could not be matched in the HippoLink catalog. Subset of `skipped`. Present when status is completed.\n"
              },
              "download_url": {
                "type": "string",
                "format": "uri",
                "description": "Pre-signed download URL for the originally uploaded source file. Present only when status is \"completed\" and the job came from a file upload (absent for an api-source import or a revert job, neither of which has an uploaded file). The underlying object expires 30 days after upload, after which this URL 404s.\n"
              },
              "download_expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the source file is purged from storage. Present only alongside `download_url`. Approximate: the purge runs asynchronously and can lag by up to a day.\n"
              },
              "removed_count": {
                "type": "integer",
                "description": "Replace-mode override only: number of SKUs the override wiped entirely (in the bin, not in the file). 0 for merge imports. Present when status is completed and mode is replace. Detail via `GET .../import/{import_job_uuid}/discrepancies`.\n"
              },
              "reduced_count": {
                "type": "integer",
                "description": "Replace-mode override only: number of SKUs the override left with fewer copies than before (file qty < pre-wipe qty). 0 for merge imports. Present when status is completed and mode is replace.\n"
              },
              "already_reverted_count": {
                "type": "integer",
                "description": "Revert jobs only: number of pairs the ledger scan found already restored to their expected outcome by a prior (possibly partial) revert attempt on the same source job — a no-op, not a skip. Present when status is completed and job_type is revert.\n"
              },
              "error": {
                "type": "string",
                "description": "User-facing reason the whole import failed (e.g. a malformed file or a parse-time contract violation). Present when status is failed. Never raw exception text. Distinct from the per-row `errors` array — this is the single \"why did the job fail\" message.\n"
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Stable `<resource>_<condition>` code, e.g. `import_file_unreadable` or `job_retries_exhausted`. Present when status is \"failed\", beside the user-facing `error` message, and while a pending job waits for an automatic retry (`*_attempt_failed`).\n"
              },
              "errors": {
                "type": "array",
                "description": "Row-level errors. Present when status is failed, or when status is completed and one or more rows were skipped.\n",
                "items": {
                  "type": "object",
                  "required": [
                    "row",
                    "error",
                    "error_code"
                  ],
                  "properties": {
                    "row": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string",
                      "enum": [
                        "unsupported_product",
                        "row_invalid",
                        "ambiguous_printing",
                        "unmatched_skus",
                        "plan_changed",
                        "tag_name_invalid",
                        "tag_name_ambiguous",
                        "tag_not_assignable",
                        "tag_hotlist_not_allowed",
                        "tag_staging_failed",
                        "ERR_UNKNOWN_SOURCE",
                        "ERR_CONTRACT_VIOLATION",
                        "ERR_UNMAPPED_VALUE",
                        "ERR_TYPE_MISMATCH",
                        "ERR_AMBIGUOUS_SOURCE",
                        "ERR_CSV_DIALECT",
                        "ERR_ENCODING",
                        "revert_skipped_drifted",
                        "revert_skipped_restocked",
                        "revert_skipped_lot_consumed",
                        "revert_skipped_ambiguous",
                        "revert_partial_picking",
                        "revert_partial_gone",
                        "revert_partial_committed",
                        "revert_lot_pass_failed"
                      ],
                      "description": "Machine-readable category for the error. `unsupported_product` and `row_invalid` are per-row import failures; `ambiguous_printing` is also a per-row failure, but distinct from `unsupported_product` -- the row matched more than one distinct printing (e.g. a Showcase treatment and its normal-frame sibling sharing a bare name+set) and needs a disambiguating field (a collector number or Scryfall id) added, rather than sourcing a missing product; `unmatched_skus` (one row per file row) and `plan_changed` (one job-level row) fail an `absolute_chaos` job with nothing written: a SKU HippoLink does not have, or the container's last bin changed since the preview; the `ERR_*` codes are PRISM parse failures that aborted the whole import; the `tag_*` codes are warnings about the `HippoLink Tags` column (an unusable or ambiguous tag name, a product that cannot take the tag, the hotlist on a graded card, or staging failing for a row): the row's stock still imported and its tag changes were left out; the `revert_skipped_*` codes are rows a revert job (#1366) left untouched because current state no longer matched what the import being reverted recorded — `revert_skipped_ambiguous` specifically means the source import's own ledger rows for that row couldn't be reconstructed into a single before/after span (a ledger anomaly, not a state mismatch). `revert_lot_pass_failed` is a single job-level row, not a per-card one: the revert's cost-basis-lot cleanup failed and rolled back, so every FIFO lot the import created survives even though the quantity reverts committed. The `revert_partial_*` codes come from reverting a merge import, which takes back the copies the import added: `revert_partial_picking` means an active pick run holds the card in that bin, so nothing was removed; `revert_partial_gone` means fewer copies are in the bin than the import added, because they were sold or moved; `revert_partial_committed` means open orders (or a holding bin's pre-pulled orders) still need some of the copies, so those were kept. A row a drifted replace revert skipped carries `raw_row.changed_by`, naming what changed it. `revert_partial_picking`, `revert_partial_committed`, `revert_skipped_drifted` and `revert_skipped_restocked` make the import retryable (`revert_retryable`), because a later revert can finish that work.\n"
                    },
                    "raw_row": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true,
                      "description": "Snapshot of the skipped source row's card-identifying fields (e.g. `product_name`, `set_name`, `condition`, `finish`, `quantity`, `sku_number`) so a store can find the row in their source file rather than relying on the bare `row` index. Empty fields are omitted. `null` for older jobs and for parse failures that carry no row; a parse-time type/mapping failure instead carries `{field, value}`.\n"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ImportOverrideDiscrepancy": {
        "type": "object",
        "description": "A card a replace/override import removed or reduced (#1190), aggregated per SKU across the wiped bin. A `single` replace has one bin; a `csv_location` replace clears and diffs each bin the file names, so one SKU removed from two bins is two rows, each naming its own bin in `location_uuid` / `location_path`. `qty_before` is the pre-wipe quantity; `qty_after` is what the file restocked (0 for `removed`, a smaller positive value for `reduced`). `unit_cost_before` is the FIFO cost basis of the lost units captured at wipe time (null when uncosted). Pending until the store classifies it; a `shrinkage_*` mark writes the shrinkage ledger row that reaches the shrinkage report, `manual_correction` a non-loss.\n",
        "required": [
          "discrepancy_uuid",
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "qty_before",
          "qty_after",
          "lost_quantity",
          "discrepancy_type",
          "status"
        ],
        "properties": {
          "discrepancy_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin the override replaced (null if it was later deleted)."
          },
          "location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The replaced bin's breadcrumb, e.g. `Back Room > Shelf A`, as it reads now; null if the bin was later deleted.\n"
          },
          "qty_before": {
            "type": "integer",
            "description": "Quantity in the bin before the override wiped it."
          },
          "qty_after": {
            "type": "integer",
            "description": "Quantity the file restocked (0 for removed, smaller-than-before for reduced)."
          },
          "lost_quantity": {
            "type": "integer",
            "description": "qty_before − qty_after — the units this override cost the bin."
          },
          "unit_cost_before": {
            "type": [
              "number",
              "null"
            ],
            "description": "FIFO unit cost of the lost units at wipe time; null when uncosted."
          },
          "loss_value": {
            "type": [
              "number",
              "null"
            ],
            "description": "unit_cost_before × lost_quantity; null when uncosted."
          },
          "discrepancy_type": {
            "type": "string",
            "enum": [
              "removed",
              "reduced"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "marked"
            ]
          },
          "removal_reason": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RemovalReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reason chosen when marked; null while pending."
          },
          "marked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "marked_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Supabase sub of whoever marked the row."
          }
        }
      },
      "ImportJobRow": {
        "type": "object",
        "description": "A bin-and-SKU an import wrote. `outcome` is `created` when the import inserted the pair and `updated` when it already existed. A file that repeats a SKU across batches yields a row per batch, which keeps these equal to the job's `created` and `updated` counters.\n",
        "required": [
          "outcome",
          "tcgplayer_sku_id",
          "quantity_before",
          "quantity_after"
        ],
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "created",
              "updated"
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin the import wrote to (null if it was later deleted)."
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bin's full path from its root, e.g. `Shelf A > Box 2`."
          },
          "quantity_before": {
            "type": "integer",
            "description": "Quantity in the bin before this import batch (0 for `created`)."
          },
          "quantity_after": {
            "type": "integer"
          }
        }
      },
      "ImportJobRowListResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "counts",
          "rows"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Rows matching the `outcome` filter (regardless of pagination)."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "description": "Row totals per outcome, regardless of the `outcome` filter.",
            "required": [
              "created",
              "updated"
            ],
            "properties": {
              "created": {
                "type": "integer"
              },
              "updated": {
                "type": "integer"
              }
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportJobRow"
            }
          }
        }
      },
      "ImportTagReviewTag": {
        "type": "object",
        "required": [
          "key",
          "name",
          "slug",
          "color",
          "is_new",
          "system",
          "description",
          "adds",
          "removes",
          "status"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Identifies the entry; pass it as `key` to list its products."
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "The existing tag's slug; null for a tag the apply would create."
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "description": "The existing tag's chip color; null for a tag the apply would create, and for a tag with no color set (the frontend picks one).\n"
          },
          "is_new": {
            "type": "boolean",
            "description": "True when applying would create the tag."
          },
          "system": {
            "type": "boolean",
            "description": "True for a system tag such as the hotlist."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "adds": {
            "type": "integer",
            "description": "Products the tag would be added to."
          },
          "removes": {
            "type": "integer",
            "description": "Products the tag would be removed from."
          },
          "status": {
            "type": "string",
            "description": "The status of the entry's rows, or `mixed` when they differ."
          }
        }
      },
      "ImportTagReview": {
        "type": "object",
        "required": [
          "state",
          "expires_at",
          "tags",
          "warnings_count"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "processing",
              "pending",
              "applied",
              "discarded",
              "expired",
              "reverted"
            ],
            "description": "See `getImportTagReview` for how it is derived."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a pending review expires; null while processing and once nothing is pending."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportTagReviewTag"
            }
          },
          "warnings_count": {
            "type": "integer"
          }
        }
      },
      "ImportTagProduct": {
        "type": "object",
        "required": [
          "tcgplayer_product_id",
          "game",
          "action",
          "status",
          "product_name",
          "set_name",
          "image_uri",
          "quantity"
        ],
        "properties": {
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "game": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "add",
              "remove"
            ]
          },
          "status": {
            "type": "string"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer",
            "description": "Copies of the product the store has on hand."
          }
        }
      },
      "ApplyImportTagsRequest": {
        "type": "object",
        "required": [
          "keys"
        ],
        "properties": {
          "keys": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "The `key` of each tag to apply, from `getImportTagReview`."
          },
          "colors": {
            "type": "object",
            "description": "The color to create a new tag with, keyed by that tag's `key` (`new:...`). Every key must also be in `keys` and be a new tag's. A new tag with no color here is created with none (the frontend picks one); a new name that attaches to one of the store's tags keeps that tag's color.\n",
            "additionalProperties": {
              "type": "string",
              "pattern": "^#[0-9A-Fa-f]{6}$",
              "example": "#3B82F6"
            }
          }
        }
      },
      "ImportTagApplyResult": {
        "type": "object",
        "required": [
          "applied",
          "noop",
          "refused_products",
          "refused_tags",
          "created_tags"
        ],
        "properties": {
          "applied": {
            "type": "integer",
            "description": "Changes that added or removed a tag on a card."
          },
          "noop": {
            "type": "integer",
            "description": "Changes already in place (the card had, or lacked, the tag)."
          },
          "refused_products": {
            "type": "array",
            "description": "Cards whose changes were refused because they would carry more than `limit` store tags.",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_product_id",
                "limit"
              ],
              "properties": {
                "tcgplayer_product_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "limit": {
                  "type": "integer"
                }
              }
            }
          },
          "refused_tags": {
            "type": "array",
            "description": "Tags nothing was applied for: a new name that now matches two or more of the store's tags, or a tag the store deleted since the import.\n",
            "items": {
              "type": "string"
            }
          },
          "created_tags": {
            "type": "array",
            "description": "Names of the tags this apply created.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApplyImportPreviewRequest": {
        "type": "object",
        "required": [
          "plan_digest"
        ],
        "properties": {
          "plan_digest": {
            "type": "string",
            "description": "The preview's `plan_digest`, from its job status."
          },
          "confirm_duplicate": {
            "type": "boolean",
            "default": false,
            "description": "Apply even though the same file was already imported by an earlier non-reverted merge import of the store (409 `duplicate_import_file`).\n"
          }
        }
      },
      "ImportPlanBinListResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "bins"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Bins in the job's plan (regardless of pagination)."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPlanBin"
            }
          }
        }
      },
      "ImportPlanBin": {
        "type": "object",
        "description": "One bin of an Absolute Chaos Binning plan: on a preview, where the cards will go; on the applied job, the filing report.\n",
        "required": [
          "bin_number",
          "name",
          "location_uuid",
          "existed",
          "fill_before",
          "fill_after",
          "segments"
        ],
        "properties": {
          "bin_number": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "description": "The bin's name when the plan was made, `<prefix> N`."
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin. Null on a preview for a bin the import will create."
          },
          "existed": {
            "type": "boolean",
            "description": "True for the container's last bin, which the plan tops off."
          },
          "fill_before": {
            "type": "integer",
            "description": "Copies the bin held before this job (0 for a new bin)."
          },
          "fill_after": {
            "type": "integer",
            "description": "Copies the bin holds once this job's cards are filed."
          },
          "segments": {
            "type": "array",
            "description": "The runs filed into this bin, in file order.",
            "items": {
              "$ref": "#/components/schemas/ImportPlanSegment"
            }
          }
        }
      },
      "ImportPlanSegment": {
        "type": "object",
        "description": "A run of one file row's copies in one bin. A row that continues into the next bin is two runs.",
        "required": [
          "file_row",
          "sku_id",
          "product_name",
          "set_name",
          "condition",
          "finish",
          "copies",
          "position_start",
          "position_end"
        ],
        "properties": {
          "file_row": {
            "type": "integer",
            "description": "1-based data row of the file."
          },
          "sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The row's TCGplayer SKU id."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "copies": {
            "type": "integer",
            "minimum": 1
          },
          "position_start": {
            "type": "integer",
            "minimum": 1,
            "description": "1-based position in the bin when filed. Not kept in step with the shelf: once cards ahead of it sell, the card's live position is lower.\n"
          },
          "position_end": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "ImportDiscrepancyListResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "discrepancies"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total discrepancies matching the filters (regardless of pagination)."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "discrepancies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportOverrideDiscrepancy"
            }
          }
        }
      },
      "MarkImportDiscrepanciesRequest": {
        "type": "object",
        "required": [
          "removal_reason"
        ],
        "description": "Marks the selected discrepancies (or every pending one when `all` is true) with one removal reason. Exactly one of `discrepancy_uuids` or `all` should be supplied.\n",
        "properties": {
          "removal_reason": {
            "$ref": "#/components/schemas/RemovalReason"
          },
          "discrepancy_uuids": {
            "type": "array",
            "description": "The discrepancies to mark. Ignored when `all` is true.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "all": {
            "type": "boolean",
            "default": false,
            "description": "Mark every pending discrepancy on this job."
          }
        }
      },
      "MarkImportDiscrepanciesResponse": {
        "type": "object",
        "required": [
          "marked",
          "skipped",
          "removal_reason"
        ],
        "properties": {
          "marked": {
            "type": "integer",
            "description": "Pending rows marked by this request."
          },
          "skipped": {
            "type": "integer",
            "description": "Selected rows left unchanged because they were already marked (marking is one-way). Always 0 for an `all` request.\n"
          },
          "removal_reason": {
            "$ref": "#/components/schemas/RemovalReason"
          }
        }
      },
      "IntakeInsertAfterSku": {
        "type": "object",
        "required": [
          "mode",
          "after_tcgplayer_sku_id"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "const": "after_sku"
          },
          "after_tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "Existing SKU at the destination. The new card lands right behind its last row (or the row `after_slot` names); later rows shift down. 422 if the SKU is not in the destination bin.\n"
          },
          "after_slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of the anchor SKU's rows to land behind. Omitted, the new card lands after the anchor SKU's last row in shelf order.\n"
          }
        }
      },
      "IntakeInsertAlphabetical": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "const": "alphabetical"
          }
        },
        "description": "Place each card at its alphabetical spot among the cards already in the bin, ordered by card name A-Z (case- and accent-insensitive), then set name, collector number (natural order), condition (Near Mint first), language (English first), finish (non-foil first) and SKU. A card with no catalog name sorts last. The bin's existing order is never changed; a card goes in front of the first card that sorts after it, so a bin that is already A-Z stays A-Z. A card the bin already holds joins its row. Other rows normally keep their `sequence_index`; a densely numbered bin is re-spaced once, in order, to make room.\n"
      },
      "IntakeInsertBottom": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "const": "bottom"
          }
        },
        "description": "Append to the end of the bin (current default)."
      },
      "IntakeInsertPosition": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/IntakeInsertBottom"
          },
          {
            "$ref": "#/components/schemas/IntakeInsertTop"
          },
          {
            "$ref": "#/components/schemas/IntakeInsertAfterSku"
          },
          {
            "$ref": "#/components/schemas/IntakeInsertAlphabetical"
          }
        ],
        "discriminator": {
          "propertyName": "mode",
          "mapping": {
            "bottom": "#/components/schemas/IntakeInsertBottom",
            "top": "#/components/schemas/IntakeInsertTop",
            "after_sku": "#/components/schemas/IntakeInsertAfterSku",
            "alphabetical": "#/components/schemas/IntakeInsertAlphabetical"
          }
        }
      },
      "IntakeInsertTop": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "const": "top"
          }
        },
        "description": "Insert at sequence_index = 1; existing rows in the bin shift down by 1."
      },
      "IntakeAbsoluteChaosTarget": {
        "type": "object",
        "description": "An Absolute Chaos Binning container to file an intake item into, instead of one named bin. The item's copies are filed behind the container's last bin and spill into new bins of `bin_size` cards as each fills. With `bin_uuid`, every copy in the request goes at the back of that one bin instead, and no bin is created.\n",
        "required": [
          "container_uuid",
          "bin_size"
        ],
        "properties": {
          "container_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The container to file into. 404 when it is missing, deleted or another store's; 422 when it is a bin rather than a container; 409 `holding_move_refused` for a holding container.\n"
          },
          "bin_size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000,
            "description": "How many cards each bin holds. A whole number from 1 to 100000. One request may file into at most 250 bins; more is a 422 on `quantity`.\n"
          },
          "bin_name_prefix": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional name prefix for bins created. It can't contain \">\"."
          },
          "bin_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Optional. File every copy in the request at the back of this bin of the container, instead of the last bin. It must be a live bin directly in `container_uuid` (422 on `absolute_chaos.bin_uuid` otherwise); a holding bin is 409 `holding_move_refused`. Copies never spill into another bin. When the request's total quantity is more than the bin's room (its `maximum_capacity`, or `bin_size` when it has none, minus the cards already in it), the request is refused 422 `absolute_chaos_bin_full` with `params` `{bin_uuid, bin_name, room}`, and nothing is written. Every item in one request names the same `bin_uuid`.\n"
          }
        }
      },
      "IntakePlacement": {
        "type": "object",
        "description": "One bin's share of a targeted intake item.",
        "required": [
          "location_uuid",
          "bin_name",
          "bin_number",
          "bin_created",
          "copies",
          "position_start",
          "position_end",
          "slot",
          "transaction_uuid"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The bin the copies were filed into."
          },
          "bin_name": {
            "type": "string"
          },
          "bin_number": {
            "type": [
              "integer",
              "null"
            ],
            "description": "N when the bin is named `<bin_name_prefix> N`. Null only for a chosen `bin_uuid` whose name is not of that form.\n"
          },
          "bin_created": {
            "type": "boolean",
            "description": "True when this intake created the bin. Always false for a chosen `bin_uuid`."
          },
          "copies": {
            "type": "integer",
            "description": "Copies of the item filed into this bin."
          },
          "position_start": {
            "type": "integer"
          },
          "position_end": {
            "type": "integer"
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "maximum": 32767
          },
          "transaction_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The inventory transaction that filed these copies."
          }
        }
      },
      "IntakeItem": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "quantity",
          "unit_cost"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGplayer SKU identifier. Must exist in the global identifiers table."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Units to intake. Added to total_quantity at the destination."
          },
          "unit_cost": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
            "description": "Decimal as string, up to 6 fractional digits. Stored as purchase_price_at_event on the transaction and unit_cost on the lot."
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Destination inventory location. Must belong to the same store and be non-deleted. Exactly one of `location_uuid` or `absolute_chaos` is required (422 otherwise).\n"
          },
          "absolute_chaos": {
            "$ref": "#/components/schemas/IntakeAbsoluteChaosTarget",
            "description": "File into an Absolute Chaos container instead of a named bin. Exactly one of `location_uuid` or `absolute_chaos` is required, and every item of a request must name the same target. Needs the `locations.manage` permission (403), since it may create bins. Not allowed beside `insert_position` (422). The result carries `placements`.\n"
          },
          "quantity_visible": {
            "type": "integer",
            "minimum": 0,
            "description": "Defaults to quantity. Must be less than or equal to quantity. Buylist push passes 0 for holding-location intake."
          },
          "reason_code": {
            "type": "string",
            "enum": [
              "purchase",
              "restock",
              "manual_correction",
              "import",
              "other"
            ],
            "default": "purchase",
            "description": "Transaction reason. Buylist push uses purchase."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Per-item key. Re-using a prior key returns the prior result without re-writing."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Optional metadata stored on the inventory transaction."
          },
          "retail_price": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
            "description": "Optional base listing price in USD (max 2 decimal places, min 0.01). When provided, upserts pricing_data.retail_price so the SKU is immediately listable on marketplaces instead of waiting for the next repricing run (up to ~12h). Omit to preserve current behaviour. Requires the `inventory.set_sell_price` permission -- store_manager and above by default, grantable to store_employee by the store -- since the sell price is a narrower decision than unit_cost. A caller without it is refused 403, and the message names the offending item's index.\n"
          },
          "lock_price": {
            "type": "boolean",
            "default": false,
            "description": "Lock the `retail_price` this item sets, in the same transaction, so reprice runs leave it alone from the start -- the same lock `createPriceLock` sets. Only valid beside a `retail_price` (400 otherwise). False or absent leaves an existing lock as it is; it never unlocks. The lock belongs to the SKU, so when several items in one call name the same SKU, the last price written is the one locked. Needs the `inventory.manage_price_locks` permission (403, naming the item). Ignored on an item that replays a prior `idempotency_key`, which writes nothing.\n"
          },
          "reserve_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000,
            "description": "How many of THIS item's units to hold back from the online marketplaces for in-store use. A value above `quantity` also holds back copies the SKU already had and requires the `inventory.reserve_beyond_intake` permission (store_manager and above by default); a caller without it is refused 403. Added to the SKU's existing `pricing_data.reserved_for_store` rather than replacing it, so two intakes reserving 2 each leave the SKU reserving 4. Absent, null and 0 all mean \"reserve none of these\" and leave the current reserve untouched -- clearing a reserve, or setting an absolute one, is `PATCH /v1/stores/{store_uuid}/inventory`'s job. The resulting reserve caps this write's own `quantity_visible`, so the held copies are never listed in the first place, and pulls the SKU's listing down across every bin that holds it. Ignored on an item that replays a prior `idempotency_key`, which writes nothing.\n"
          },
          "cost_batch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Put this item's copies into an open cost batch. The lot it makes carries `unit_cost` as a provisional cost until the batch is finished, when the batch's total is spread across every card it holds. Needs the `inventory.manage_cost_batches` permission (403, naming the item). 404 for an unknown batch, 409 (`cost_batch_not_open`) for one that is finishing or finished; either refuses the whole intake. Not allowed with `reason_code: buylist_purchase` (400).\n"
          },
          "insert_position": {
            "$ref": "#/components/schemas/IntakeInsertPosition",
            "description": "Where to place a brand-new (location_uuid, tcgplayer_sku_id) row within the bin's sequence_index ordering. Refused (422) beside `absolute_chaos`. Ignored when the row already exists (ON CONFLICT keeps the existing position). Omit for the default ``{mode: bottom}``; ``{mode: alphabetical}`` places the card at its A-Z spot among the bin's cards.\n"
          }
        }
      },
      "IntakeResult": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "quantity",
          "quantity_visible",
          "lot_id",
          "transaction_uuid",
          "idempotent_replay"
        ],
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`). The listings catch up on the next push sweep, within about 30 minutes. Absent on a clean write and on reads.\n"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer",
            "description": "Post-intake total_quantity at the destination. For an `absolute_chaos` item that spread over several bins, the sum across them.\n"
          },
          "quantity_visible": {
            "type": "integer",
            "description": "Post-intake quantity_visible at the destination. For an `absolute_chaos` item that spread over several bins, the sum across them.\n"
          },
          "lot_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "ID of the InventoryLot created (or null if the original lot cannot be reconstructed during replay)."
          },
          "transaction_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the InventoryTransaction created."
          },
          "idempotent_replay": {
            "type": "boolean",
            "description": "True if this entry came from a prior intake with the same idempotency_key; no writes happened for this entry on this call."
          },
          "placements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntakePlacement"
            },
            "description": "Where each bin's share of the item went. Present (possibly empty) for an item sent with `absolute_chaos`, absent otherwise. Empty when a targeted retry replays a key first written by a plain intake.\n"
          }
        }
      },
      "InventoryLotSummary": {
        "type": "object",
        "required": [
          "id",
          "unit_cost",
          "remaining_quantity",
          "original_quantity",
          "received_at",
          "cost_basis_source",
          "cost_batch_uuid",
          "cost_batch_name",
          "editable"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "unit_cost": {
            "type": "number",
            "format": "double",
            "description": "Per-unit cost basis (COGS) for this lot, in USD."
          },
          "remaining_quantity": {
            "type": "integer",
            "description": "Quantity from this lot still on hand (unsold)."
          },
          "original_quantity": {
            "type": "integer",
            "description": "Quantity this lot was created with."
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this lot was received — lots are consumed oldest-first (FIFO)."
          },
          "cost_basis_source": {
            "type": "string",
            "enum": [
              "manual",
              "buylist_assumed",
              "buylist_purchase",
              "synthetic_zero",
              "cardchaos_migration",
              "batch_pending",
              "cost_batch"
            ],
            "description": "Where unit_cost came from. `manual`: a caller-supplied cost. `buylist_assumed`: Auto COGS Mode filled it from the store's own buylist offer — an estimate, correct it via the cogs endpoints if it's wrong. `buylist_purchase`: a real, agreed price from an accepted buylist purchase. `synthetic_zero`: no cost was given and no assumption applied. `cardchaos_migration`: carried over from CardChaos. `batch_pending`: a card in an open cost batch, at the cost it arrived with until the batch is finished (not editable). `cost_batch`: set when its cost batch was finished.\n"
          },
          "cost_batch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The cost batch this lot belongs to (`getCostBatch`), or null when it is in none."
          },
          "cost_batch_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That batch's name, for display. Null when the lot is in no batch."
          },
          "editable": {
            "type": "boolean",
            "description": "Whether `updateInventoryLotCogs` will accept a correction for this lot. False while its cost batch is open or finishing (that 409 carries `error` `lot_cost_locked`, with the explanation in `detail`); true otherwise.\n"
          }
        }
      },
      "QuantityVisibleClamp": {
        "type": "object",
        "description": "A write asked for more visible copies than a cap allows, or a quantity decrease left more visible than the open orders allow, and the stored value was lowered to fit. Reported so a caller can tell \"stored what you asked\" from \"stored less\".\n",
        "required": [
          "requested",
          "stored",
          "cap"
        ],
        "properties": {
          "requested": {
            "type": "integer"
          },
          "stored": {
            "type": "integer"
          },
          "cap": {
            "type": "string",
            "enum": [
              "listed_target",
              "online_listable",
              "bin_siblings",
              "non_listable_location",
              "committed_to_orders"
            ],
            "description": "`listed_target`: the SKU's effective listed target. `online_listable`: copies left after the store reserve. `bin_siblings`: the cap spread across the bin's other rows. `non_listable_location`: the bin may not carry visible stock. `committed_to_orders`: a quantity decrease would have left copies listed that open orders already own, so the listing was capped at the copies not committed to them (#4357).\n"
          }
        }
      },
      "InventoryDetail": {
        "description": "Full inventory view including market price data and card metadata not present in the summary.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "product_name",
          "condition",
          "quantity",
          "quantity_visible",
          "first_inventoried_at",
          "last_inventoried_at",
          "language",
          "finish",
          "set_name",
          "locations",
          "price_locked",
          "hotlist"
        ],
        "properties": {
          "not_listed_on": {
            "type": "array",
            "description": "Returned by the single-SKU detail read (`getInventoryBySku`), not by the write responses. Marketplaces this SKU is kept off, whatever its stock and price. `source: rule` means a `DO NOT LIST ON` repricing rule matched it; `manual` is a delist set by hand. Empty when the SKU lists everywhere it can. A rule's entry appears and clears with repricing runs.\n",
            "items": {
              "$ref": "#/components/schemas/ListingSuppression"
            }
          },
          "listing_exceptions": {
            "type": "array",
            "description": "Returned by the single-SKU detail read, like `not_listed_on`. Marketplaces the store chose to list this SKU on anyway, overriding any `DO NOT LIST ON` rule that names them (`setListingException`). A marketplace here never appears in `not_listed_on` with `source: rule`.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceMarketplace"
            }
          },
          "effective_marketplace_prices": {
            "type": [
              "array",
              "null"
            ],
            "description": "Returned by the single-SKU detail read (`getInventoryBySku`), not by the write responses. Null when the prices can't be read right now; the rest of the detail is still returned. One entry per marketplace the store is connected to: the price the push sends there, in that marketplace's currency, beside the store-currency price it comes from. Unlike `marketplace_prices` (the stored overrides as written), this includes a price converted at the store's applied rate. It is the price only: stock, `not_listed_on` and catalog mapping still decide whether the card is listed.\n",
            "items": {
              "$ref": "#/components/schemas/EffectiveMarketplacePrice"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`). The listings catch up on the next push sweep, within about 30 minutes. Absent on a clean write and on reads.\n"
          },
          "quantity_visible_clamp": {
            "description": "Present only on a write response when the stored `quantity_visible` came out lower than the one requested. `cap` names the limit that applied; the request still succeeds (200/201).\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/QuantityVisibleClamp"
              }
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant (condition/language/finish)."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product. Many SKUs per product."
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "product_name": {
            "type": "string"
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "token_pairing_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a double-sided token, the name of the back face this SKU's TCGPlayer product id is physically paired with (e.g. \"Gremlin\" on a Glimmer // Gremlin token). Null for a non-token product, a solo (single-face) token listing, or when the pairing could not be resolved. Magic only."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number within the set (e.g. \"123\", \"123a\")."
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Current inventory price in USD (two decimal places), or null if not priced"
          },
          "quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          },
          "listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
          },
          "reserved_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU quantity held back from online marketplaces for in-store use, independent of `listed_target`. Null means no reserve.\n"
          },
          "online_listable": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Store-reserve cap on `quantity_visible`: MAX(0, this SKU's quantity minus outstanding committed quantity minus reserved_for_store). Null when reserved_for_store is null.\n"
          },
          "held_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much of this SKU's quantity the reserve is currently holding back: LEAST(reserved_for_store, this SKU's quantity). Null when reserved_for_store is null.\n"
          },
          "quantity_committed": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies of this SKU still owed to open orders (sold but not yet pulled from the shelf). `quantity` does not drop until pick, so `quantity - quantity_committed` is what can still be listed; raising `quantity_visible` past that (less any `reserved_for_store`) is rejected with a 400. Always present, unlike `online_listable`. Can exceed `quantity` when the SKU is oversold.\n"
          },
          "buylist_cash": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "What the store's buylist pays for this exact grade, from the `store_buylist_offer` projection (#1913) — the buy price beside the sell price, so the margin is visible where prices are set. Null when the store's buylist rules decline the card, which is most of a typical holding. Refreshed on the store's offer-rebuild schedule, so it can lag a rule edit by up to one rebuild.\n"
          },
          "buylist_credit": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Store-credit buy offer for this SKU. Null when the rule offers cash only, or when there is no offer."
          },
          "buylist_price_locked": {
            "type": "boolean",
            "description": "Whether the buy price is frozen against the offer rebuild (#1175) — either a plain lock or a manual override (`setBuylistOfferPrice`). False when there is no offer at all.\n"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "This SKU's tags. Never null — an untagged SKU, or one with no `pricing_data` row at all, returns `[]`.\n"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-text operator note for this SKU, or null if unset."
          },
          "first_inventoried_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_at": {
            "type": "string",
            "format": "date-time"
          },
          "pricing_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Version of this SKU's pricing row (`price`, `listed_target`, `reserved_for_store`), or null if it has none yet. Echo it back as `expected_pricing_updated_at` when editing any of those fields. Distinct from `last_repriced_at`: this advances on every write to the row, a repricing run included.\n"
          },
          "language": {
            "type": "string",
            "description": "Card language"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "finish_label": {
            "type": "string",
            "description": "Display-only finish label, refined to the specific foil treatment when known (e.g. \"Surge Foil\" instead of the generic \"Foil\"). Derived from the printing's promo types; `finish` remains the canonical machine value.\n"
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card rarity (e.g. Common, Uncommon, Rare, Mythic)"
          },
          "set_name": {
            "type": "string",
            "description": "Card set or edition name"
          },
          "set_code": {
            "type": "string",
            "description": "Short set/expansion code (e.g. MKM, DSK)"
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product type (e.g. card, token, sealed, graded)"
          },
          "variation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card variation (e.g. Extended Art, Borderless), null for a card with none"
          },
          "scryfall_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Scryfall card UUID for cross-referencing"
          },
          "last_repriced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this SKU was last repriced: the moment an *existing* retail price was last replaced or cleared. Null until that first happens — giving a SKU its first price is not a reprice, and neither are edits to other pricing fields (tags, notes, listed_target, reserved_for_store). Same rule, less obvious case: if a price is cleared and later set again, this stays at the clear, because setting a price on a now-priceless SKU is again a first price. Treat it as \"last repriced\", not as \"last time this price was written\"."
          },
          "last_copy_sold_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a copy of this SKU last sold (most recent order placement), or null if never sold."
          },
          "price_locked": {
            "type": "boolean",
            "description": "Whether this SKU's retail price is locked against reprice rule changes, by its own lock or by a bin it is stocked in (see price_lock_source).\n"
          },
          "price_lock_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "bin",
              "both",
              null
            ],
            "description": "Why the price is locked: `manual` (the card's own lock, removable), `bin` (a bin it is stocked in has a standing price lock; remove it by turning that bin's lock off or moving the card out), `both`, or null when not locked.\n"
          },
          "hotlist": {
            "type": "boolean",
            "description": "Whether the store has flagged this card (product) as hotlist. Product-grained, so it is the same for every SKU of the card. Buylist rules can match it (HOTLIST condition) and the public storefront shows the flame badge.\n"
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "URI for the card's product image, or null if unavailable"
          },
          "locations": {
            "type": "array",
            "description": "Per-position breakdown: one entry per storage row, in shelf order (location `sequence_index`, then the row's place in the bin).\n",
            "items": {
              "$ref": "#/components/schemas/InventoryLocationEntry"
            }
          },
          "market_prices": {
            "$ref": "#/components/schemas/MarketPrices"
          },
          "market_prices_observed_at": {
            "type": "object",
            "description": "When each price in `market_prices` was last confirmed fresh, keyed by the same price-variable names. Falls back to the row's last update time when no refresh has confirmed it. Only keys present in `market_prices` appear.\n",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          },
          "marketplace_prices": {
            "$ref": "#/components/schemas/MarketplacePriceOverrides"
          }
        }
      },
      "InventoryLocationEntry": {
        "description": "Quantity of one SKU variant at one position (storage row) in a location. A bin can hold the same SKU at several positions; each is its own entry with the same `id` and a different `slot`.\n",
        "type": "object",
        "required": [
          "id",
          "name",
          "full_path",
          "type",
          "sequence_index",
          "quantity",
          "quantity_visible",
          "slot"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Stable UUID of the inventory location."
          },
          "name": {
            "type": "string",
            "description": "Leaf name of the location (without ancestor path)."
          },
          "full_path": {
            "type": "string",
            "description": "Full breadcrumb path computed by the database (e.g. \"Main Shelf > Aetherdrift > S\")."
          },
          "type": {
            "type": "string",
            "enum": [
              "container",
              "bin"
            ],
            "description": "Whether the location is a container (holds child locations) or a bin (holds stock directly)."
          },
          "prices_locked": {
            "type": "boolean",
            "description": "Whether this bin has a standing price lock."
          },
          "sequence_index": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Pick-path ordering index among sibling locations. Null when unordered."
          },
          "bin_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based position of this row among the bin's stocked rows in shelf order (a SKU filed at two spots has two ranks). Always set for a stocked row.\n"
          },
          "bin_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Count of stocked rows (positions) in this card's bin.\n"
          },
          "bin_position": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 1,
            "description": "Copy-depth of this row within its bin, 0.0 (front) to ~1.0 (back): copies stored ahead of this row divided by total copies in the bin. Reflects how far a picker flips through physical copies, so a card behind a large stack reads as mid-bin regardless of its own copy count. Null when the bin has no counted copies.\n"
          },
          "quantity": {
            "type": "integer",
            "description": "Total quantity of this SKU stored at this position."
          },
          "quantity_visible": {
            "type": "integer",
            "description": "Visible (sellable) quantity at this position."
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of this SKU's positions in the location this entry is. 0 is the main row; a bin holding the SKU at more than one separate spot has further rows (1, 2, ...). An identity, not an order: shelf order is `sequence_index`. Pass it back as `slot` to edit this exact position.\n"
          }
        }
      },
      "InventorySummary": {
        "description": "One SKU variant row. Returned by mutation endpoints (create, bulk update). Not used by the list endpoint — that returns `ProductInventorySummary` instead.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "product_name",
          "quantity",
          "quantity_visible",
          "set_name",
          "language",
          "finish",
          "condition",
          "first_inventoried_at",
          "last_inventoried_at",
          "location_uuid",
          "location_name"
        ],
        "properties": {
          "quantity_visible_clamp": {
            "description": "Present only on a write response when the stored `quantity_visible` came out lower than the one requested. `cap` names the limit that applied; the request still succeeds (200/201).\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/QuantityVisibleClamp"
              }
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant (condition/language/finish)."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product (the card). Many SKUs per product."
          },
          "product_name": {
            "type": "string"
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Current inventory price in USD, or null if not priced"
          },
          "quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          },
          "listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
          },
          "reserved_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU quantity held back from online marketplaces for in-store use, independent of `listed_target`. Null means no reserve.\n"
          },
          "online_listable": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Store-reserve cap on `quantity_visible`: MAX(0, this SKU's quantity minus outstanding committed quantity minus reserved_for_store). Null when reserved_for_store is null.\n"
          },
          "held_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much of this SKU's quantity the reserve is currently holding back: LEAST(reserved_for_store, this SKU's quantity). Null when reserved_for_store is null.\n"
          },
          "quantity_committed": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies of this SKU still owed to open orders (sold but not yet pulled from the shelf). `quantity` does not drop until pick, so `quantity - quantity_committed` is what can still be listed; raising `quantity_visible` past that (less any `reserved_for_store`) is rejected with a 400. Always present, unlike `online_listable`. Can exceed `quantity` when the SKU is oversold.\n"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "This SKU's tags. Never null — an untagged SKU, or one with no `pricing_data` row at all, returns `[]`.\n"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-text operator note for this SKU, or null if unset."
          },
          "set_name": {
            "type": "string",
            "description": "Card set or edition name"
          },
          "language": {
            "type": "string",
            "description": "Card language"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "finish_label": {
            "type": "string",
            "description": "Display-only finish label, refined to the specific foil treatment when known (e.g. \"Surge Foil\" instead of the generic \"Foil\"). Derived from the printing's promo types; `finish` remains the canonical machine value.\n"
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card rarity (e.g. Common, Uncommon, Rare, Mythic)"
          },
          "set_code": {
            "type": "string",
            "description": "Short set/expansion code (e.g. MKM, DSK)"
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product type (e.g. card, token, sealed, graded)"
          },
          "variation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card variation (e.g. Extended Art, Borderless), null for a card with none"
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "URI for the card's product image, or null if unavailable"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the inventory location this item is stored in"
          },
          "location_name": {
            "type": "string",
            "description": "Full breadcrumb path of the inventory location (e.g. \"Unassigned > Aetherdrift > W\")"
          },
          "first_inventoried_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_inventoried_at": {
            "type": "string",
            "format": "date-time"
          },
          "pricing_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Version of this SKU's pricing row (`price`, `listed_target`, `reserved_for_store`), or null if it has none yet. Echo it back as `expected_pricing_updated_at` when editing any of those fields. Distinct from `last_repriced_at`: this advances on every write to the row, a repricing run included.\n"
          }
        }
      },
      "InventoryTransferConflict": {
        "type": "object",
        "description": "One line a dispatch refused, and why.",
        "required": [
          "tcgplayer_sku_id",
          "reason"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "reason": {
            "type": "string",
            "enum": [
              "insufficient_available_stock",
              "active_fulfillment_run"
            ],
            "description": "`insufficient_available_stock` — on-hand minus copies already sold but not yet picked is below the requested quantity. `active_fulfillment_run` — one of this store's own pick runs is working this SKU right now.\n"
          },
          "requested": {
            "type": "integer",
            "description": "Present on `insufficient_available_stock`."
          },
          "available": {
            "type": "integer",
            "description": "Free stock after excluding committed copies."
          }
        }
      },
      "InventoryTransferStatus": {
        "type": "string",
        "description": "Lifecycle of a same-owner cross-store transfer. `draft` is a plan that has taken no stock; `in_transit` means the units have left the source; `received` means the destination settled them. `discrepancy_pending` means the destination counted fewer units than were sent and the shortfall is waiting on the SOURCE operator to acknowledge it -- the destination's count alone never writes off the source's books, so a short receive parks here rather than settling. `canceled` is reserved for a transfer abandoned *after* dispatch -- a draft is deleted outright rather than cancelled, since it left no trace to close out.\n",
        "enum": [
          "draft",
          "in_transit",
          "received",
          "discrepancy_pending",
          "canceled"
        ]
      },
      "InventoryTransferWriteOffRequest": {
        "type": "object",
        "description": "Optional operator annotation on a write-off or its reversal. The quantities are not sent — the transfer already knows what is outstanding per line, and letting the caller restate it would allow the books to disagree with the shipment.\n",
        "properties": {
          "note": {
            "type": "string",
            "maxLength": 500,
            "description": "Why the copies were written off (or why they turned up)."
          }
        }
      },
      "InventoryTransferLine": {
        "type": "object",
        "description": "One SKU on a transfer, with its catalog identity resolved at read time so a client can render the line without a lookup per SKU. Identity is best-effort: a SKU the catalog no longer resolves still returns, with null identity fields.\n",
        "required": [
          "tcgplayer_sku_id",
          "quantity_sent",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "language",
          "game",
          "image_url",
          "catalog_lookup_failed"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The variant to move. Condition/language/finish are already baked into the SKU."
          },
          "quantity_sent": {
            "type": "integer",
            "minimum": 1,
            "description": "How many copies the source is sending."
          },
          "quantity_received": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "How many the destination confirmed on receive. `null` until then; a value below `quantity_sent` is a short receipt.\n"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "catalog_lookup_failed": {
            "type": "boolean",
            "description": "True when the catalog lookup itself failed, so the null identity fields mean \"unknown, try again\" rather than \"the catalog has no such SKU\".\n"
          }
        }
      },
      "CreateInventoryTransferRequest": {
        "type": "object",
        "required": [
          "dest_store_uuid",
          "lines"
        ],
        "properties": {
          "dest_store_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The receiving store. Must differ from the path store, must share its currency, and the caller must hold a `UserPermission` on it.\n"
          },
          "lines": {
            "type": "array",
            "minItems": 1,
            "description": "One entry per SKU. A SKU may appear only once -- combine quantities rather than repeating it.\n",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "quantity_sent"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "quantity_sent": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "InventoryTransfer": {
        "type": "object",
        "required": [
          "transfer_uuid",
          "source_store_uuid",
          "source_store_name",
          "dest_store_uuid",
          "dest_store_name",
          "status",
          "initiated_by",
          "created_at"
        ],
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only when the write committed but its marketplace sync event could not be queued (`marketplace_sync_not_queued`). The listings catch up on the next push sweep, within about 30 minutes. Absent on a clean write and on reads.\n"
          },
          "transfer_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "source_store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "source_store_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The source store's name, so a reader who belongs only to the destination can still name it. `null` only if the store row is gone.\n"
          },
          "dest_store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "dest_store_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The destination store's name; `null` only if the store row is gone."
          },
          "status": {
            "$ref": "#/components/schemas/InventoryTransferStatus"
          },
          "initiated_by": {
            "type": "string",
            "description": "supabase_uuid of the operator who created the transfer."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "dispatched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the stock left the source. `null` while still a draft."
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the destination settled the transfer."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryTransferLine"
            }
          }
        }
      },
      "PaginatedInventoryTransferList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "transfers"
            ],
            "properties": {
              "transfers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InventoryTransfer"
                }
              }
            }
          }
        ]
      },
      "LabelTemplateCanvas": {
        "type": "object",
        "required": [
          "width_in",
          "height_in"
        ],
        "description": "The label stock's own dimensions, in inches. Bounded 1.0-4.0 wide and 0.5-6.0 tall -- the range of real thermal stock plus headroom.\n",
        "properties": {
          "width_in": {
            "type": "number",
            "format": "float",
            "minimum": 1.0,
            "maximum": 4.0
          },
          "height_in": {
            "type": "number",
            "format": "float",
            "minimum": 0.5,
            "maximum": 6.0
          }
        }
      },
      "LabelTemplateElement": {
        "type": "object",
        "required": [
          "id",
          "type",
          "x",
          "y",
          "w",
          "h"
        ],
        "description": "One positioned element (#2592).\n\n**Geometry.** `x`/`y`/`w`/`h` are inches from a **top-left** origin with y increasing downward, and describe the element's footprint on the canvas **after** rotation -- the final box, not a pre-rotation one. That is what lets bounds and overlap checks stay axis-aligned, and what lets a drag/drop canvas use the numbers directly. `rotation` says how the content composes *inside* that footprint: at 90 or 270 it lays out in a frame whose width and height are swapped relative to the box.\n",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 64,
            "description": "Unique within the document. Findings are keyed to it."
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "barcode",
              "qr",
              "image",
              "rule"
            ]
          },
          "x": {
            "type": "number",
            "format": "float"
          },
          "y": {
            "type": "number",
            "format": "float"
          },
          "w": {
            "type": "number",
            "format": "float",
            "exclusiveMinimum": 0
          },
          "h": {
            "type": "number",
            "format": "float",
            "exclusiveMinimum": 0
          },
          "rotation": {
            "type": "integer",
            "enum": [
              0,
              90,
              180,
              270
            ],
            "default": 0,
            "description": "Quarter turns only. Arbitrary angles render fine and scan badly, so the vocabulary refuses them rather than leaving it to the UI.\n"
          },
          "content": {
            "type": "object",
            "description": "`text` elements only. Exactly one of `field` or `template`.\n",
            "properties": {
              "field": {
                "type": "string",
                "enum": [
                  "card_name",
                  "set_edition",
                  "condition",
                  "price",
                  "price_whole_dollars",
                  "sku_id",
                  "date",
                  "store_name",
                  "lang_finish_condition"
                ]
              },
              "template": {
                "type": "string",
                "maxLength": 200,
                "description": "Free text with `{placeholder}` tokens drawn from the same vocabulary as `field`, e.g. `\"{set_edition} - {condition}\"`. An unrecognized placeholder is an `unknown_placeholder` error, never a silently empty string.\n"
              }
            }
          },
          "font": {
            "type": "object",
            "description": "`text` elements only. The base-14 set ReportLab ships; an embedded font would mean asset storage, a licence question and a registerFont call on every cold start, and is deliberately out of scope.\n",
            "properties": {
              "family": {
                "type": "string",
                "enum": [
                  "Helvetica",
                  "Helvetica-Bold",
                  "Helvetica-Oblique",
                  "Times-Roman",
                  "Times-Bold",
                  "Times-Italic",
                  "Courier",
                  "Courier-Bold"
                ],
                "default": "Helvetica"
              },
              "size_pt": {
                "type": "number",
                "format": "float",
                "minimum": 4.0,
                "maximum": 72.0,
                "default": 8.0
              }
            }
          },
          "align": {
            "type": "string",
            "enum": [
              "left",
              "center",
              "right"
            ],
            "default": "center"
          },
          "valign": {
            "type": "string",
            "enum": [
              "top",
              "middle",
              "bottom"
            ],
            "default": "middle"
          },
          "overflow": {
            "type": "string",
            "enum": [
              "truncate",
              "shrink",
              "wrap"
            ],
            "default": "truncate",
            "description": "What a `text` element does when its content does not fit. `truncate` cuts with an ellipsis, `shrink` solves the largest point size that fits down to a 4pt floor and then truncates, `wrap` breaks on spaces and drops lines that do not fit vertically. Each reports its own warning when it fires.\n"
          },
          "symbology": {
            "type": "string",
            "enum": [
              "code128"
            ],
            "default": "code128",
            "description": "`barcode` elements only."
          },
          "source": {
            "type": "string",
            "enum": [
              "store_logo"
            ],
            "description": "`image` elements only."
          },
          "fit": {
            "type": "string",
            "enum": [
              "contain",
              "stretch"
            ],
            "default": "contain",
            "description": "`image` elements only."
          },
          "orientation": {
            "type": "string",
            "enum": [
              "horizontal",
              "vertical"
            ],
            "default": "horizontal",
            "description": "`rule` elements only."
          },
          "style": {
            "type": "string",
            "enum": [
              "solid",
              "dashed"
            ],
            "default": "solid",
            "description": "`rule` elements only."
          }
        }
      },
      "LabelTemplateDocument": {
        "type": "object",
        "required": [
          "schema_version",
          "canvas",
          "elements"
        ],
        "description": "A store-designed label layout (#2592). Serialized size is capped at 32 KiB and element count at 40, so one store's document cannot make a large label export unbounded.\n",
        "properties": {
          "schema_version": {
            "type": "integer",
            "enum": [
              1
            ],
            "description": "Refused rather than guessed at when unknown: every key name below is version-specific, so interpreting a future version would be inventing.\n"
          },
          "canvas": {
            "$ref": "#/components/schemas/LabelTemplateCanvas"
          },
          "elements": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "$ref": "#/components/schemas/LabelTemplateElement"
            }
          }
        }
      },
      "LabelTemplate": {
        "type": "object",
        "required": [
          "template_uuid",
          "name",
          "document"
        ],
        "properties": {
          "template_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "document": {
            "$ref": "#/components/schemas/LabelTemplateDocument"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "LabelTemplateList": {
        "type": "object",
        "required": [
          "templates",
          "default_template_uuid"
        ],
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelTemplate"
            }
          },
          "default_template_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Which template prints when the store's `label_format` is `template` and a request names none. Null means no default; a print then falls back to `standard` rather than failing.\n"
          }
        }
      },
      "LabelTemplateCreate": {
        "type": "object",
        "required": [
          "name",
          "document"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80,
            "description": "Unique per store among live templates, case-insensitively. A collision is a 409. A deleted template's name is reusable.\n"
          },
          "document": {
            "$ref": "#/components/schemas/LabelTemplateDocument"
          }
        }
      },
      "LabelTemplateUpdate": {
        "type": "object",
        "minProperties": 1,
        "description": "Partial: an absent key leaves that field alone. A body naming neither key is a 422, not a no-op 200.\n",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "document": {
            "$ref": "#/components/schemas/LabelTemplateDocument"
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The `updated_at` the designer last read: from the GET, or from this route's own previous response, which carries the post-save value. Compared at millisecond precision, so a value round-tripped through a JavaScript `Date` still matches. When someone else saved the template since, the save is refused with 412 and nothing is written, unless the template already holds this save's name and document (a retried save, which writes nothing and keeps the version). Absent keeps the unconditional save.\n"
          }
        }
      },
      "LabelTemplateFinding": {
        "type": "object",
        "required": [
          "element_id",
          "code",
          "severity",
          "detail"
        ],
        "description": "One validation result. `error` blocks both save and print; `warning` blocks neither.\n",
        "properties": {
          "element_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The element this is about, or null for a document-level finding (`invalid_canvas`, `too_many_elements`, `no_barcode_element`).\n"
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_document",
              "unsupported_schema_version",
              "invalid_canvas",
              "too_many_elements",
              "document_too_large",
              "duplicate_element_id",
              "unknown_element_type",
              "invalid_geometry",
              "invalid_rotation",
              "invalid_overflow",
              "unknown_font",
              "invalid_font_size",
              "unknown_placeholder",
              "invalid_element_property",
              "element_out_of_bounds",
              "element_overlaps_code",
              "barcode_module_below_floor",
              "barcode_quiet_zone_encroached",
              "qr_below_min_size",
              "no_barcode_element",
              "elements_overlap",
              "text_truncated",
              "text_shrunk_to_floor",
              "text_lines_dropped"
            ],
            "description": "The ones worth knowing about before you draw anything:\n\n- `barcode_module_below_floor` -- the bars solve thinner than the 0.0098in GS1 Code128 minimum in this element. The quiet zone is budgeted *inside* the element's own box, so a barcode usually wants the full width of the label rather than sitting inside the margin. The detail names the width this payload needs.\n- `barcode_quiet_zone_encroached` -- something sits in the blank margin either side of the bars. A scanner that cannot find that margin reads nothing at all, which is a more common thermal-label failure than a slightly thin bar.\n- `element_overlaps_code` -- something covers the bars or the QR modules themselves.\n- `no_barcode_element` -- a warning, not an error: a pure price sticker is legitimate, but it will not scan at the register, so it is worth confirming rather than discovering.\n"
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          },
          "detail": {
            "type": "string",
            "description": "Human-readable, and carries the actionable number where there is one (e.g. \"Make this element at least 2.156in wide\"). Render it rather than paraphrasing.\n"
          }
        }
      },
      "LabelTemplatePreviewRequest": {
        "type": "object",
        "description": "Exactly one of `template` or `template_uuid`.",
        "properties": {
          "template": {
            "$ref": "#/components/schemas/LabelTemplateDocument"
          },
          "template_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "sample": {
            "type": "object",
            "description": "Render against a real SKU instead of the fixed demo card. Worth doing before saving: the demo card's name is short and its barcode payload is a sentinel, so a template that looks fine against it can still truncate, or drop under the scannability floor, for real stock.\n",
            "properties": {
              "tcgplayer_sku_id": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        }
      },
      "LabelTemplatePreview": {
        "type": "object",
        "required": [
          "png_base64",
          "width_in",
          "height_in",
          "warnings"
        ],
        "properties": {
          "png_base64": {
            "type": "string",
            "description": "The rendered label, base64 PNG. Rendered even when `warnings` contains errors -- the picture is what the designer is dragging against, and the findings are what say it is not printable yet.\n"
          },
          "width_in": {
            "type": "number",
            "format": "float",
            "description": "Read back off the rendered page, so it cannot drift from the image."
          },
          "height_in": {
            "type": "number",
            "format": "float"
          },
          "fields_used": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which placeholders this document binds to. The print path uses the same set to decide which columns to fetch, so a template naming two fields does not cost what one naming eight does.\n"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelTemplateFinding"
            }
          }
        }
      },
      "InventorySettings": {
        "description": "Store-level inventory defaults: the store-wide drip-listing target and printed-label config. A GET or PUT response always carries both `default_listed_target` and `label_config`.\n",
        "type": "object",
        "required": [
          "default_listed_target",
          "label_config"
        ],
        "properties": {
          "default_listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Store-wide default drip-listing cap on `quantity_visible`, used for any SKU without a per-SKU `listed_target`. A SKU's effective target is COALESCE(per-SKU listed_target, this value); null means no store default (a SKU with no per-SKU target is uncapped). Raising or clearing it is lazy: nothing is relisted, and each inheriting SKU picks up the new value the next time that SKU is written. Setting it, or lowering it, also queues a background pass that lowers every inheriting SKU still listed above the new default (a SKU with its own `listed_target` is left alone, as are copies in holding locations); the PUT answers before that pass has finished, and re-saving the same value does not start another.\n"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present only on a PUT whose save committed but whose background pull-down could not be queued (`drip_pull_down_not_queued`). Saving the setting again retries it. Absent on a clean save and on reads.\n"
          },
          "label_config": {
            "type": "object",
            "description": "Printed-label configuration (#1281, #2592): the store's saved label format, which fields print on a compact label, and which designed template prints when the format is `template`. Always present -- the store's saved `store_label_config` row when one exists, else the defaults documented below.\n",
            "properties": {
              "default_template_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Which `LabelTemplate` prints when `label_format` is `template` and a request names none (#2592). Null, or a template since deleted, falls back to `standard` rather than failing a print -- discovering a settings problem by having labels stop coming out of the printer is the wrong failure.\n"
              },
              "label_format": {
                "type": "string",
                "enum": [
                  "standard",
                  "compact",
                  "template"
                ],
                "default": "standard",
                "description": "`standard` is today's wrap-around fold + QR label; `compact` is the flat sticker, no fold -- its own QR is optional (`qr_code` in `compact_fields`), unlike standard where it's unconditional. See `generateSkuLabel` for the geometry of each.\n"
              },
              "compact_fields": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "enum": [
                    "card_name",
                    "set_edition",
                    "condition",
                    "price",
                    "sku_id",
                    "date",
                    "store_name",
                    "store_logo",
                    "qr_code"
                  ]
                },
                "default": [
                  "card_name",
                  "set_edition",
                  "condition",
                  "price",
                  "sku_id"
                ],
                "description": "Which fields print on a `compact` label. Submitted order is preserved and returned as stored, but it is not print order -- the compact layout is fixed top-down (logo, store name, card name, set, condition/price row, QR code, barcode, SKU id, date) regardless of this array's order; reordering the array changes only what is saved, not where a field prints. Ignored by the `standard` format. May be empty (a barcode-only label). Defaults to `[card_name, set_edition, condition, price, sku_id]`, the pictured model.\n\n- `card_name` -- the card's name, ellipsis-truncated to fit.\n- `set_edition` -- set name, with the collector number appended when known (e.g. \"Commander Masters #123\").\n- `condition` -- abbreviation + foil marker (e.g. `NM`, `LPF`); appends the language abbreviation for a non-English SKU (e.g. `NM JP F`).\n- `price` -- the store's retail price, currency-formatted.\n- `sku_id` -- the barcode's human-readable text, printed below it.\n- `date` -- this label's render date (`YYYY-MM-DD`), not an intake date.\n- `store_name` -- the store's name.\n- `store_logo` -- the store's uploaded logo image; omitted silently when the store has none.\n- `qr_code` -- a QR encoding the same HippoLink customer lookup URL the standard format's front panel carries.\n"
              }
            }
          }
        }
      },
      "InventorySettingsUpdate": {
        "description": "PUT request body for store-level inventory defaults. At least one of `default_listed_target` / `label_config` is required; either may be omitted to leave that concern untouched (see `putInventorySettings`).\n",
        "type": "object",
        "anyOf": [
          {
            "required": [
              "default_listed_target"
            ]
          },
          {
            "required": [
              "label_config"
            ]
          }
        ],
        "properties": {
          "default_listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Store-wide default drip-listing cap on `quantity_visible`, used for any SKU without a per-SKU `listed_target`. A SKU's effective target is COALESCE(per-SKU listed_target, this value); null means no store default (a SKU with no per-SKU target is uncapped). This setting is lazy: changing it (raising, lowering, or clearing) never sweeps existing inventory -- each inheriting SKU picks up the new value only the next time that SKU is written, at which point a lowered effective target pulls that SKU's own listing down immediately.\n"
          },
          "expected_default_listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The `default_listed_target` the client last loaded (`null` if none). Only accepted alongside `default_listed_target` (422 otherwise). A mismatch with the stored value returns 412 and writes nothing, unless the stored value already equals the requested one (a retried save).\n"
          },
          "label_config": {
            "type": "object",
            "description": "Printed-label configuration (#1281, #2592). Optional; when present it is itself a partial update -- an omitted or explicit `null` `label_format` or `compact_fields` leaves that one field at its current stored value. Unknown keys inside this object are ignored.\n\n`default_template_uuid` is the exception to that null rule, and has to be: clearing the default is something a store does, so an explicit `null` writes NULL and only an **absent** key leaves it alone. Treating null as \"unchanged\" there would make \"no default template\" unreachable through the API.\n",
            "properties": {
              "default_template_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "A template belonging to this store (#2592), or `null` to clear the default. Pointing it at another store's template, or at a deleted one, is a 422 -- unlike a default that goes missing later, this is a mistake the caller is making now and can fix.\n"
              },
              "label_format": {
                "type": "string",
                "enum": [
                  "standard",
                  "compact",
                  "template"
                ],
                "description": "`standard` is today's wrap-around fold + QR label; `compact` is the flat sticker, no fold -- its own QR is optional (`qr_code` in `compact_fields`), unlike standard where it's unconditional. See `generateSkuLabel` for the geometry of each. Carries no `default` on purpose: omitting this key on a PUT leaves the store's saved format unchanged, it does not reset it to `standard`. The default a never-customized store reads back is documented on `InventorySettings`, the response schema.\n"
              },
              "compact_fields": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "enum": [
                    "card_name",
                    "set_edition",
                    "condition",
                    "price",
                    "sku_id",
                    "date",
                    "store_name",
                    "store_logo",
                    "qr_code"
                  ]
                },
                "description": "Which fields print on a `compact` label. Submitted order is preserved and returned as stored, but it is not print order -- the compact layout is fixed top-down (logo, store name, card name, set, condition/price row, QR code, barcode, SKU id, date) regardless of this array's order; reordering the array changes only what is saved, not where a field prints. Ignored by the `standard` format. An empty array is valid and means a barcode-only label -- distinct from omitting the key, which leaves the saved list unchanged. Carries no `default` on purpose, for the same reason as `label_format`.\n\n- `card_name` -- the card's name, ellipsis-truncated to fit.\n- `set_edition` -- set name, with the collector number appended when known (e.g. \"Commander Masters #123\").\n- `condition` -- abbreviation + foil marker (e.g. `NM`, `LPF`); appends the language abbreviation for a non-English SKU (e.g. `NM JP F`).\n- `price` -- the store's retail price, currency-formatted.\n- `sku_id` -- the barcode's human-readable text, printed below it.\n- `date` -- this label's render date (`YYYY-MM-DD`), not an intake date.\n- `store_name` -- the store's name.\n- `store_logo` -- the store's uploaded logo image; omitted silently when the store has none.\n- `qr_code` -- a QR encoding the same HippoLink customer lookup URL the standard format's front panel carries.\n"
              }
            }
          }
        }
      },
      "JobAccepted": {
        "type": "object",
        "required": [
          "job_uuid"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "format": "uri",
            "description": "Presigned S3 upload URL. Present for the job types that take a file — import and relocate. The client should PUT the CSV directly to this URL before calling /start.\n"
          }
        }
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "pending_upload",
          "pending",
          "running",
          "completed",
          "failed",
          "cancelled"
        ],
        "description": "Shared async-job lifecycle state. Not every job type uses every value: \"pending_upload\" is import-only, and \"cancelled\" is a terminal state for reprice / rollback jobs that a caller cancels via the cancel endpoint.\n"
      },
      "JobType": {
        "type": "string",
        "enum": [
          "import",
          "export",
          "reprice",
          "rollback",
          "relocate"
        ]
      },
      "LabelFormat": {
        "type": "string",
        "enum": [
          "PNG",
          "PDF",
          "ZPL"
        ]
      },
      "BinTemplate": {
        "type": "object",
        "description": "A store's saved bin-name template — how a **template**-strategy import files cards on its shelves. See `listBinTemplates` for the variable table.\n",
        "required": [
          "template_uuid",
          "name",
          "template",
          "is_default"
        ],
        "properties": {
          "template_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "description": "What the store calls this template in the picker. Unique per store."
          },
          "template": {
            "type": "string",
            "maxLength": 500
          },
          "is_default": {
            "type": "boolean",
            "description": "Whether an import that names no template uses this one. At most one per store.\n"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "BinTemplateRequest": {
        "type": "object",
        "required": [
          "name",
          "template"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "template": {
            "type": "string",
            "maxLength": 500
          },
          "is_default": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "BinTemplatePreset": {
        "type": "object",
        "description": "A ready-made bin-name template offered as a starting point. A store saves one by posting its `name` and `template` to `createBinTemplate`, editing either first if it wants to; the name is only what the store calls this layout in its own picker.\n",
        "required": [
          "name",
          "template",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "template": {
            "type": "string",
            "maxLength": 500
          },
          "description": {
            "type": "string",
            "description": "What this layout does to the store's shelves, and what it costs."
          }
        }
      },
      "BinTemplatePreview": {
        "type": "object",
        "description": "What a template would build for one card, plus what changes about the split since the store's last import. Either `levels` or `refused` is present, never both.\n",
        "required": [
          "template",
          "axes",
          "worst_case_name_length",
          "warnings"
        ],
        "properties": {
          "template": {
            "type": "string"
          },
          "levels": {
            "type": "array",
            "description": "The locations this card would be filed into, outermost first. Every entry but the last is a container; the last is the bin.\n",
            "items": {
              "type": "object",
              "required": [
                "name",
                "location_type"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "location_type": {
                  "$ref": "#/components/schemas/LocationType"
                },
                "binning_key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The machine identity HippoLink finds this shelf by on a later import — the card properties whose values decided the label, in a fixed order regardless of how the template spells them. It is why reordering a template or changing its delimiters re-uses every bin the store has already built. Null for a level of pure literal text, which is found by its name.\n"
                }
              }
            }
          },
          "refused": {
            "type": "array",
            "description": "Present instead of `levels` when the sample card cannot fill a variable the template asks for. Names the missing catalog values; an import refuses such a row rather than shelving it under a placeholder.\n",
            "items": {
              "type": "string"
            }
          },
          "axes": {
            "type": "array",
            "description": "The card properties this template splits bins on.",
            "items": {
              "type": "string"
            }
          },
          "worst_case_name_length": {
            "type": "integer",
            "description": "The longest bin name this template could ever produce. Over 500 is a 422, which is a rail rather than a limit a realistic template meets.\n"
          },
          "warnings": {
            "type": "array",
            "description": "Non-blocking advice. Today there is one: a last level that does not repeat a variable its containers use produces bins only meaningful next to their parent — every group mints one with the same name, and nothing that names a bin (a search box, a shelf label, a CSV `Location` column) can tell them apart.\n",
            "items": {
              "type": "string"
            }
          },
          "previous_template": {
            "type": "string",
            "description": "The template the store's last completed templated import ran with. Present only when its split differs from this one's.\n"
          },
          "added_axes": {
            "type": "array",
            "description": "Card properties this template splits on that the previous one did not.",
            "items": {
              "type": "string"
            }
          },
          "removed_axes": {
            "type": "array",
            "description": "Card properties the previous template split on that this one does not.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BinAxesChangedError": {
        "type": "object",
        "description": "The bin template splits on different card properties than the store's last import did. That is physically ambiguous rather than merely technical: adding a language split leaves the copies belonging in the new Japanese bin sitting inside the old bin on a shelf, and removing a condition split collapses five bins whose cards are in five places. So HippoLink creates new bins for the new split and asks first, rather than guessing. Re-send with `acknowledge_axis_change: true` to go ahead.\n",
        "required": [
          "error",
          "request_id"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "`bin_axes_changed` for this case. The import create shares its 409 with the idempotency-key conflict, which carries only `error`, `detail` and `request_id` — the three template fields below are absent there.\n"
          },
          "detail": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "previous_template": {
            "type": "string"
          },
          "added_axes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "removed_axes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LocationMove": {
        "type": "object",
        "description": "One bulk `moveCardsToLocation` call, as the move list serves it (#3801).\n",
        "required": [
          "move_uuid",
          "created_at",
          "destination_location_uuid",
          "destination_name",
          "destination_full_path",
          "destination_deleted",
          "row_count",
          "card_count",
          "source_bin_count",
          "undo_status",
          "undo_partial",
          "pull_sheet_printed_at",
          "pull_sheet_dismissed_at",
          "needs_pull_sheet"
        ],
        "properties": {
          "move_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "destination_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "destination_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The destination bin's name, read live; null once the bin row is gone."
          },
          "destination_full_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_deleted": {
            "type": "boolean",
            "description": "The destination bin has been deleted since the move."
          },
          "row_count": {
            "type": "integer",
            "description": "Source storage rows the move took copies from (lines on its pull sheet)."
          },
          "card_count": {
            "type": "integer",
            "description": "Copies the move took, summed over its rows."
          },
          "source_bin_count": {
            "type": "integer",
            "description": "Distinct bins the move took cards out of."
          },
          "undo_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending_upload",
              "pending",
              "running",
              "completed",
              "failed",
              null
            ],
            "description": "Status of the relocation job undoing this move; null when it was never undone (or its job is gone). Any value but `failed` means the cards are going, or went, back, except where `undo_partial` says some could not be.\n"
          },
          "undo_partial": {
            "type": "boolean",
            "description": "The undo completed but left some rows behind (their bin was deleted, or the copies were sold or moved on since). Those cards still sit in their old bins while stock says the destination, so the move still needs its pull sheet, which then lists only those rows.\n"
          },
          "pull_sheet_printed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "First time the store marked the pull sheet printed (`markLocationMovePullSheetPrinted`); null if never."
          },
          "pull_sheet_dismissed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the store marked the pull sheet handled without printing it; null if not."
          },
          "needs_pull_sheet": {
            "type": "boolean",
            "description": "The cards probably still sit in their old bins: the sheet was never printed or marked handled, the move isn't undone (an undo whose job hasn't failed, unless `undo_partial`), its destination bin still exists, and it was made in the last 14 days.\n"
          }
        }
      },
      "Location": {
        "type": "object",
        "required": [
          "location_uuid",
          "name",
          "location_type",
          "full_path",
          "sequence_index",
          "total",
          "child_count",
          "child_container_count",
          "child_bin_count",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "parent_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUID of the parent location, or null for root-level locations"
          },
          "name": {
            "type": "string",
            "description": "Names written from now on cannot contain `>` (see the create/update request schemas). Deliberately unconstrained here: names stored before that rule existed may still contain it, and a response schema that live data violates would be the wrong contract.\n"
          },
          "location_type": {
            "$ref": "#/components/schemas/LocationType"
          },
          "is_listable": {
            "type": "boolean",
            "description": "When false, stock in this location is held (cost-tracked but not sellable). Synced quantity ignores held stock.",
            "default": true
          },
          "in_store_only": {
            "type": "boolean",
            "description": "When true, stock in this location sells in store (Square, Shopify, the kiosk) but is never listed on a third-party marketplace (TCGplayer, ManaPool, CardTrader, eBay). Unlike is_listable=false, which holds the stock back from every channel.\n",
            "default": false
          },
          "prices_locked": {
            "type": "boolean",
            "description": "Standing price lock on a bin. While true, every card with stock here is price-locked (repricing and first-pricing skip it), whether it arrived before or after the flag was set. Independent of the one-shot lock-bin-prices action, which locks the cards' own flags.\n",
            "default": false
          },
          "is_default_intake": {
            "type": "boolean",
            "default": false,
            "description": "Whether this is the store's default intake location (the fallback for set_code/chaos buylist pushes). At most one per store.\n"
          },
          "notify_on_online_sale": {
            "type": "boolean",
            "default": false,
            "description": "When true, an online sale of a card physically present in this location raises a \"pull this copy now\" alert (double-sell guard for display cases).\n"
          },
          "intake_set_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Set codes routed here by the buylist push set_code strategy (uppercase)."
          },
          "full_path": {
            "type": "string",
            "description": "Materialized breadcrumb path from root to this location (e.g. \"Unassigned > Aetherdrift > W\"). Maintained automatically by the database.\n"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional user-defined identifier for the location, null when unset"
          },
          "maximum_capacity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Maximum number of cards this location can hold, null when no limit is set"
          },
          "sequence_index": {
            "type": "integer",
            "description": "Position in the sibling pick-path order (1-based, relative to siblings under the same parent)"
          },
          "total": {
            "type": "integer",
            "description": "Copies held in this location. A bin counts its own storage rows; a container counts every copy in every bin beneath it, at any depth, from a cache the request refreshes before reading (#3172).\n"
          },
          "child_count": {
            "type": "integer",
            "description": "Number of direct child locations"
          },
          "child_container_count": {
            "type": "integer",
            "description": "Direct child locations that are containers. With child_bin_count it sums to child_count."
          },
          "child_bin_count": {
            "type": "integer",
            "description": "Direct child locations that are bins. With child_container_count it sums to child_count."
          },
          "first_card": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardPeek"
              },
              {
                "type": "null"
              }
            ],
            "description": "Minimal snapshot of the first card in this bin (lowest sequence_index). Null for containers and empty bins.\n"
          },
          "last_card": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardPeek"
              },
              {
                "type": "null"
              }
            ],
            "description": "Minimal snapshot of the last card in this bin (highest sequence_index). Null for containers and empty bins.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LocationAncestor": {
        "type": "object",
        "required": [
          "location_uuid",
          "name"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RoundLocationPricesRequest": {
        "type": "object",
        "required": [
          "direction",
          "increment"
        ],
        "additionalProperties": false,
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down",
              "nearest"
            ],
            "description": "Round up to the next step, down to the previous one, or to the nearest."
          },
          "increment": {
            "type": "string",
            "enum": [
              "0.25",
              "0.50",
              "1.00"
            ],
            "description": "The step to round to, in the currency of each price (the store's for the base price, the override's own for an override)."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Report the counts without changing any price."
          }
        }
      },
      "RoundLocationPricesResult": {
        "type": "object",
        "required": [
          "skus",
          "rounded",
          "unchanged",
          "skipped_unpriced",
          "skipped_to_zero",
          "overrides_rounded",
          "dry_run"
        ],
        "properties": {
          "skus": {
            "type": "integer",
            "description": "Distinct SKUs stocked in the bin, or in the bins under the container."
          },
          "rounded": {
            "type": "integer",
            "description": "SKUs whose base price changed (or would change, on a dry run)."
          },
          "unchanged": {
            "type": "integer",
            "description": "Priced SKUs already on the step."
          },
          "skipped_unpriced": {
            "type": "integer",
            "description": "Stocked SKUs with no price, which have nothing to round."
          },
          "skipped_to_zero": {
            "type": "integer",
            "description": "SKUs whose price the step would round to 0.00, left as they are."
          },
          "overrides_rounded": {
            "type": "integer",
            "description": "Per-marketplace price overrides whose price changed."
          },
          "dry_run": {
            "type": "boolean",
            "description": "True when nothing was written."
          }
        }
      },
      "LocationDetail": {
        "description": "Location metadata with ancestry breadcrumb",
        "allOf": [
          {
            "$ref": "#/components/schemas/Location"
          },
          {
            "type": "object",
            "required": [
              "ancestors"
            ],
            "properties": {
              "ancestors": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LocationAncestor"
                },
                "description": "Ordered list from root to immediate parent. Empty for root-level locations. Useful for rendering a breadcrumb.\n"
              }
            }
          }
        ]
      },
      "LocationDetailResponse": {
        "description": "Single location with ancestry breadcrumb and embedded paginated product list. Returned by getLocation and mergeLocations. The `total`, `limit`, `offset`, and `cards` fields belong to the embedded product page; `Location.total` (quantity sum) is superseded by the pagination `total` (distinct product row count) in this response shape.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/LocationDetail"
          },
          {
            "type": "object",
            "required": [
              "total",
              "limit",
              "offset",
              "cards"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "description": "Total distinct product rows in this location (pagination total for the cards list)."
              },
              "limit": {
                "type": "integer",
                "description": "Page size used for the embedded cards list."
              },
              "offset": {
                "type": "integer",
                "description": "Page offset used for the embedded cards list."
              },
              "cards": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LocationProduct"
                },
                "description": "Paginated product entries for this location."
              }
            }
          }
        ]
      },
      "CreateBoxRebuildRequest": {
        "type": "object",
        "description": "Body of createBoxRebuild.",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "simple",
              "csv"
            ],
            "description": "`simple` rebuilds from what the box holds; `csv` also reads an uploaded TCGplayer or ScanAbility file."
          },
          "cost_batch_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The open cost batch for cards a file adds. Optional here: the preview completes without one and reports `copies_added`; the batch can then be sent with the apply instead.\n"
          }
        }
      },
      "BoxRebuildCounts": {
        "type": "object",
        "description": "Plan totals; null until the preview has planned.",
        "required": [
          "bins_before",
          "bins_after",
          "copies_moved",
          "copies_missing",
          "copies_added",
          "conflicts_total",
          "conflicts_open"
        ],
        "properties": {
          "bins_before": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bins_after": {
            "type": [
              "integer",
              "null"
            ]
          },
          "copies_moved": {
            "type": [
              "integer",
              "null"
            ]
          },
          "copies_missing": {
            "type": [
              "integer",
              "null"
            ]
          },
          "copies_added": {
            "type": [
              "integer",
              "null"
            ]
          },
          "conflicts_total": {
            "type": [
              "integer",
              "null"
            ]
          },
          "conflicts_open": {
            "type": "integer",
            "description": "Conflicts of the preview with no saved choice yet."
          }
        }
      },
      "BoxRebuildError": {
        "type": "object",
        "description": "Why a rebuild failed (an error code from the catalog, its user-facing detail and its parameters).",
        "required": [
          "code",
          "detail",
          "params"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "The error code a failed rebuild recorded. A rebuild runs on a worker, so these are\nnot returned by the route that queued it; they are read here. The codes are:\n- `box_rebuild_failed`: an unexpected failure; try again.\n- `box_rebuild_stale`: the rebuild stopped responding and was cancelled.\n- `box_rebuild_too_large`: the box holds more than the 50,000 cards one rebuild handles.\n- `box_rebuild_unmatched_rows`: file rows that name no card HippoLink knows (`params.file_rows`; `params.rows` gives the first 100 as `{file_row, name, sku_id, reason}`, `reason` `not_in_catalog`, `no_sku_id` or `store_minted`). `detail` names the first 10.\n- `box_rebuild_invalid_rows`: file rows with an unreadable quantity (`params.file_rows`). `detail` names the first 10.\n- `box_rebuild_unsupported_format`: the file is neither a TCGplayer nor a ScanAbility file.\n- `box_rebuild_conflicts_unresolved`: condition conflicts still have no choice (`params.count`).\n- `box_rebuild_cost_batch_required`: the file adds cards but no cost batch was chosen.\n- `box_rebuild_bin_not_deletable`: a bin the rebuild empties could not be removed (`params.bin_name`).\n- `box_rebuild_default_intake_emptied`: the rebuild would empty the store's default intake bin (`params.bin_name`); make another bin the default intake first.\n- `box_rebuild_plan_changed`: the box changed since the preview; preview again.\n- `box_rebuild_open_picks`: cards in the box are waiting to be picked or held for an order (`params.run_uuids`).\n- `box_rebuild_no_bins`: the box has no bins to fill.\n- `box_rebuild_bin_capacity_missing`: a bin has no maximum capacity (`params.bin_name`).\n- `box_rebuild_not_container`: the location is not a box of bins.\n- `box_rebuild_holding_box`: holding boxes can't be rebuilt.\n- `box_rebuild_upload_expired`: the uploaded file has expired; upload it again.\n- `cost_batch_not_open`: the cost batch for added cards is no longer open.\n- `cost_batch_not_found`: the cost batch for added cards no longer exists.\n- `lot_cost_locked`: some copies the rebuild re-identifies are in a cost batch that isn't finished; finish the batch, then rebuild.\n"
          },
          "detail": {
            "type": "string"
          },
          "params": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          }
        }
      },
      "BoxRebuild": {
        "type": "object",
        "description": "A box rebuild, preview or apply.",
        "required": [
          "rebuild_uuid",
          "container_uuid",
          "mode",
          "dry_run",
          "status",
          "preview_uuid",
          "plan_digest",
          "cost_batch_uuid",
          "counts",
          "error",
          "created_at",
          "completed_at"
        ],
        "properties": {
          "rebuild_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "container_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "mode": {
            "type": "string",
            "enum": [
              "simple",
              "csv"
            ]
          },
          "dry_run": {
            "type": "boolean",
            "description": "True for a preview, false for the apply made from one."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_upload",
              "pending",
              "running",
              "completed",
              "failed"
            ]
          },
          "preview_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "plan_digest": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send this to apply once the preview is completed."
          },
          "cost_batch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "counts": {
            "$ref": "#/components/schemas/BoxRebuildCounts"
          },
          "error": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BoxRebuildError"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "BoxRebuildEnvelope": {
        "type": "object",
        "description": "A single rebuild.",
        "required": [
          "rebuild"
        ],
        "properties": {
          "rebuild": {
            "$ref": "#/components/schemas/BoxRebuild"
          }
        }
      },
      "CreateBoxRebuildResponse": {
        "type": "object",
        "description": "A created preview.",
        "required": [
          "rebuild"
        ],
        "properties": {
          "rebuild": {
            "$ref": "#/components/schemas/BoxRebuild"
          },
          "upload_url": {
            "type": "string",
            "format": "uri",
            "description": "Presigned URL to PUT the file to. Present only for a `csv` rebuild."
          }
        }
      },
      "BoxRebuildSegment": {
        "type": "object",
        "description": "A run of copies of one SKU placed in a rebuilt bin.",
        "required": [
          "tcgplayer_sku_id",
          "product_name",
          "set_name",
          "condition",
          "finish",
          "seq",
          "copies",
          "position_start",
          "source",
          "file_row",
          "origin_bin_uuid",
          "origin_slot"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "seq": {
            "type": "integer"
          },
          "copies": {
            "type": "integer"
          },
          "position_start": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "kept",
              "missing",
              "added"
            ],
            "description": "Where the run comes from."
          },
          "file_row": {
            "type": [
              "integer",
              "null"
            ]
          },
          "origin_bin_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "origin_slot": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "BoxRebuildBin": {
        "type": "object",
        "description": "One bin of the plan.",
        "required": [
          "bin_number",
          "name",
          "bin_uuid",
          "existed",
          "will_delete",
          "fill_before",
          "fill_after",
          "segments"
        ],
        "properties": {
          "bin_number": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "bin_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "existed": {
            "type": "boolean",
            "description": "The box already had a bin at this number."
          },
          "will_delete": {
            "type": "boolean",
            "description": "The plan leaves this bin empty, so the rebuild removes it."
          },
          "fill_before": {
            "type": "integer"
          },
          "fill_after": {
            "type": "integer"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoxRebuildSegment"
            }
          }
        }
      },
      "BoxRebuildMissingCopy": {
        "type": "object",
        "description": "Copies the box holds that the file doesn't name.",
        "required": [
          "tcgplayer_sku_id",
          "product_name",
          "set_name",
          "condition",
          "finish",
          "copies",
          "bin_uuid",
          "bin_name",
          "slot",
          "position",
          "unit_cost",
          "total_cost"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "copies": {
            "type": "integer"
          },
          "bin_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "bin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "slot": {
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "unit_cost": {
            "type": [
              "string",
              "null"
            ],
            "description": "Estimated FIFO unit cost as a decimal string; null when no lot covers the copies."
          },
          "total_cost": {
            "type": [
              "string",
              "null"
            ],
            "description": "Estimated FIFO total cost as a decimal string; null when no lot covers the copies."
          }
        }
      },
      "BoxRebuildAddedCopy": {
        "type": "object",
        "description": "Copies the file adds that the box doesn't hold.",
        "required": [
          "tcgplayer_sku_id",
          "product_name",
          "set_name",
          "condition",
          "finish",
          "copies",
          "file_row",
          "bin_number"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "copies": {
            "type": "integer"
          },
          "file_row": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bin_number": {
            "type": "integer"
          }
        }
      },
      "BoxRebuildConflict": {
        "type": "object",
        "description": "A card where the file and the box name different conditions of one printing.",
        "required": [
          "conflict_id",
          "product_name",
          "set_name",
          "finish",
          "existing_sku_id",
          "incoming_sku_id",
          "existing_condition",
          "incoming_condition",
          "copies",
          "bin_uuid",
          "bin_name",
          "slot",
          "position",
          "file_row",
          "resolution"
        ],
        "properties": {
          "conflict_id": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "existing_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "incoming_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "existing_condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "incoming_condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "copies": {
            "type": "integer"
          },
          "bin_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "bin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "slot": {
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "file_row": {
            "type": [
              "integer",
              "null"
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "incoming",
              "existing",
              null
            ],
            "description": "The saved choice; null until chosen."
          }
        }
      },
      "BoxRebuildBinsPage": {
        "type": "object",
        "description": "A page of the plan's bins.",
        "required": [
          "bins",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoxRebuildBin"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "BoxRebuildMissingPage": {
        "type": "object",
        "description": "A page of missing copies, with cost totals over every missing copy (not just this page).",
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "total_cost",
          "uncosted_copies"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoxRebuildMissingCopy"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total_cost": {
            "type": "string",
            "description": "Estimated FIFO cost of every missing copy a lot covers, as a decimal string with 4 places."
          },
          "uncosted_copies": {
            "type": "integer",
            "description": "Missing copies no cost lot covers, so not counted in `total_cost`."
          }
        }
      },
      "BoxRebuildAddedPage": {
        "type": "object",
        "description": "A page of added copies.",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoxRebuildAddedCopy"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "BoxRebuildConflictsPage": {
        "type": "object",
        "description": "A page of conflicts.",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoxRebuildConflict"
            }
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "ResolveBoxRebuildConflictsRequest": {
        "description": "Send exactly one of `resolutions` or `all`.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "resolutions"
            ],
            "properties": {
              "resolutions": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "required": [
                    "conflict_id",
                    "choice"
                  ],
                  "properties": {
                    "conflict_id": {
                      "type": "integer"
                    },
                    "choice": {
                      "type": "string",
                      "enum": [
                        "incoming",
                        "existing"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "all"
            ],
            "properties": {
              "all": {
                "type": "string",
                "enum": [
                  "incoming",
                  "existing"
                ]
              }
            }
          }
        ]
      },
      "ResolveBoxRebuildConflictsResponse": {
        "type": "object",
        "description": "The preview's re-stamped digest and its remaining unresolved conflicts.",
        "required": [
          "plan_digest",
          "conflicts_open"
        ],
        "properties": {
          "plan_digest": {
            "type": "string",
            "description": "The preview's new digest; apply with this one."
          },
          "conflicts_open": {
            "type": "integer"
          }
        }
      },
      "ApplyBoxRebuildRequest": {
        "type": "object",
        "description": "Body of applyBoxRebuild.",
        "required": [
          "plan_digest"
        ],
        "properties": {
          "plan_digest": {
            "type": "string"
          },
          "cost_batch_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The open cost batch for the copies the preview adds; overrides the preview's. Required when the preview adds copies and was made without a batch. Ignored by a repeat call.\n"
          }
        }
      },
      "AlphabetizeLocationsResponse": {
        "type": "object",
        "required": [
          "bins",
          "rows",
          "moved",
          "results"
        ],
        "properties": {
          "bins": {
            "type": "integer",
            "minimum": 0,
            "description": "Bins sorted, after containers were expanded and duplicates removed."
          },
          "rows": {
            "type": "integer",
            "minimum": 0,
            "description": "Storage rows across those bins, including rows holding no copies."
          },
          "moved": {
            "type": "integer",
            "minimum": 0,
            "description": "Rows whose position changed. 0 when every bin was already in order."
          },
          "results": {
            "type": "array",
            "description": "One entry per bin sorted, in uuid order.",
            "items": {
              "$ref": "#/components/schemas/AlphabetizeLocationProductsResponse"
            }
          }
        }
      },
      "AlphabetizeLocationProductsResponse": {
        "type": "object",
        "required": [
          "location_uuid",
          "rows",
          "moved"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rows": {
            "type": "integer",
            "minimum": 0,
            "description": "Storage rows in the bin, including rows holding no copies."
          },
          "moved": {
            "type": "integer",
            "minimum": 0,
            "description": "Rows whose position changed. 0 when the bin was already in order."
          }
        }
      },
      "LocationProduct": {
        "description": "Per-product stock entry with denormalized display metadata resolved server-side from the catalog. All display fields are nullable — null indicates the SKU is not yet in the catalog.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "sequence_index",
          "slot",
          "quantity",
          "quantity_visible",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product."
          },
          "sequence_index": {
            "type": "integer",
            "description": "1-based position of this card within the bin. Determines physical pick order. Reorder via POST .../products/alphabetize.\n"
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of this SKU's positions in the location this entry is. 0 is the main row; a bin holding the SKU at more than one separate spot has further rows (1, 2, ...). An identity, not an order: shelf order is `sequence_index`. Name it in upsert/remove/reorder requests to address this exact row.\n"
          },
          "quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card name resolved from the catalog; null if SKU is not yet in the catalog."
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set name resolved from the catalog."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product number within the set."
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card condition (e.g. \"Near Mint\"); null if SKU is not yet in the catalog."
          },
          "finish": {
            "type": [
              "string",
              "null"
            ],
            "description": "Finish variant (e.g. \"foil\", \"normal\")."
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card language (e.g. \"English\"); null if SKU is not yet in the catalog."
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card image URI resolved from the catalog; null if SKU is not yet in the catalog."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LocationLookupResponse": {
        "type": "object",
        "required": [
          "locations"
        ],
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationDetail"
            },
            "description": "The requested locations that resolved, ordered by full_path ascending. Uuids that did not resolve — unknown, belonging to another store, or soft-deleted — are absent, so this array may be shorter than the request and may be empty. There is no pagination: the request's uuid list is already the bound.\n"
          }
        }
      },
      "LocationSearchResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "locations"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total count of locations matching the search query (regardless of pagination)"
          },
          "limit": {
            "type": "integer",
            "description": "Page size used for this response"
          },
          "offset": {
            "type": "integer",
            "description": "Page offset used for this response"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationDetail"
            },
            "description": "Flat list of matching locations ordered by full_path (breadcrumb) ascending. Each item includes an ancestors array for rendering a breadcrumb.\n"
          }
        }
      },
      "LocationTreeNode": {
        "description": "A location with its children expanded to the requested depth. At the depth boundary, children is an empty array — compare with child_count to distinguish \"no children\" (child_count == 0) from \"children not yet loaded\" (child_count > 0).\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/Location"
          },
          {
            "type": "object",
            "required": [
              "children"
            ],
            "properties": {
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LocationTreeNode"
                }
              }
            }
          }
        ]
      },
      "LocationStoreStats": {
        "type": "object",
        "description": "Store-wide roll-up over every non-deleted location, independent of `depth`, `parent_location_uuid` and the page. Present only when the request set `include_stats=true`.\n",
        "required": [
          "total_cards",
          "total_bins",
          "total_containers",
          "maximum_capacity"
        ],
        "properties": {
          "total_cards": {
            "type": "integer",
            "description": "Sum of total_quantity across every storage row in the store."
          },
          "total_bins": {
            "type": "integer",
            "description": "Number of bin locations in the store."
          },
          "total_containers": {
            "type": "integer",
            "description": "Number of container locations in the store."
          },
          "maximum_capacity": {
            "type": "integer",
            "description": "Sum of maximum_capacity across the store's bins (bins with none contribute 0)."
          }
        }
      },
      "LocationTreeResponse": {
        "type": "object",
        "required": [
          "total",
          "level_total",
          "limit",
          "offset",
          "has_more",
          "depth",
          "locations"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total count of all locations in the store (regardless of depth or parent_location_uuid filter)"
          },
          "level_total": {
            "type": "integer",
            "description": "Total number of nodes at the queried level — the direct children of `parent_location_uuid`, or the store's root-level locations — before `limit`/`offset` are applied. This is what `locations` is a page of.\n"
          },
          "limit": {
            "type": "integer",
            "description": "The per-parent node cap used for this response."
          },
          "offset": {
            "type": "integer",
            "description": "The offset applied to the queried level."
          },
          "has_more": {
            "type": "boolean",
            "description": "True when more nodes exist at the queried level past this page. Request the next page with `offset = offset + limit`.\n"
          },
          "depth": {
            "type": "integer",
            "description": "The depth level used for this response"
          },
          "stats": {
            "$ref": "#/components/schemas/LocationStoreStats"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationTreeNode"
            },
            "description": "Root-level nodes when no parent_location_uuid is specified, or direct children of the given parent_location_uuid. Ordered by sequence_index, and capped at `limit` — this is one page of `level_total`.\n\nNodes below the queried level are capped at `limit` children each with no way to page them in place: compare a node's `child_count` with the length of its `children` to detect the truncation, and load the rest by re-querying with that node as `parent_location_uuid`.\n"
          }
        }
      },
      "LocationType": {
        "type": "string",
        "enum": [
          "container",
          "bin"
        ],
        "description": "Semantic location type. \"container\" locations can have children but cannot hold cards directly. \"bin\" locations hold cards but cannot have children.\n"
      },
      "Marketplace": {
        "type": "string",
        "description": "A marketplace an order can belong to. `TCGPLAYER_DIRECT` and `CARD_TRADER_ZERO` are fulfilment *programs* running on a parent account (TCGplayer and CardTrader respectively) rather than accounts of their own — a store connects the parent and holds no separate credential for them. They appear here so a hub sale is distinguishable in order reads and filters; the repricing rule vocabulary is `RepriceMarketplace`, which is sourced separately and overlaps only partly with this list.",
        "enum": [
          "CARD_NEXUS",
          "CARD_TRADER",
          "CARD_TRADER_ZERO",
          "CARDMARKET",
          "EBAY",
          "LIGHTSPEED",
          "MANA_POOL",
          "MISPRINT",
          "SHOPIFY",
          "SICK_DEALS",
          "SNAPCASTER",
          "SQUARE",
          "TCGPLAYER",
          "TCGPLAYER_DIRECT",
          "WHATNOT"
        ]
      },
      "RepriceMarketplace": {
        "type": "string",
        "description": "A channel a repricing rule can name -- in a `MARKETPLACE` condition, in a `DO NOT LIST ON` action, or as the target of a manual per-marketplace price override. Sourced from the DSL's own `MarketplaceName`, so it is neither `Marketplace` nor `OrderMarketplace`: `CARD_TRADER_ZERO` is absent (a fulfilment program on the parent CardTrader account, with no listings of its own to price), while `KIOSK` is present (the in-store pickup storefront -- not a listing/sync target, but a channel the store can absolutely price separately, and one that reads its own override out of `pricing_data_overrides` instead of being pushed to). `EBAY` is present too, ahead of the provider: a rule or override can target it today, stored the same way as every other marketplace, but nothing pushes a listing or price to eBay until that provider ships. `SNAPCASTER` is present ahead of its push the same way (#3735): it lists in CAD, and a store priced in another currency is listed there at its prices converted at its exchange rate (FX-5).\nPrefer the live `marketplace_values` / `suppress_marketplace_values` arrays from the rule-builder metadata endpoint over hardcoding this.",
        "enum": [
          "CARDMARKET",
          "CARD_NEXUS",
          "CARD_TRADER",
          "EBAY",
          "KIOSK",
          "LIGHTSPEED",
          "MANA_POOL",
          "MISPRINT",
          "SHOPIFY",
          "SICK_DEALS",
          "SNAPCASTER",
          "SQUARE",
          "TCGPLAYER",
          "TCGPLAYER_DIRECT",
          "WHATNOT"
        ]
      },
      "MarketplaceFeesReportResponse": {
        "type": "object",
        "required": [
          "from",
          "to",
          "rows",
          "totals"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceFeesRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/MarketplaceFeesTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/MarketplaceFeesReportCurrency"
            }
          }
        }
      },
      "MarketplaceFeesReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceFeesRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/MarketplaceFeesTotals"
          }
        }
      },
      "MarketplaceFeesRow": {
        "type": "object",
        "required": [
          "marketplace",
          "fee_usd",
          "order_count",
          "avg_fee_per_order_usd"
        ],
        "properties": {
          "marketplace": {
            "type": "string"
          },
          "fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "order_count": {
            "type": "integer"
          },
          "avg_fee_per_order_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "MarketplaceFeesTotals": {
        "type": "object",
        "required": [
          "fee_usd",
          "order_count"
        ],
        "properties": {
          "fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "order_count": {
            "type": "integer"
          }
        }
      },
      "ListingSuppression": {
        "type": "object",
        "description": "One marketplace a SKU is kept off.",
        "required": [
          "marketplace",
          "source"
        ],
        "properties": {
          "marketplace": {
            "$ref": "#/components/schemas/RepriceMarketplace"
          },
          "source": {
            "type": "string",
            "enum": [
              "rule",
              "manual"
            ],
            "description": "`rule`: a `DO NOT LIST ON` repricing rule matched the card (`state: listed` lifts it). `manual`: removed by hand (`setListingState` with `state: removed`), whatever the rules say; the repricing sweep never clears it.\n"
          }
        }
      },
      "MarketplacePriceOverrides": {
        "description": "Per-marketplace retail price overrides for a SKU. Absent means the SKU falls back to the base price on that channel. Keys are the `RepriceMarketplace` vocabulary, since a repricing rule writes into the same table the manual editor does -- so a key here may be one the store never set by hand.\n",
        "type": "object",
        "properties": {
          "CARDMARKET": {
            "type": "number",
            "format": "double",
            "description": "Override price for Cardmarket, in the store's currency."
          },
          "CARD_TRADER": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for CardTrader."
          },
          "CARD_NEXUS": {
            "type": "number",
            "format": "double",
            "description": "Override price for CardNexus. CardNexus lists it only when it is in the account's selling currency.\n"
          },
          "EBAY": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for eBay. Stored the same way as every other marketplace, but nothing pushes it to eBay yet -- there is no eBay provider.\n"
          },
          "MISPRINT": {
            "type": "number",
            "format": "double",
            "description": "Override price in US dollars for Misprint (USD-only accounts)."
          },
          "KIOSK": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for the in-store pickup kiosk. Unlike the others this is not pushed anywhere -- the kiosk storefront reads it directly -- so it applies whether or not the store has any marketplace connected.\n"
          },
          "LIGHTSPEED": {
            "type": "number",
            "format": "double",
            "description": "Override price for Lightspeed, in the store's currency (the connect flow refuses an account in another one). Pushed to the store's Lightspeed outlet like Square's.\n"
          },
          "MANA_POOL": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for ManaPool."
          },
          "SHOPIFY": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for Shopify."
          },
          "SNAPCASTER": {
            "type": "number",
            "format": "double",
            "description": "Override price for Snapcaster, in Canadian dollars whatever the store's currency (Snapcaster lists only in CAD). Stored ahead of the Snapcaster push, which does not exist yet.\n"
          },
          "SQUARE": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for Square."
          },
          "TCGPLAYER": {
            "type": "number",
            "format": "double",
            "description": "Override price in dollars for TCGPlayer."
          },
          "WHATNOT": {
            "type": "number",
            "format": "double",
            "description": "Override price for Whatnot, in the store's currency. Converted at the store's exchange rate when the Whatnot account sells in another one.\n"
          }
        }
      },
      "MarketplaceResyncJobList": {
        "description": "A store's marketplace resync jobs, newest first.",
        "type": "object",
        "required": [
          "jobs"
        ],
        "properties": {
          "jobs": {
            "type": "array",
            "description": "Resync jobs matching the requested status filter.",
            "items": {
              "$ref": "#/components/schemas/MarketplaceResyncJob"
            }
          }
        }
      },
      "MarketplaceListingDrift": {
        "description": "The latest live audit's findings for one marketplace.",
        "type": "object",
        "required": [
          "marketplace",
          "audited_at",
          "compared",
          "counts",
          "kept_total",
          "findings",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "marketplace": {
            "type": "string"
          },
          "audited_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the latest completed audit finished. Null when the marketplace was never audited for this store."
          },
          "compared": {
            "type": "integer",
            "description": "Cards the latest audit compared. 0 when never audited."
          },
          "counts": {
            "$ref": "#/components/schemas/MarketplaceListingDriftCounts"
          },
          "kept_total": {
            "type": "integer",
            "description": "Cards the store marked as listed on purpose (`state=kept`), which `counts` leaves out."
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceListingDriftFinding"
            }
          },
          "total": {
            "type": "integer",
            "description": "Findings matching the filters, across all pages."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "MarketplaceListingDriftCounts": {
        "description": "Open findings per direction (kept cards are not counted). A card whose quantity and price both differ counts under quantity and under price.\n",
        "type": "object",
        "required": [
          "extra",
          "quantity",
          "price",
          "missing"
        ],
        "properties": {
          "extra": {
            "type": "integer",
            "description": "Cards for sale on the marketplace that HippoLink is not offering."
          },
          "quantity": {
            "type": "integer"
          },
          "price": {
            "type": "integer"
          },
          "missing": {
            "type": "integer",
            "description": "Cards HippoLink would list that the marketplace does not have."
          }
        }
      },
      "MarketplaceListingDriftFinding": {
        "description": "One card the marketplace disagrees with HippoLink about.",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "bucket",
          "directions",
          "hl_quantity",
          "hl_price_cents",
          "hl_stock",
          "live_quantity",
          "live_price_cents",
          "duplicates",
          "first_seen_at",
          "removal_requested_at",
          "kept_at",
          "tcgplayer_product_id",
          "game",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "language",
          "image_url",
          "catalog_lookup_failed"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "bucket": {
            "type": "string",
            "enum": [
              "extra_on_marketplace",
              "suppressed_but_live",
              "out_of_scope_but_live",
              "unmapped_but_live",
              "unpriced_but_live",
              "qty_price_mismatch",
              "qty_mismatch",
              "price_mismatch",
              "missing_on_marketplace",
              "no_mapping_with_stock",
              "unpriced_with_stock"
            ],
            "description": "Why the card is listed. extra_on_marketplace: HippoLink has no sellable stock. suppressed_but_live: a DO NOT LIST ON rule or a do-not-sell tag keeps it off. out_of_scope_but_live: outside what HippoLink syncs to this marketplace. unmapped_but_live: HippoLink can no longer address the listing. unpriced_but_live: HippoLink has no price for it. qty_mismatch / price_mismatch / qty_price_mismatch: listed on both sides with different numbers. missing_on_marketplace: HippoLink would list it and the marketplace does not have it. no_mapping_with_stock / unpriced_with_stock: HippoLink has stock but no mapping or no price, so it can never list.\n"
          },
          "directions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "extra",
                "quantity",
                "price",
                "missing"
              ]
            }
          },
          "hl_quantity": {
            "type": "integer",
            "description": "The quantity HippoLink would list."
          },
          "hl_price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The price HippoLink would list at, in the marketplace's currency."
          },
          "hl_stock": {
            "type": "integer",
            "description": "Copies HippoLink holds, listed or not."
          },
          "live_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The quantity listed on the marketplace. Null when it has no listing."
          },
          "live_price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The marketplace listing's price. Null when it has no listing or reports no price."
          },
          "duplicates": {
            "type": "integer",
            "description": "Extra marketplace listings for the same card beyond the first."
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "The first audit run that found this card drifted, in any direction, and every run since has."
          },
          "removal_requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the store last asked for this listing to be removed (`removeMarketplaceListingDrift`). The finding stays until an audit no longer sees the listing; one still here after a later audit means the removal did not land. Cleared when the card stops being an `extra` finding (it was restocked, say).\n"
          },
          "kept_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the store marked this card as listed on purpose (`keepMarketplaceListingDrift`). Cleared by the next audit that sees a different quantity listed.\n"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "catalog_lookup_failed": {
            "type": "boolean",
            "description": "True when the catalog lookup failed, so null card fields mean unknown rather than not in the catalog."
          }
        }
      },
      "MarketplaceListingDriftActionRequest": {
        "description": "The cards to act on, by TCGplayer SKU id.",
        "type": "object",
        "required": [
          "tcgplayer_sku_ids"
        ],
        "properties": {
          "tcgplayer_sku_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        }
      },
      "MarketplaceListingDriftActionResult": {
        "description": "Which cards the action applied to, and why each other one was skipped.",
        "type": "object",
        "required": [
          "accepted",
          "skipped"
        ],
        "properties": {
          "accepted": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "reason"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "not_found",
                    "not_removable",
                    "not_listed",
                    "not_keepable",
                    "removal_requested",
                    "not_kept"
                  ],
                  "description": "not_found: the latest audit has no finding for the card (it cleared, or never drifted). not_removable: the finding is not one a quantity of 0 repairs (another direction, or a listing HippoLink cannot address). not_listed: the marketplace lists 0. not_keepable: not a card for sale there that HippoLink is not offering. removal_requested: the card's removal is already on its way and cannot be called back. not_kept: the card is not kept.\n"
                }
              }
            }
          }
        }
      },
      "MarketplaceResyncWalkProgress": {
        "description": "Page counts for a running marketplace walk.",
        "type": "object",
        "required": [
          "pages_read",
          "listings_read",
          "walks",
          "attempt"
        ],
        "properties": {
          "pages_read": {
            "type": "integer",
            "description": "Pages read so far, across every walk this attempt has started."
          },
          "listings_read": {
            "type": "integer",
            "description": "Listings read so far."
          },
          "total_pages": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Page count the current walk reported. Comparable to pages_read only while walks is 1; a TCGplayer diff walks once per game.\n"
          },
          "walks": {
            "type": "integer",
            "description": "Paginated walks started so far in this attempt."
          },
          "pages_known": {
            "type": "integer",
            "description": "Sum of the page counts every started walk has reported. The total to compare pages_read against when several walks run at once; it grows as walks start.\n"
          },
          "searches_planned": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many searches the walk will run, when known up front. A TCGplayer teardown runs one per game and language, all at once. Null otherwise.\n"
          },
          "searches_done": {
            "type": "integer",
            "description": "Searches that have finished. Compare against searches_planned."
          },
          "attempt": {
            "type": "integer",
            "description": "Which attempt this is. A walk that runs out of time starts over from page 1 on the next attempt, so pages_read drops back.\n"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this attempt's walk started."
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this attempt's time budget runs out. The walk must finish by then or the attempt is abandoned (retried once, then the job fails). A client counts down to it. Null when the walk runs without a budget.\n"
          }
        }
      },
      "MarketplaceResyncSnapshot": {
        "description": "Counts of the live listings a teardown snapshot found.",
        "type": "object",
        "required": [
          "listings_found",
          "delete_targets",
          "by_game",
          "by_language"
        ],
        "properties": {
          "listings_found": {
            "type": "integer",
            "description": "Every live listing the walk returned."
          },
          "delete_targets": {
            "type": "integer",
            "description": "Listings the delete phase acts on. On a marketplace where a delete zeroes quantity, only the in-stock ones.\n"
          },
          "by_game": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "listings_found per game, largest first. \"unknown\" when the marketplace does not say."
          },
          "by_language": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "listings_found per language, largest first."
          }
        }
      },
      "MarketplaceResyncJob": {
        "description": "A marketplace force-resync job and its current progress.",
        "type": "object",
        "required": [
          "job_uuid",
          "status",
          "marketplace",
          "delete",
          "repopulate",
          "delete_is_zero_out",
          "deleted_count",
          "pushed_count",
          "failed_count",
          "stalled",
          "created_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "description": "Current lifecycle state of the resync job. \"cancelled\" is a terminal state reached when a caller cancels a still-pending or running job.\n"
          },
          "phase": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pending",
              "diff",
              "snapshot",
              "delete",
              "repopulate",
              "finalizing",
              null
            ],
            "description": "Which stage of the job the worker is in, or null once the job is terminal.\n\n\"diff\" is a reconcile's (delete \"tracked\") read phase: it enumerates the marketplace and compares it against HippoLink before writing anything. Both totals stay null for its whole duration, and when it finishes they are how far out of step the marketplace was.\n\n\"snapshot\" is the teardown's (delete \"all\") equivalent: enumerate the entire live listing set in one long call before deleting any of it, during which deleted_count stays 0 and delete_total stays null.\n\nA job sitting in either is working, not stuck — check \"stalled\" for that.\n"
          },
          "phase_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "One human-readable sentence describing the current phase, including why its counters look the way they do. Null once terminal.\n"
          },
          "walk_progress": {
            "description": "How far the marketplace walk has got while phase is \"snapshot\" or \"diff\", sampled by the worker every ~15 seconds. Null in any other phase, before the first sample lands, and on a marketplace whose walk does not report pages (today only TCGplayer does).\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MarketplaceResyncWalkProgress"
              },
              {
                "type": "null"
              }
            ]
          },
          "snapshot": {
            "description": "What a teardown's (delete \"all\") snapshot found, written before the first delete. Null on a reconcile and before the snapshot lands.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MarketplaceResyncSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "marketplace": {
            "type": "string",
            "description": "Marketplace the job targets."
          },
          "delete": {
            "type": "string",
            "enum": [
              "tracked",
              "all"
            ]
          },
          "repopulate": {
            "type": "boolean"
          },
          "delete_is_zero_out": {
            "type": "boolean",
            "description": "True when this job's \"delete\" only sets the listing's quantity to 0 and leaves the listing in place. Watching such an account during a resync shows quantities fall to zero, never listings disappearing — which reads as \"the resync deleted nothing\" unless you know to expect it.\n\nDepends on the scope as well as the marketplace, because the two remove a listing by different means: a teardown calls the marketplace's own delete (only TCGplayer cannot remove a listing), while a reconcile delists through the ordinary push, which is a quantity-0 update everywhere except ManaPool.\n"
          },
          "deleted_count": {
            "type": "integer",
            "description": "Listings DISPATCHED to the marketplace for deletion so far — not listings confirmed deleted. Subtract failed_count for what landed.\n"
          },
          "delete_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total listings to delete, once known: everything the account holds for a teardown, or the number the diff found live on the marketplace but not sellable in HippoLink for a reconcile. Null until the \"diff\"/\"snapshot\" phase finishes.\n"
          },
          "pushed_count": {
            "type": "integer",
            "description": "Listings DISPATCHED to the marketplace so far — not listings confirmed created. Subtract failed_count for what landed.\n"
          },
          "push_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Total listings to push, once known: the store's whole stocked set for a teardown, or only the SKUs the diff found missing or drifted for a reconcile. Null until a reconcile's \"diff\" phase finishes; 0 when repopulate is false.\n"
          },
          "failed_count": {
            "type": "integer",
            "description": "Cards the marketplace rejected, across both phases. deleted_count and pushed_count count what was sent, so without this a job that had half its cards rejected looks identical to a fully successful one.\n"
          },
          "failure_reasons": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Rejection reason to number of cards rejected for it. A key is the marketplace's own explanation (e.g. a CardTrader field error, trimmed to 200 characters), or one of our codes for a failure on our side (rate_limited, auth_failed, timeout, unavailable, rejected, deferred, unexpected). Null on a job that ran before these counters existed — distinct from {}, which means the job recorded no failures.\n"
          },
          "revival_count": {
            "type": "integer",
            "description": "How many times the staleness reaper has re-enqueued this job after finding it stuck (updated_at stale) in \"pending\"/\"running\". Failed automatically once this exceeds the reaper's configured max.\n"
          },
          "summary": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Result summary, populated when the job completes."
          },
          "diff": {
            "type": [
              "object",
              "null"
            ],
            "description": "What a reconcile's diff found, readable as soon as the \"diff\" phase ends and therefore before any write reaches the marketplace. Null on a teardown, and on a reconcile that has not finished diffing.\n\nCounts are the signal and samples are the entry point into a log query — neither is exhaustive for a badly drifted store. Additional keys may be added.\n",
            "additionalProperties": true,
            "properties": {
              "compared": {
                "type": "integer",
                "description": "SKUs judged, after narrowing to what the walk actually looked for."
              },
              "live_attributed": {
                "type": "integer",
                "description": "Live listings the walk could attribute to a HippoLink SKU."
              },
              "live_total": {
                "type": "integer",
                "description": "Listings the walk saw at all, attributable or not."
              },
              "unattributed": {
                "type": "integer",
                "description": "Live on the marketplace, not resolvable to a HippoLink SKU. Reported, never acted on — it may be the store's own listing.\n"
              },
              "oversell_skus": {
                "type": "integer",
                "description": "SKUs the marketplace can sell that HippoLink is not offering. The number that decides whether a reconcile is urgent.\n"
              },
              "to_delist": {
                "type": "integer",
                "description": "Listings this job will take down."
              },
              "to_push": {
                "type": "integer",
                "description": "SKUs this job will push."
              },
              "delists_withheld": {
                "type": "integer",
                "description": "Listings that need delisting which this job will not touch — 0 normally. Non-zero when the marketplace carries no ownership stamp (TCGPLAYER, MANA_POOL), or when the blast-radius fuse refused the direction because the enumeration looked truncated.\n"
              },
              "withheld_reason": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why delists_withheld is non-zero, or null."
              },
              "acks_corrected": {
                "type": "integer",
                "description": "Rows corrected in HippoLink's record of what it last sent this marketplace, so the background drift sweep stops comparing against a stale belief.\n"
              },
              "directions": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "Drift by direction — extra, quantity, price, missing."
              },
              "drift": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "Drift by finding, worst first. Empty when nothing disagreed."
              },
              "advisory": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "Not drift in itself, but a latent cause of it — duplicate listings for one SKU, zero-quantity leftovers. Reported and not acted on.\n"
              },
              "samples": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "description": "A few example SKU ids per finding, for triage."
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "What the walk could and could not see on this marketplace."
              }
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable snake_case code for why the job failed (resync_marketplace_auth_failed, resync_marketplace_unavailable, resync_stalled, resync_superseded, ...). Null until the job fails, and on jobs that failed before codes existed.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-facing explanation of the failure, populated when the job fails. Plain language, safe to show to the store; never raw exception text.\n"
          },
          "stalled": {
            "type": "boolean",
            "description": "True when the job is pending/running and its updated_at is older than the staleness window the reaper uses to decide whether to revive it. This is the field to check for \"is it stuck?\" — a long \"snapshot\" phase is not.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the worker last advanced the job. Its age is what separates a job making progress from a wedged one.\n"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MarketplaceResyncRequest": {
        "description": "Force-resync parameters. delete \"all\" wipes every listing on the marketplace and is restricted to sys-admins (enforced server-side); delete \"tracked\" is a reconcile and is available to store owners and managers on every marketplace.\n",
        "type": "object",
        "required": [
          "delete",
          "repopulate"
        ],
        "properties": {
          "delete": {
            "type": "string",
            "enum": [
              "tracked",
              "all"
            ],
            "description": "\"tracked\" reconciles: it diffs the marketplace's live listings against what HippoLink should be listing and writes only the difference, so a marketplace already in step is left untouched. It delists only listings it can prove are HippoLink's (the SKU or stamp we wrote when creating them), which on TCGPLAYER and MANA_POOL is none of them — there it repairs quantity, price and missing listings and reports the rest.\n\n\"all\" tears the account down and rebuilds it: every listing on the marketplace is removed and the store's whole inventory re-pushed (sys-admin only). On Square it also takes items filed under a HippoLink reporting category that carry no HippoLink SKU. Slower by the size of the account rather than the size of the drift, and the store's listings are down in the middle of it — so it is the fallback for what a reconcile cannot reach, not the default.\n"
          },
          "repopulate": {
            "type": "boolean",
            "description": "Whether to push after deleting. On \"all\" that is the store's entire current inventory; on \"tracked\" it is the SKUs the diff found missing or listed at the wrong quantity or price. False leaves a reconcile as removal-only.\n"
          }
        }
      },
      "MarketPrices": {
        "description": "Market price data from external sources. All price fields are nullable — null indicates no data available for that source/condition combination. Keys are the fixed-condition price-variable names. Since #1161 the stored platform_prices row carries the condition-agnostic name plus a separate condition column, so the server maps each row back to the key here; a condition with no fixed-condition spelling (Moderately Played, Heavily Played, Damaged) has no key and is omitted.\n",
        "type": "object",
        "properties": {
          "TCGPLAYER_LOW_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_LOW_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_LOW_WITH_SHIPPING_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_LOW_WITH_SHIPPING_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_MARKET_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_MARKET_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_DIRECT_LOW_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_DIRECT_LOW_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_RETAIL_QUANTITY_NEAR_MINT": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Near Mint"
          },
          "TCGPLAYER_RETAIL_QUANTITY_LIGHTLY_PLAYED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Lightly Played"
          },
          "TCGPLAYER_DELUXE_LOW_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_DELUXE_LOW_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_RETAIL_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_RETAIL_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_RETAIL_QUANTITY_NEAR_MINT": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Near Mint"
          },
          "CARDKINGDOM_RETAIL_QUANTITY_LIGHTLY_PLAYED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Lightly Played"
          },
          "CARDKINGDOM_BUYLIST_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_BUYLIST_QUANTITY_NEAR_MINT": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Buylist quantity wanted"
          },
          "MANAPOOL_LOW_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "MANAPOOL_LOW_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "MANAPOOL_MARKET": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "MANAPOOL_RETAIL_QUANTITY_NEAR_MINT": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Near Mint"
          },
          "MANAPOOL_RETAIL_QUANTITY_LIGHTLY_PLAYED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Lightly Played"
          },
          "CARDTRADER_LOW_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_LOW_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_MEDIAN_NEAR_MINT": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_MEDIAN_LIGHTLY_PLAYED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_RETAIL_QUANTITY_NEAR_MINT": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Near Mint"
          },
          "CARDTRADER_RETAIL_QUANTITY_LIGHTLY_PLAYED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Lightly Played"
          },
          "CARDKINGDOM_RETAIL_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_RETAIL_QUANTITY_UNOPENED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity available Unopened"
          },
          "CARDKINGDOM_BUYLIST_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDKINGDOM_BUYLIST_QUANTITY_UNOPENED": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Buylist quantity wanted"
          },
          "TCGPLAYER_LOW_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Lowest item price for sealed/unopened product (excludes shipping)."
          },
          "TCGPLAYER_LOW_WITH_SHIPPING_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Delivered low (cheapest listing's item price + shipping) for sealed/unopened product (#1207)."
          },
          "TCGPLAYER_MARKET_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_DIRECT_LOW_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "TCGPLAYER_DELUXE_LOW_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Lowest item price for sealed/unopened product among gold-star sellers with a long sales record. Only sealed products above the premium crawl's floor are scanned, so this is null on cheaper ones.\n"
          },
          "MANAPOOL_LOW_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "MANAPOOL_MARKET_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_LOW_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "CARDTRADER_MEDIAN_UNOPENED": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "MarkMissingRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional reason the item could not be found"
          }
        }
      },
      "MoveCardsRequest": {
        "type": "object",
        "description": "Provide exactly one of `tcgplayer_sku_ids` or `filters` (supplying both, or neither, is a 422; the cross-field rule is validated server-side).\n",
        "properties": {
          "tcgplayer_sku_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Explicit SKUs whose full on-hand stock is moved into the destination bin. Mutually exclusive with `filters`.\n"
          },
          "filters": {
            "type": "object",
            "description": "Inventory listing-filter criteria resolved server-side against the store's live inventory, with the same semantics as the `listInventory` query parameters of the same names. Every SKU of every matching product is selected, except for the per-SKU keys (`condition`, `tags`), which are re-applied to the expanded SKU set so only the matching variants are taken. Each key is optional. Mutually exclusive with `tcgplayer_sku_ids`.\n",
            "properties": {
              "search": {
                "type": "string",
                "description": "Search string with the same semantics as `listInventory`'s `search` parameter — per-word product-name matching plus the inline Scryfall-style operators (`set:`/`e:`, `cn:`/`number:`, `c:`/`color:`), so the grid's search box can be forwarded verbatim. See that parameter for the full grammar. A recognized operator with an unusable value (`set:`, `c:x`) is a 422 naming it. `bin:` and `container:` select the PRODUCTS those locations hold, not the copies in them — the SKU expansion is store-wide, so a move filtered by one still takes each matching card's whole on-hand stock, exactly as the `location_uuid` key does.\n"
              },
              "condition": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardConditionInput"
                },
                "description": "Match products with at least one SKU in any of these conditions. An `eu` store may use its own Cardmarket/MKM vocabulary; values are translated to the stored US grades server-side (#1599).\n"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Match cards carrying at least one of these tag slugs, case-insensitively. Re-applied after the product expansion, like `condition`, so only the tagged variants are selected -- except that a PRODUCT-grain assignment legitimately keeps every variant of that card, which is what assigning it to the product means.\n"
              },
              "game": {
                "$ref": "#/components/schemas/GameId"
              },
              "rarity": {
                "type": "string",
                "description": "Case-insensitive substring match on rarity."
              },
              "set_name": {
                "type": "string",
                "description": "Case-insensitive substring match on set name or short set code."
              },
              "product_number": {
                "type": "string",
                "description": "Case-insensitive exact match on collector number."
              },
              "price_min": {
                "type": "number",
                "format": "double",
                "description": "Minimum price (inclusive), in USD."
              },
              "price_max": {
                "type": "number",
                "format": "double",
                "description": "Maximum price (inclusive), in USD."
              },
              "quantity_min": {
                "type": "integer",
                "minimum": 0,
                "description": "Minimum total quantity (inclusive)."
              },
              "quantity_max": {
                "type": "integer",
                "minimum": 0,
                "description": "Maximum total quantity (inclusive)."
              },
              "quantity_visible_min": {
                "type": "integer",
                "minimum": 0,
                "description": "Minimum visible quantity (inclusive)."
              },
              "quantity_visible_max": {
                "type": "integer",
                "minimum": 0,
                "description": "Maximum visible quantity (inclusive)."
              },
              "cogs_min": {
                "type": "number",
                "format": "double",
                "minimum": 0,
                "description": "Minimum weighted-average cost of goods (inclusive)."
              },
              "cogs_max": {
                "type": "number",
                "format": "double",
                "minimum": 0,
                "description": "Maximum weighted-average cost of goods (inclusive)."
              },
              "first_inventoried_after": {
                "type": "string",
                "format": "date-time",
                "description": "First inventoried at or after this timestamp (inclusive, ISO 8601)."
              },
              "first_inventoried_before": {
                "type": "string",
                "format": "date-time",
                "description": "First inventoried before this timestamp (exclusive, ISO 8601)."
              },
              "last_inventoried_after": {
                "type": "string",
                "format": "date-time",
                "description": "Last inventoried at or after this timestamp (inclusive, ISO 8601)."
              },
              "last_inventoried_before": {
                "type": "string",
                "format": "date-time",
                "description": "Last inventoried before this timestamp (exclusive, ISO 8601)."
              },
              "last_copy_sold_after": {
                "type": "string",
                "format": "date-time",
                "description": "Last copy sold at or after this timestamp (inclusive, ISO 8601)."
              },
              "last_copy_sold_before": {
                "type": "string",
                "format": "date-time",
                "description": "Last copy sold before this timestamp (exclusive, ISO 8601)."
              },
              "never_sold": {
                "type": "boolean",
                "description": "When true, select only products that have never had a non-canceled, non-refunded sale. Mutually exclusive with the `last_copy_sold_*` bounds.\n"
              },
              "location_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "Select only products with at least one SKU stored at this location.\n"
              }
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "tcgplayer_sku_ids"
            ]
          },
          {
            "required": [
              "filters"
            ]
          }
        ]
      },
      "MoveCardsResponse": {
        "type": "object",
        "required": [
          "moved",
          "conflicts",
          "location",
          "move_uuid"
        ],
        "properties": {
          "moved": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "quantity_moved"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "quantity_moved": {
                  "type": "integer",
                  "description": "Total on-hand quantity consolidated into the destination bin for this SKU.\n"
                }
              }
            },
            "description": "SKUs whose full on-hand stock was moved into the destination bin."
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "reason"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "reason": {
                  "type": "string",
                  "description": "Why the SKU was skipped (e.g. every copy is held by an open pick run)."
                }
              }
            },
            "description": "SKUs skipped and left in place. Reported in-band on the 200 response, never as a 409.\n"
          },
          "location": {
            "$ref": "#/components/schemas/LocationDetailResponse"
          },
          "move_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The move's record, holding where each moved card sat before it moved. Pass it to `getLocationMovePullSheet` for a pull sheet of those bins, or to `undoLocationMove` to send the cards back. Null when nothing moved (every SKU is in `conflicts`).\n"
          }
        }
      },
      "TransferProductsRequest": {
        "type": "object",
        "required": [
          "products"
        ],
        "properties": {
          "destination_location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Bin the quantities move into, for every entry that does not name its own `destination_location_uuid`. Required unless every entry names one. Must be a bin (not a container) in the same store, and must differ from the source location in the path.\n"
          },
          "insert_position": {
            "$ref": "#/components/schemas/IntakeInsertPosition",
            "description": "Where the moved cards land in the destination bin's `sequence_index` order: `bottom` (default), `top`, `after_sku`, or `alphabetical` (each card at its A-Z spot among the bin's cards). The moved rows keep their source shelf order. A moved run joins an existing row only when it lands directly behind the same SKU; otherwise it becomes a new row. With several destinations it applies in each one, and `after_sku` is rejected (422), since its anchor names a card in one bin.\n"
          },
          "products": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_product_id",
                "tcgplayer_sku_id",
                "quantity"
              ],
              "properties": {
                "tcgplayer_product_id": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 1,
                  "description": "Product the SKU belongs to. Accepted for client-side ergonomics (matching `upsertLocationProducts`); the server keys the move on `tcgplayer_sku_id` alone.\n"
                },
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 1
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many copies to move out of the source location. Must not exceed the SKU's on-hand quantity there; a larger value is reported as an `insufficient_stock` conflict rather than being clamped.\n"
                },
                "slot": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Take only from this position. Omitted, copies come out of the SKU's rows in the source in shelf order.\n"
                },
                "destination_location_uuid": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Bin this entry moves into, overriding the request-level `destination_location_uuid`. Same rules: a bin in the same store, different from the source.\n"
                }
              }
            },
            "description": "Per-SKU quantities to move. Each (`tcgplayer_sku_id`, `slot`) pair may appear once across the whole request, whatever the destinations, so two positions of one SKU can move in one call; a SKU sent without `slot` must be its only entry (it already takes from every row).\n"
          }
        }
      },
      "TransferProductsResponse": {
        "type": "object",
        "required": [
          "moved",
          "conflicts"
        ],
        "properties": {
          "transfer_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "This transfer's id: the `ref_uuid` of the move history rows it wrote (listSkuLocationMoves) and the `transfer_uuid` of its audit row.\n"
          },
          "moved": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "slot",
                "quantity_moved",
                "source_remaining",
                "destination_location_uuid"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "destination_location_uuid": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Bin the copies moved into."
                },
                "slot": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "The `slot` the request entry named, or null when it named none."
                },
                "quantity_moved": {
                  "type": "integer",
                  "description": "Copies moved into the destination bin."
                },
                "source_remaining": {
                  "type": "integer",
                  "description": "On-hand quantity left in the source location afterwards. A zero here means the source storage row was deleted.\n"
                }
              }
            },
            "description": "SKUs whose requested quantity moved."
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "slot",
                "reason",
                "destination_location_uuid"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "destination_location_uuid": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Bin the entry was headed for."
                },
                "slot": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "description": "The `slot` the request entry named, or null when it named none."
                },
                "reason": {
                  "type": "string",
                  "description": "Why the SKU was skipped: `no_stock` (not stocked in the source location), `insufficient_stock` (fewer copies on hand than requested), or `active_fulfillment_run` (more than the copies open pick runs leave free).\n"
                }
              }
            },
            "description": "SKUs skipped and left in place. Reported in-band on the 200 response, never as a 409.\n"
          }
        }
      },
      "OrderDetail": {
        "description": "Full order view including line items, shipping address, shipment details, and status history.\n",
        "type": "object",
        "required": [
          "order_uuid",
          "marketplace",
          "marketplace_order_id",
          "status",
          "first_name",
          "last_name",
          "item_count",
          "order_total",
          "currency",
          "order_subtotal",
          "non_hl_subtotal",
          "shipping_total",
          "tax_total",
          "tip_total",
          "discount_total",
          "shipping_address",
          "line_items",
          "status_history",
          "refunds",
          "refund_summary",
          "ordered_at",
          "updated_at",
          "created_at"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "$ref": "#/components/schemas/OrderMarketplace"
          },
          "marketplace_order_id": {
            "type": "string",
            "description": "Order ID as assigned by the marketplace"
          },
          "marketplace_order_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Direct link to the order on the marketplace, null when the marketplace has none"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency",
            "description": "ISO currency of the order, and of every amount on it (and on its line items). Fixed when the order is ingested."
          },
          "fulfillment_method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ship",
              "pickup",
              "in_store",
              null
            ],
            "description": "Buyer's fulfillment method, normalized at ingest (Shopify local-pickup and Square PICKUP map to pickup; a Square register sale with no delivery-method fulfillment, or an explicit Square IN_STORE fulfillment, maps to in_store; other marketplaces default to ship). Null means unknown (orders ingested before capture existed). Manually overridable via updateOrder."
          },
          "shipping_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tracked",
              "untracked",
              null
            ],
            "description": "How a shipped order physically left the building. `tracked` — a carrier label that came back with a tracking number, or a tracking number the seller entered by hand. `untracked` — a stamp tier (PWE 1oz/2oz, large letter), a carrier service that cannot be tracked (Pitney Bowes First-Class Mail), or an explicit \"shipped, no tracking\". Null when the order has not shipped, when it was handed over rather than mailed (fulfillment_method pickup or in_store), or on a historical row predating the field."
          },
          "expected_shipping_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "letter",
              "flat",
              "tracked",
              null
            ],
            "description": "How an open order is expected to ship, predicted before it does (#3585). `tracked` when the marketplace requires tracking (TCGplayer at $50 or more, or Expedited; a Mana Pool tier other than first_class), when a matching shipping rule asks for a signature or insurance, or when the first matching shipping rule with a package sets `package` (or a legacy bubble-mailer tier). `letter` or `flat` when that rule sets one (or a legacy stamp tier). With no such rule, `letter` (a 1 oz PWE). Recomputed when the order's lines or the store's shipping rules change, and daily. Null for a pickup or in-store order, an order that is no longer open, or one not computed yet."
          },
          "expected_shipping_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sentence behind `expected_shipping_class`, for the order page and the packing slip, e.g. \"TCGPLAYER requires tracking on orders of $50.00 or more\", \"TCGPLAYER requires a signature on orders of $250.00 or more\" or \"Shipping rule Bulk: letter\". Null exactly when `expected_shipping_class` is."
          },
          "expected_signature": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "signature",
              "adult_signature",
              null
            ],
            "description": "The signature confirmation the predicted label will carry (#3688): `signature` when the marketplace requires one (TCGplayer at $250 or more), or the level a matching shipping rule's `signature_confirmation` asks for (a rule's level wins, as in the rate shop). Set only with `expected_shipping_class` `tracked`; null when no signature is expected, and whenever `expected_shipping_class` is null. The reason then names the signature rule."
          },
          "shipping_class_display": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "letter",
              "flat",
              "tracked",
              "untracked",
              null
            ],
            "description": "What a PWE / Tracked badge shows: once shipped, how it went out (`shipping_class`: `tracked` or `untracked`); before that, `expected_shipping_class`. Buying a label or a stamp on the order page is how a seller overrides the prediction."
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "buyer_email": {
            "type": "string",
            "format": "email"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/Address"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderLineItem"
            }
          },
          "canceled_items": {
            "type": "array",
            "description": "Units dropped from the order's lines after it was created (a Kiosk customer declining pulled cards, or the store unable to fill them; see `cause`), newest first. `line_items` carry only what is still owed.",
            "items": {
              "type": "object",
              "required": [
                "cancellation_uuid",
                "order_item_uuid",
                "tcgplayer_sku_id",
                "quantity",
                "unit_price",
                "physical_quantity",
                "catalog_matched",
                "created_at"
              ],
              "properties": {
                "cancellation_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "order_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "tcgplayer_product_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64"
                },
                "product_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The card as ordered, from the catalog. Null when the SKU is not in it (`catalog_matched` false). Present even when the line itself was cancelled in full and no longer names its SKU."
                },
                "flavor_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Promotional alternate name printed on the card (Magic only), when it has one."
                },
                "set_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Card set or edition name."
                },
                "condition": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CardCondition"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "language": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Card language."
                },
                "finish": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Card finish (e.g. Normal, Foil); the machine value, render `finish_label`."
                },
                "finish_label": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Display-only finish label; same meaning as on a line item."
                },
                "product_number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Collector number of the exact printing; same meaning as on a line item."
                },
                "variant_label": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Display-only treatment of the printing; same meaning as on a line item."
                },
                "image_uri": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uri"
                },
                "catalog_matched": {
                  "type": "boolean",
                  "description": "False when the SKU has no catalog entry; the name and printing fields are null then."
                },
                "quantity": {
                  "type": "integer"
                },
                "unit_price": {
                  "type": "number",
                  "format": "double",
                  "description": "Price per unit in the order's `currency`, as ordered."
                },
                "physical_quantity": {
                  "type": "integer"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "cause": {
                  "$ref": "#/components/schemas/OrderItemCancellationCause"
                },
                "in_stock": {
                  "type": [
                    "boolean",
                    "null"
                  ],
                  "description": "The store's answer to \"are these cards on the shelf?\" when they were removed. False: taken off the count (unpulled copies written off, pulled ones not restocked). True: returned to stock. Null: not asked (a removal from before the field, or a caller that did not send it), handled as true."
                },
                "canceled_by_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The staff member who removed the cards (name, else email). Null when the account is gone or the removal was made by HippoLink support."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "item_count": {
            "type": "integer",
            "description": "Total quantity across billable (HL) line items. Excludes non-HL lines (billable false) — see non_hl_subtotal for their total."
          },
          "order_subtotal": {
            "type": "number",
            "format": "double",
            "description": "Sum of billable line item totals in the order's `currency` (HL revenue)."
          },
          "non_hl_subtotal": {
            "type": "number",
            "format": "double",
            "description": "Sum of non-billable (non-HL) line item totals in the order's `currency` — display only, never HippoLink revenue, and not included in order_subtotal or item_count. Zero when the order has no non-HL lines (the common case). Computed at serialization, not stored."
          },
          "shipping_total": {
            "type": "number",
            "format": "double",
            "description": "Shipping total in the order's `currency`"
          },
          "tax_total": {
            "type": "number",
            "format": "double",
            "description": "Tax total in the order's `currency`"
          },
          "tip_total": {
            "type": "number",
            "format": "double",
            "description": "Tip collected at the register (POS orders) in the order's `currency`. Included in order_total, never billed."
          },
          "discount_total": {
            "type": "number",
            "format": "double",
            "description": "Discount applied at checkout (e.g. Square total_discount_money) in the order's `currency`. Reduces order_total below the line items' own prices; billing's revenue share is reduced by the same amount."
          },
          "order_total": {
            "type": "number",
            "format": "double",
            "description": "Total order amount in the order's `currency`"
          },
          "cogs_total": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Sum of line_cogs across all lines. Null if no lines were costed, or while any billable line's cogs_status is `pending` (its cost batch is not finished)."
          },
          "gross_profit": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "order_total minus cogs_total. Null if cogs_total is null, so also while any billable line's cogs_status is `pending`."
          },
          "shipment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Shipment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Shipment details, or null if not yet shipped"
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order's tracking number. Set either by a carrier label purchase or by the seller entering a number by hand for a parcel shipped outside HippoLink. Independent of `shipment`: a hand-entered number buys no label, so it lives here with no `shipment` alongside it, and is the only record of that parcel. Null when none was ever recorded."
          },
          "tracking_company": {
            "type": [
              "string",
              "null"
            ],
            "description": "Carrier for `tracking_number`, free text as the seller typed it (e.g. \"USPS\"). Null when unknown or when there is no tracking number."
          },
          "status_history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderStatusEvent"
            }
          },
          "refunds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Refund"
            },
            "description": "Refunds recorded against this order, oldest first."
          },
          "marketplace_reports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketplaceReport"
            },
            "description": "Reports of lines the store could not fulfill, sent to the marketplace, oldest first."
          },
          "refund_summary": {
            "$ref": "#/components/schemas/OrderRefundSummary"
          },
          "buyer_notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes from the buyer included with the order"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-form internal notes about the order, null when none were written"
          },
          "marketplace_metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Raw marketplace-specific fields preserved for reference"
          },
          "fraud_risk": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderFraudRisk"
              },
              {
                "type": "null"
              }
            ],
            "description": "Shopify's fraud-risk assessment for this order, recorded when Shopify sends it (asynchronously after checkout, and again whenever it changes until the order is fulfilled). Null for every non-Shopify order, for a Shopify order Shopify has not scored, and for orders that predate the feature."
          },
          "cardtrader_cancellation": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardTraderCancellation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Where a direct CardTrader order stands for cancellation, read from CardTrader's last webhook. Null for every other marketplace, including CardTrader Zero (which CardTrader's API cannot cancel)."
          },
          "address_verification": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderAddressVerification"
              },
              {
                "type": "null"
              }
            ],
            "description": "Snapcaster's verdict on the ship-to address, kept from the order's first event and every later `address_verified` update. Null for every other marketplace, and for a Snapcaster order with no verdict stored. Verification never blocks shipping."
          },
          "cancellation_request": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SnapcasterCancellationRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest buyer request to cancel a Snapcaster order, from Snapcaster's webhooks. Null when the buyer never asked, and for every other marketplace. While `status` is `open` the seller can honor it by cancelling (the order or the lines it names) or decline it with `declineCancellationRequest`."
          },
          "change_request": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SnapcasterChangeRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest change request on a Snapcaster order (the pending one while it waits for an answer, then the answer), whether the seller's fulfillment report or a buyer's `cancel_lines` / `address_change` request (see `kind` and `initiator`). Null for every other marketplace and when none exists."
          },
          "ordered_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "hold_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Presale hold date: the max catalog release date across the order's lines. Null when no line has a known release date."
          },
          "is_held": {
            "type": "boolean",
            "default": false,
            "description": "True when hold_until is in the future (evaluated at read time). A held order cannot be marked shipped unless the hold is overridden (see hold_overridden)."
          },
          "hold_overridden": {
            "type": "boolean",
            "default": false,
            "description": "True when a store user overrode the presale hold via POST .../hold-override (#1157), letting the order be marked shipped before hold_until."
          },
          "hold_overridden_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the hold was overridden, clearing the ship gate. Null while no override has been recorded."
          },
          "is_problematic": {
            "type": "boolean",
            "default": false,
            "description": "True if oversell detection or operator flagging marked this order problematic."
          },
          "problematic_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Machine or operator description of why the order was flagged."
          },
          "cardchaos": {
            "description": "Null unless the order was ever queued in CardChaos.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardChaosOrderState"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "alternate_copy_fulfilled",
              "partially_fulfilled",
              "unable_to_fulfill",
              "flagged_in_error",
              null
            ],
            "description": "How the problematic order was resolved. Null while unresolved. flagged_in_error means the flag was wrong, not that the operator did something about it. None of these change the order's status (#2334) -- read `status` for how the order ended. See updateOrder's resolution field for the write side, including the reopen action, which is never a value read back here."
          },
          "resolution_notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-form operator notes on the resolution."
          },
          "resolved_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUID of the user who recorded the resolution."
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "substitution_ack_required": {
            "type": "boolean",
            "default": false,
            "description": "True when the reallocation engine auto-substituted a lower condition for an exhausted SKU. Such an order cannot be marked shipped until the seller acknowledges the swap via POST .../substitution-ack (#884)."
          },
          "substitution_acked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the seller acknowledged the substitution, clearing the ship gate. Null while the acknowledgement is still outstanding."
          },
          "ready_for_pickup_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the order was marked ready for customer pickup. Null while the order is not staged for collection."
          },
          "pickup_notified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the ready-for-pickup notification email was sent to the customer (#1174). Null until a notification is sent; clearing the ready state does not reset it."
          },
          "marketplace_pickup_ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the order's marketplace (Shopify or TCGplayer) learned the order is ready for pickup, either because HippoLink told it or because the store marked it there; the marketplace then notifies the customer itself (#3385, #4847). Never reset: clearing and re-marking the order in HippoLink does not tell the marketplace again. Null for every other marketplace."
          },
          "marketplace_pickup_sync_error": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "marketplace_not_connected",
              "credentials_unreadable",
              "shopify_fulfillment_scope_missing",
              "shopify_not_pickup_order",
              "shopify_no_open_fulfillment_orders",
              "shopify_order_not_found",
              "shopify_pickup_rejected",
              "shopify_unavailable",
              "tcgplayer_pickup_rejected",
              "tcgplayer_unavailable",
              "tcgplayer_account_mismatch",
              null
            ],
            "description": "Why HippoLink could not tell the marketplace the order is ready for pickup, from the last attempt; null once it succeeds or the ready mark is cleared. `shopify_fulfillment_scope_missing`: the store's Shopify app lacks the fulfillment-order permissions, which the merchant adds in the Shopify Dev Dashboard. `shopify_not_pickup_order`: Shopify does not have the order as a local pickup. `shopify_no_open_fulfillment_orders`: nothing on the order is left to prepare (already picked up or cancelled in Shopify). `shopify_order_not_found`: Shopify no longer has the order. `tcgplayer_pickup_rejected`: TCGplayer refused the Ready for Pickup status (the order is canceled there, or it gave another reason). `tcgplayer_account_mismatch`: the connected TCGplayer account is not the one this store is bound to; reconnect the right one. `shopify_unavailable` and `tcgplayer_unavailable` are retried automatically."
          },
          "kiosk_flagged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the daily kiosk stale-order sweep flagged this order for review (kiosk pickup order, unclaimed past the store's configured stale_flag_hours). Null for a non-kiosk order, a store with no stale-flag window configured, or an order the sweep has not (yet, or no longer) flagged. Cleared by a genuine cancel or by kiosk_flag_snooze."
          },
          "kiosk_flag_snoozed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set by kiosk_flag_snooze to defer a flag the store has already looked at; the sweep re-flags the order one stale-flag window after this timestamp. Null unless the order's flag was snoozed."
          },
          "is_ready_for_pickup": {
            "type": "boolean",
            "default": false,
            "description": "True when the order is marked ready for pickup and its status is not terminal (shipped, canceled, refunded). Evaluated at read time."
          },
          "consolidation_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "awaiting_parts",
              "ready_to_consolidate",
              null
            ],
            "description": "Location picking: a split order's progress toward one package. `awaiting_parts` while a transfer is in transit or another location still holds part of what is left; `ready_to_consolidate` once every part waits at its ship location (the consolidation queue). Null for an order that was never split, and cleared when it ships (on a consolidation run, when that run is marked shipped) or is cancelled."
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Location picking: the numbered staging slot at its ship location where this split order's parts wait until it ships. Null when nothing of it is staged. On a cancelled order, held until `releaseStagingSlot` frees it (#4276)."
          },
          "ship_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Location picking: where this split order is packed and shipped -- its recorded end location, else where its transfers go. Null until it is first routed, and on an order never split."
          },
          "ship_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "fee_exempt": {
            "type": "boolean",
            "default": false,
            "description": "True when a administrator has marked this order \"HippoLink-free\": the daily billing rollup charges no HippoLink revenue-share fee on it. Set via PATCH /v1/admin/orders/{order_uuid}/fee-exemption."
          },
          "fee_exempt_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional note explaining why the order was comped. Null unless set."
          },
          "fee_exempted_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "UUID of the admin who last changed the exemption. Null if never set."
          },
          "fee_exempted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the exemption was last changed. Null if never set."
          },
          "marketplace_cancellation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketplaceCancellation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Present on the response to a cancel (status -> canceled) when the order's marketplace has no cancel API yet (e.g. TCGplayer): the order is canceled in HippoLink and inventory restored, but the seller must still cancel it on the marketplace itself. Absent otherwise (never set on Square, which is canceled via API, or on Mana Pool, whose cancel reports the order's cards to Mana Pool)."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "description": "Present on the response to a cancel on a marketplace HippoLink cannot cancel on (TCGplayer, Shopify and the like): one `marketplace_update_manual` warning naming the marketplace. The order is canceled in HippoLink and its `marketplace_sync_status` is `manual`. Present on a ship made with `override_tracking_required` that TCGplayer will refuse: `tcgplayer_tracking_required_override` on a TCGplayer order of $50 or more or on an Expedited tier, shipped with no tracking. The order is shipped here; add tracking, or mark it shipped on TCGplayer. Absent otherwise."
          },
          "manapool_unreported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present on the response to a Mana Pool cancel when some cards could not be sent to Mana Pool (no Mana Pool product id, or a product on more than one line): the cards' names. Ask Mana Pool support to refund them. Absent otherwise."
          }
        }
      },
      "SnapcasterChangeRequest": {
        "description": "The change request on a Snapcaster order, as last known: a seller's fulfillment report filed here or on Snapcaster, or a buyer's request to cancel cards or correct the address, updated from Snapcaster's notices. Snapcaster allows one pending request per order, so this is the latest one. It never moves stock itself: a buyer's `cancel_lines` request is honored by cancelling those lines (`cancelOrderItems`, or on Snapcaster), and the stock moves with that cancel.\n",
        "type": "object",
        "required": [
          "request_id",
          "kind",
          "initiator",
          "status",
          "lines",
          "created_at"
        ],
        "properties": {
          "request_id": {
            "type": "integer",
            "description": "Snapcaster's id, the `request_id` of the withdraw route."
          },
          "kind": {
            "type": "string",
            "description": "`fulfillment_report` (the seller's report of cards they can't send), `cancel_lines` (the buyer asks to cancel those lines) or `address_change` (the buyer asks to correct the ship-to address; `lines` is empty).\n"
          },
          "initiator": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "buyer",
              "seller",
              "operator",
              "system",
              null
            ],
            "description": "Who raised it (Snapcaster's `proposed_by_party`). Only the seller's own report can be withdrawn here."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "removed_instead",
              "order_cancelled",
              "declined",
              "withdrawn",
              "voided",
              "expired"
            ],
            "description": "`pending` waits for the other party. `accepted` ran as requested (a substitution swaps the stock), `removed_instead` and `order_cancelled` are the buyer's other answers (the cards come off, or the order is cancelled), `declined`, `withdrawn`, `voided` (the order shipped, was cancelled, or the conversation closed) and `expired` changed nothing.\n"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "line_ref",
                "quantity",
                "action",
                "substitute_sku_id",
                "credit_cents"
              ],
              "properties": {
                "line_ref": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "action": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "`remove`, `substitute`, or `split` (the buyer took part of it each way, see `dispositions`)."
                },
                "substitute_sku_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "credit_cents": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Per-unit credit on a substituted line."
                },
                "dispositions": {
                  "type": "array",
                  "description": "Only on a `split` line.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "quantity": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "substitute_sku_id": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "credit_cents": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SnapcasterChangeRequestResult": {
        "type": "object",
        "required": [
          "change_request",
          "order"
        ],
        "properties": {
          "change_request": {
            "$ref": "#/components/schemas/SnapcasterChangeRequest"
          },
          "order": {
            "$ref": "#/components/schemas/OrderDetail"
          }
        }
      },
      "ShelfShortfallVariant": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "label"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "label": {
            "type": "string"
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OrderShelfShortfall": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ShelfShortfallVariant"
          },
          {
            "type": "object",
            "required": [
              "order_item_uuid",
              "tcgplayer_product_id",
              "quantity",
              "pulled_quantity",
              "shortfall",
              "siblings"
            ],
            "properties": {
              "order_item_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "tcgplayer_product_id": {
                "type": "integer",
                "format": "int64"
              },
              "quantity": {
                "type": "integer"
              },
              "pulled_quantity": {
                "type": "integer",
                "description": "Copies taken off the shelf for this line so far, net of reversals."
              },
              "shortfall": {
                "type": "integer",
                "description": "Copies of this line never taken off the shelf."
              },
              "siblings": {
                "type": "array",
                "description": "Other variants of the card the store has on hand.",
                "items": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShelfShortfallVariant"
                    },
                    {
                      "type": "object",
                      "required": [
                        "total_quantity",
                        "quantity_visible"
                      ],
                      "properties": {
                        "total_quantity": {
                          "type": "integer"
                        },
                        "quantity_visible": {
                          "type": "integer"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        ]
      },
      "OrderShelfShortfalls": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderShelfShortfall"
            }
          }
        }
      },
      "SnapcasterSubstituteCandidate": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "available",
          "unit_price_cents",
          "store_quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "description": "Send as `substitute_sku_id`."
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "available": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units Snapcaster says are available now. Provisional."
          },
          "unit_price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The listing's price per unit. The buyer pays the line's own price less your credit."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "store_quantity": {
            "type": "integer",
            "description": "Copies of this SKU HippoLink counts on the store's shelves."
          }
        }
      },
      "CardTraderCancellation": {
        "description": "A direct CardTrader order's cancellation state. CardTrader has no refund API: a refund or cancel from HippoLink sends CardTrader's cancellation request (or accepts the buyer's), and CardTrader refunds the buyer once it is accepted.\n",
        "type": "object",
        "required": [
          "state",
          "requested_by",
          "cancelable"
        ],
        "properties": {
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "CardTrader's order state (paid, sent, arrived, done, request_for_cancel, canceled, lost), or null when no webhook has reported one."
          },
          "requested_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "buyer",
              "seller",
              null
            ],
            "description": "Who asked to cancel, while `state` is request_for_cancel. `buyer` means the seller can accept from HippoLink by refunding or canceling the order. Null otherwise."
          },
          "cancelable": {
            "type": "boolean",
            "description": "Whether HippoLink can send a cancellation now: the order is paid, sent or request_for_cancel on CardTrader. When false a refund is refused with 409 `cardtrader_order_not_cancelable`, and a cancel still cancels in HippoLink but returns `marketplace_cancellation` (cancel it on CardTrader by hand)."
          }
        }
      },
      "OrderAddressVerification": {
        "description": "Snapcaster's address-verification verdict for an order. `pending` is no verdict yet; `verified` and `verified_unit` are deliverable; `missing_unit`, `unit_unconfirmed` and `not_found` need a look (correct the address, or ship as is); `failed` means the check itself could not run and says nothing about the address.\n",
        "type": "object",
        "required": [
          "status",
          "suggested_address"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "verified_unit",
              "missing_unit",
              "unit_unconfirmed",
              "not_found",
              "failed"
            ]
          },
          "suggested_address": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderSuggestedAddress"
              },
              {
                "type": "null"
              }
            ],
            "description": "The standardized address Snapcaster suggests, set only when it differs from what the buyer entered. Advisory: the address the order prints from is `shipping_address`."
          }
        }
      },
      "OrderSuggestedAddress": {
        "description": "A suggested address in HippoLink's address shape (Snapcaster's `province` and `postal_code` are `state` and `zip_code`).",
        "type": "object",
        "required": [
          "line1",
          "line2",
          "city",
          "state",
          "zip_code",
          "country"
        ],
        "properties": {
          "line1": {
            "type": [
              "string",
              "null"
            ]
          },
          "line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "zip_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OrderAddressCorrectionRequest": {
        "type": "object",
        "required": [
          "line1",
          "city",
          "state",
          "zip_code",
          "country"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "The recipient name. Omit to keep the name the order prints today."
          },
          "line1": {
            "type": "string",
            "maxLength": 200
          },
          "line2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "city": {
            "type": "string",
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "maxLength": 100,
            "description": "The province (Snapcaster's `province`). It can't differ from the order's current one."
          },
          "zip_code": {
            "type": "string",
            "maxLength": 20,
            "description": "The postal code (Snapcaster's `postal_code`)."
          },
          "country": {
            "type": "string",
            "maxLength": 100,
            "description": "It can't differ from the order's current one."
          }
        }
      },
      "SnapcasterCancellationRequest": {
        "description": "A Snapcaster buyer's request to cancel an order, or some of its lines, before it ships. Snapcaster allows one pending request per order at a time; this is the latest. It moves no stock.\n",
        "type": "object",
        "required": [
          "request_id",
          "status",
          "reason",
          "note",
          "requested_at",
          "resolved_at",
          "lines"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Snapcaster's id for the request (`cnr_...`), the `request_id` of `declineCancellationRequest`."
          },
          "status": {
            "type": "string",
            "description": "`open` (waiting for the seller), `accepted` (a cancellation covered it), `declined` (the seller refused it) or `withdrawn` (the buyer took it back). A status Snapcaster adds later is passed through as sent and is not `open`."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The buyer's own words, null when they gave none."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason the seller gave when declining, null until it is declined."
          },
          "requested_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was accepted, declined or withdrawn; null while `open`."
          },
          "lines": {
            "type": [
              "array",
              "null"
            ],
            "description": "The lines the buyer asked to cancel, or null when they asked to cancel the whole order.",
            "items": {
              "type": "object",
              "required": [
                "line_ref",
                "sku_id",
                "quantity"
              ],
              "properties": {
                "line_ref": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Snapcaster's reference for the line (`order_items.marketplace_line_id`)."
                },
                "sku_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "quantity": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Units asked for; null means the whole line."
                }
              }
            }
          }
        }
      },
      "MarketplaceCancellation": {
        "description": "Hint returned when an order is canceled in HippoLink but its marketplace cannot be canceled programmatically. The seller must cancel it on the marketplace's own site, using order_url.\n",
        "type": "object",
        "required": [
          "manual_action_required",
          "marketplace"
        ],
        "properties": {
          "manual_action_required": {
            "type": "boolean",
            "description": "Always true — the seller must cancel this order on the marketplace directly."
          },
          "marketplace": {
            "$ref": "#/components/schemas/Marketplace"
          },
          "order_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Direct link to the order on the marketplace (e.g. https://manapool.com/settings/orders/{id}). Null if no URL was stored."
          }
        }
      },
      "OrderFraudRisk": {
        "description": "A marketplace's fraud-risk assessment of an order. Shopify only today: it scores an online-store order asynchronously after checkout and can re-score it until the order is fulfilled, so this is recorded when the score arrives rather than at ingest, and a newer assessment replaces an older one.\n",
        "type": "object",
        "required": [
          "level",
          "assessments",
          "source",
          "assessed_at"
        ],
        "properties": {
          "level": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "HIGH",
              "MEDIUM",
              "LOW",
              "PENDING",
              "NONE",
              null
            ],
            "description": "The worst level across `assessments`, which is what a seller acts on. `PENDING` means the marketplace is still scoring and `NONE` that it declined to; neither is actionable. Null when only a recommendation was reported."
          },
          "recommendation": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "CANCEL",
              "INVESTIGATE",
              "ACCEPT",
              "NONE",
              null
            ],
            "description": "The marketplace's recommended action. Null when unknown — notably when the record came from the risk webhook alone, whose payload carries levels and facts but no recommendation."
          },
          "assessments": {
            "type": "array",
            "description": "One entry per scoring provider, in the order reported.",
            "items": {
              "type": "object",
              "required": [
                "level",
                "provider",
                "facts"
              ],
              "properties": {
                "level": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "HIGH",
                    "MEDIUM",
                    "LOW",
                    "PENDING",
                    "NONE",
                    null
                  ]
                },
                "provider": {
                  "type": "string",
                  "description": "Who scored it. \"Shopify\" for Shopify's own assessment, which the API reports with a null provider; otherwise the third-party app's name."
                },
                "facts": {
                  "type": "array",
                  "description": "What the provider based the level on, as it worded it.",
                  "items": {
                    "type": "object",
                    "required": [
                      "description",
                      "sentiment"
                    ],
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "sentiment": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "NEGATIVE",
                          "NEUTRAL",
                          "POSITIVE",
                          null
                        ],
                        "description": "Whether the fact counts against the order, for it, or neither."
                      }
                    }
                  }
                }
              }
            }
          },
          "source": {
            "type": "string",
            "enum": [
              "graphql",
              "webhook"
            ],
            "description": "Where the record was read from. `graphql` is the authoritative order-risk query; `webhook` is the degraded fallback used when that query could not be made, and never carries a recommendation."
          },
          "assessed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When HippoLink recorded this assessment."
          }
        }
      },
      "OrderLineItem": {
        "type": "object",
        "required": [
          "order_item_uuid",
          "quantity",
          "unit_price",
          "line_total",
          "catalog_matched",
          "billable",
          "taken_back_quantity",
          "remaining_quantity",
          "canceled_quantity",
          "missing_quantity"
        ],
        "properties": {
          "order_item_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The order_items row this line represents. Stable per line — the identifier used to address this line for a administrator-only per-line action."
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "TCGPlayer SKU ID — references the matched inventory variant. Null for a non-HL line item (billable false — see billable/item_name)."
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product. Null for a non-HL line item, same as tcgplayer_sku_id."
          },
          "item_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace-provided display name for a non-HL line item (e.g. a Square \"food\"/custom-amount button, a Shopify non-HL-SKU product) — there is no catalog match to source a name from. Null on every HL-matched line, whose name is product_name instead."
          },
          "item_variation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace-provided variation/detail text for a non-HL line item (e.g. Square's variation name). Null on every HL-matched line."
          },
          "billable": {
            "type": "boolean",
            "description": "False for a non-HL line item — displayed here with whatever detail the marketplace gave (item_name/item_variation), but excluded from billing, COGS, inventory, picking, and pull alerts. See the order's non_hl_subtotal for the display-only total of these lines."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when catalog_matched is false, or when billable is false."
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (Magic only), when it has one."
          },
          "condition": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardCondition"
              },
              {
                "type": "null"
              }
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card set or edition name"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card language"
          },
          "finish": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "finish_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display-only finish label, refined to the specific foil treatment (e.g. Surge Foil) when the printing's promo types name one. Derived from `finish`, so it is non-null (as a generic Foil/Non-Foil) wherever `finish` is — including a line that resolved a SKU but no catalog product, where product_number and variant_label are both null. Do not read it as a catalog-match signal; `catalog_matched` is that. `finish` stays the machine value — match and sort on that, render this."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number of the exact printing this line resolved to. Pins the printing when name, set, condition, language and finish do not: a showcase card and its normal-frame sibling share all of those. Null on a line with no catalog match."
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display-only treatment of the printing — Art Card, Reversible, Double-Faced, Borderless, Showcase, Extended Art, Retro Frame, Full Art, Textless -- with a hand-kept detail the catalog cannot record appended after a comma (\"Reversible, Signature\"). Null when the printing has no named treatment, and on every non-Magic line (only the Magic catalog carries these attributes)."
          },
          "quantity": {
            "type": "integer"
          },
          "unit_price": {
            "type": "number",
            "format": "double",
            "description": "Price per unit in the parent order's `currency`"
          },
          "line_total": {
            "type": "number",
            "format": "double",
            "description": "quantity * unit_price in the parent order's `currency`"
          },
          "line_cogs": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "FIFO cost of goods for this line. Null if lot data was insufficient."
          },
          "cogs_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "costed",
              "partial",
              "uncosted",
              "pending",
              null
            ],
            "description": "costed = fully allocated from lots; partial = insufficient lots, some cost captured; uncosted = no lots found; pending = a copy came from a cost batch that is not finished yet, so line_cogs is null and the order's cogs_total / gross_profit are null until the finish (\"Cost pending (batch not finished)\")."
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "URI for the card's product image, or null if unavailable"
          },
          "cardchaos_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "queued",
              "on_picklist",
              "executed",
              "recalled",
              null
            ],
            "description": "This line's state in CardChaos's pick queue; null if it was never queued."
          },
          "taken_back_quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies of this line on `sent` marketplace reports (a Mana Pool report or a Square card refund), at most `quantity`. They stay in `quantity` but are not billed or counted as sales."
          },
          "remaining_quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "`quantity` less `taken_back_quantity`: the copies a new report or card refund may still take."
          },
          "canceled_quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies a Kiosk customer declined (`canceled_items`). Already removed from `quantity`; shown for reference."
          },
          "missing_quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies a picker marked missing on the line's latest non-cancelled pick run that nobody has found since; 0 otherwise. A later run that found the card yields 0, and a short find (fewer copies than the stop asked for) leaves no mark. Lets the refund dialog pre-select \"They're missing\"."
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The line's catalog release date (Magic per-product date, else the set date). Null when unknown."
          },
          "catalog_matched": {
            "type": "boolean",
            "description": "False when tcgplayer_sku_id has no matching catalog entry (e.g. not yet aggregated) — product_name/condition/set_name/language/finish/image_uri are null in that case, but quantity/unit_price/line_total/cogs are still accurate against what the buyer paid."
          }
        }
      },
      "OrderMarketplace": {
        "type": "string",
        "description": "`Marketplace` plus `KIOSK` -- the in-store pickup, pay-in-store storefront (#2015), which is an order source but never a marketplace listing/sync target. Used only where an order's own marketplace is read or filtered (`OrderSummary`/`OrderDetail`, the orders list/count marketplace filter); every listing-sync surface (repricing rule vocabulary, suppress-listing, marketplace resync/connection) stays on the narrower `Marketplace`, since a kiosk order has nothing to list or suppress on a marketplace.",
        "enum": [
          "CARD_NEXUS",
          "CARD_TRADER",
          "CARD_TRADER_ZERO",
          "CARDMARKET",
          "EBAY",
          "LIGHTSPEED",
          "MANA_POOL",
          "MISPRINT",
          "SHOPIFY",
          "SICK_DEALS",
          "SNAPCASTER",
          "SQUARE",
          "TCGPLAYER",
          "TCGPLAYER_DIRECT",
          "WHATNOT",
          "KIOSK"
        ]
      },
      "OrderStatus": {
        "type": "string",
        "description": "Order lifecycle status.\n\n`direct` (TCGplayer Direct) and `cardtrader_zero` (CardTrader Zero) are the *held* hub-program states. Both are entered only at creation and are non-terminal: the sale comes out of the seller's own stock and reserves inventory like any other, but the cards ship as a consolidated batch to the program's hub rather than being picked for an individual buyer, so the order stays out of the fulfillment run until that batch is fulfilled — at which point it becomes `shipped`, or `canceled` if the marketplace cancels it. Neither is ever reached from another status.\n\n`label_purchased` (UI label \"Label purchased\", #4823) sits between `processing` and `shipped`: a label was bought for an order whose fulfillment run is at Package Sort, and the marketplace has not been told it shipped yet. It becomes `shipped` when the run's Mark all as shipped (`shipFulfillmentRun`) sends that notification, or when the order is marked shipped by hand (`updateOrder` / `bulkUpdateOrderStatus` with `status: shipped`, which notifies the marketplace then). Voiding its label sends it back to `processing`. A label bought for an order on no such run goes straight to `shipped`. Only a label purchase enters it.\n\nA `label_purchased` order can be canceled (`updateOrder` / `bulkUpdateOrderStatus` with `status: canceled`, or the marketplace canceling it). A staff cancel voids the label with the carrier first and then cancels the order as a `processing` one: its cards go back on the shelf, it leaves its run, and Mark all as shipped no longer notifies anyone about it. If the carrier refuses the void or can't be asked, the label is discarded in HippoLink with the postage forfeited and the `ORDERS_CANCELED_LABEL_NOT_VOIDED` alert asks the store to void it with the carrier. A marketplace's cancel always discards the label that way. A parcel the carrier has already scanned can't be canceled here (409 `shipment_already_shipped`); in a bulk request that order is a `failed` entry, as is one the request ran out of time to void (`label_void_not_attempted`).",
        "enum": [
          "unfulfilled",
          "processing",
          "label_purchased",
          "shipped",
          "canceled",
          "refunded",
          "direct",
          "cardtrader_zero"
        ]
      },
      "OrderStatusEvent": {
        "description": "A single entry on an order's activity timeline. Either a status transition (event_type=status_change, status set) or a non-status field edit such as notes or tracking (event_type=field_edit, status null and the change described in detail).",
        "type": "object",
        "required": [
          "event_type",
          "occurred_at",
          "source"
        ],
        "properties": {
          "event_type": {
            "type": "string",
            "enum": [
              "status_change",
              "field_edit"
            ],
            "description": "Whether this entry is a status transition or a non-status field edit"
          },
          "status": {
            "description": "Target status for status_change entries; null for field edits.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrderStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "enum": [
              "marketplace",
              "user",
              "system"
            ],
            "description": "Who or what triggered the event"
          },
          "actor_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Supabase UUID of the user who made the change; null for marketplace and system events"
          },
          "actor_display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full name of the user who made the change (falls back to their email). Null for marketplace and system events, or when the user record is not found."
          },
          "detail": {
            "type": "string",
            "description": "For field edits, what changed (e.g. \"edited the notes\"); optional extra context on status changes"
          }
        }
      },
      "OrderSummary": {
        "description": "Abbreviated order view used in list responses.",
        "type": "object",
        "required": [
          "order_uuid",
          "marketplace",
          "marketplace_order_id",
          "status",
          "first_name",
          "last_name",
          "shipping_address",
          "item_count",
          "order_total",
          "currency",
          "ordered_at",
          "updated_at"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "$ref": "#/components/schemas/OrderMarketplace"
          },
          "marketplace_order_id": {
            "type": "string"
          },
          "marketplace_order_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Direct link to the order on the marketplace, null when the marketplace has none"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency",
            "description": "ISO currency of the order, and of every amount on it (and on its line items). Fixed when the order is ingested."
          },
          "fulfillment_method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "ship",
              "pickup",
              "in_store",
              null
            ],
            "description": "Buyer's fulfillment method, normalized at ingest (Shopify local-pickup and Square PICKUP map to pickup; a Square register sale with no delivery-method fulfillment, or an explicit Square IN_STORE fulfillment, maps to in_store; other marketplaces default to ship). Null means unknown (orders ingested before capture existed). Manually overridable via updateOrder."
          },
          "shipping_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tracked",
              "untracked",
              null
            ],
            "description": "How a shipped order physically left the building. `tracked` — a carrier label that came back with a tracking number, or a tracking number the seller entered by hand. `untracked` — a stamp tier (PWE 1oz/2oz, large letter), a carrier service that cannot be tracked (Pitney Bowes First-Class Mail), or an explicit \"shipped, no tracking\". Null when the order has not shipped, when it was handed over rather than mailed (fulfillment_method pickup or in_store), or on a historical row predating the field."
          },
          "expected_shipping_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "letter",
              "flat",
              "tracked",
              null
            ],
            "description": "How an open order is expected to ship, predicted before it does (#3585). `tracked` when the marketplace requires tracking (TCGplayer at $50 or more, or Expedited; a Mana Pool tier other than first_class), when a matching shipping rule asks for a signature or insurance, or when the first matching shipping rule with a package sets `package` (or a legacy bubble-mailer tier). `letter` or `flat` when that rule sets one (or a legacy stamp tier). With no such rule, `letter` (a 1 oz PWE). Recomputed when the order's lines or the store's shipping rules change, and daily. Null for a pickup or in-store order, an order that is no longer open, or one not computed yet."
          },
          "expected_shipping_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sentence behind `expected_shipping_class`, for the order page and the packing slip, e.g. \"TCGPLAYER requires tracking on orders of $50.00 or more\", \"TCGPLAYER requires a signature on orders of $250.00 or more\" or \"Shipping rule Bulk: letter\". Null exactly when `expected_shipping_class` is."
          },
          "expected_signature": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "signature",
              "adult_signature",
              null
            ],
            "description": "The signature confirmation the predicted label will carry (#3688): `signature` when the marketplace requires one (TCGplayer at $250 or more), or the level a matching shipping rule's `signature_confirmation` asks for (a rule's level wins, as in the rate shop). Set only with `expected_shipping_class` `tracked`; null when no signature is expected, and whenever `expected_shipping_class` is null. The reason then names the signature rule."
          },
          "shipping_class_display": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "letter",
              "flat",
              "tracked",
              "untracked",
              null
            ],
            "description": "What a PWE / Tracked badge shows: once shipped, how it went out (`shipping_class`: `tracked` or `untracked`); before that, `expected_shipping_class`. Buying a label or a stamp on the order page is how a seller overrides the prediction."
          },
          "shipping_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace-reported shipping method (e.g. ManaPool's free-text shipping_method). Best-effort and nullable — most marketplaces don't report one."
          },
          "fraud_risk_level": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "HIGH",
              "MEDIUM",
              "LOW",
              "PENDING",
              "NONE",
              null
            ],
            "description": "Headline Shopify fraud-risk level, so a list row can be badged without a detail fetch. The worst level across the order's assessments. Null for every non-Shopify order and for a Shopify order Shopify has not scored. Full detail is `fraud_risk` on `OrderDetail`."
          },
          "fraud_risk_recommendation": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "CANCEL",
              "INVESTIGATE",
              "ACCEPT",
              "NONE",
              null
            ],
            "description": "Shopify's recommended action for the order. Null when unknown — in particular when the level was recorded from the risk webhook alone, which does not carry a recommendation."
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order's tracking number, from a carrier label or entered by hand for a parcel shipped outside HippoLink. The list carries it so a shipped row can show what it went out under without a detail fetch. Null when none was ever recorded."
          },
          "tracking_company": {
            "type": [
              "string",
              "null"
            ],
            "description": "Carrier for `tracking_number`, free text as the seller typed it (e.g. \"USPS\"). Null when unknown or when there is no tracking number."
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/Address"
          },
          "item_count": {
            "type": "integer"
          },
          "order_total": {
            "type": "number",
            "format": "double",
            "description": "Total order amount in the order's `currency`"
          },
          "cogs_total": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Sum of line_cogs across all lines, as on `OrderDetail`. Null if no lines were costed, or while any billable line's cogs_status is `pending`."
          },
          "gross_profit": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "order_total minus cogs_total, as on `OrderDetail`. Null if cogs_total is null."
          },
          "ordered_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "notes_preview": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short excerpt of the order's internal notes (first 140 characters, trailing ellipsis when truncated). Null or absent when the order has no notes. Used to surface a notes indicator in the orders list."
          },
          "hold_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Presale hold date: the max catalog release date across the order's lines. Null when no line has a known release date."
          },
          "is_held": {
            "type": "boolean",
            "default": false,
            "description": "True when hold_until is in the future (evaluated at read time). A held order cannot be marked shipped unless the hold is overridden (see hold_overridden)."
          },
          "hold_overridden": {
            "type": "boolean",
            "default": false,
            "description": "True when a store user overrode the presale hold via POST .../hold-override (#1157), letting the order be marked shipped before hold_until."
          },
          "ready_for_pickup_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the order was marked ready for customer pickup. Null while the order is not staged for collection."
          },
          "pickup_notified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the ready-for-pickup notification email was sent to the customer (#1174). Null until a notification is sent; clearing the ready state does not reset it."
          },
          "kiosk_flagged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the daily kiosk stale-order sweep flagged this order for review (kiosk pickup order, unclaimed past the store's configured stale_flag_hours). Null for a non-kiosk order, a store with no stale-flag window configured, or an order the sweep has not (yet, or no longer) flagged. Cleared by a genuine cancel or by kiosk_flag_snooze."
          },
          "kiosk_flag_snoozed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Set by kiosk_flag_snooze to defer a flag the store has already looked at; the sweep re-flags the order one stale-flag window after this timestamp. Null unless the order's flag was snoozed."
          },
          "is_ready_for_pickup": {
            "type": "boolean",
            "default": false,
            "description": "True when the order is marked ready for pickup and its status is not terminal (shipped, canceled, refunded). Evaluated at read time."
          },
          "consolidation_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "awaiting_parts",
              "ready_to_consolidate",
              null
            ],
            "description": "Location picking: a split order's progress toward one package. `awaiting_parts` while a transfer is in transit or another location still holds part of what is left; `ready_to_consolidate` once every part waits at its ship location (the consolidation queue). Null for an order that was never split, and cleared when it ships (on a consolidation run, when that run is marked shipped) or is cancelled."
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Location picking: the numbered staging slot at its ship location where this split order's parts wait until it ships. Null when nothing of it is staged. On a cancelled order, held until `releaseStagingSlot` frees it (#4276)."
          },
          "games": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Distinct games (per GAMES) across the order's billable lines, so the FE can show why an order matched a product-parameter filter without fetching full line data."
          },
          "has_sealed": {
            "type": "boolean",
            "default": false,
            "description": "True when at least one billable line's product is tagged other_attributes.product_type == \"sealed\"."
          },
          "is_problematic": {
            "type": "boolean",
            "default": false,
            "description": "True if oversell detection or operator flagging marked this order problematic. Same field as Order.is_problematic, carried on the list row so the orders table can flag one without a per-row detail fetch."
          },
          "cardchaos": {
            "description": "Null unless the order was ever queued in CardChaos.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CardChaosOrderState"
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "alternate_copy_fulfilled",
              "partially_fulfilled",
              "unable_to_fulfill",
              "flagged_in_error",
              null
            ],
            "description": "How the problematic order was resolved; null while unresolved. Needed alongside is_problematic because the flag is never cleared -- resolving an order records a resolution and leaves is_problematic true -- so \"still needs attention\" is is_problematic AND resolution IS NULL. Same pair the ?problematic=true&resolved=false query composes."
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the resolution was recorded; null while unresolved. What ?resolved_after / ?resolved_before filter on."
          }
        }
      },
      "AvailableOrderItem": {
        "description": "One compact line of an available order, for inline display on the Pick Orders selector.\n",
        "type": "object",
        "required": [
          "product_name",
          "set_name",
          "condition",
          "finish",
          "quantity"
        ],
        "properties": {
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card name; null when the SKU is not in the catalog."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set name; null when the SKU is not in the catalog."
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          }
        }
      },
      "AvailableOrderSummary": {
        "description": "An OrderSummary plus its compact line items; returned only by listAvailableOrders. Note: games, has_sealed, cogs_total and gross_profit (inherited from OrderSummary) are never populated here -- kept off this endpoint's response to keep the fulfillment order-selector's query cheap, since it already runs its own compact per-order line-items query.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderSummary"
          },
          {
            "type": "object",
            "required": [
              "items",
              "group",
              "location_coverage",
              "end_location_uuid",
              "end_location_name"
            ],
            "properties": {
              "end_location_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "Location picking, with `root_location_uuid`: the location this order ends at (is packed), when that is not `root_location_uuid` -- a run here sends what it picks there. Null on an unscoped list, for an order that ends here, and for an order with no end location yet.\n"
              },
              "end_location_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "location_coverage": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "complete",
                  "partial",
                  null
                ],
                "description": "Location picking, with `root_location_uuid`: `complete` when exact copies free at that location cover every card the order still needs, `partial` when some of it is elsewhere or needs a substitute here. Null on an unscoped list and on held pre-pull orders.\n"
              },
              "group": {
                "type": "string",
                "enum": [
                  "orders",
                  "prepull_direct",
                  "prepull_ct_zero"
                ],
                "description": "Which run-builder group the order belongs to: `orders` for an ordinary order, `prepull_direct` / `prepull_ct_zero` for a held order of that holding program that still has cards to pre-pull. A run takes orders of one group only.\n"
              },
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AvailableOrderItem"
                }
              },
              "buyer_first_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Same value as `first_name`. Kept because this endpoint has always served it."
              },
              "buyer_last_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Same value as `last_name`. Kept because this endpoint has always served it."
              },
              "problematic_reason": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Machine or operator description of why the order was flagged. Not on the base OrderSummary -- only carried here so Pick Orders can surface why an is_problematic order can't be picked without a per-order detail fetch (Frontend#1172)."
              }
            }
          }
        ]
      },
      "OrderSyncRecentOrder": {
        "description": "An order the store received recently, as listed in the order-sync status.",
        "type": "object",
        "required": [
          "order_id",
          "source_platform",
          "marketplace_order_id",
          "status",
          "marketplace_sync_status",
          "received_at"
        ],
        "properties": {
          "order_id": {
            "type": "string",
            "format": "uuid"
          },
          "source_platform": {
            "$ref": "#/components/schemas/OrderMarketplace"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "marketplace_sync_status": {
            "type": "string",
            "enum": [
              "synced",
              "pending",
              "failed",
              "manual"
            ],
            "description": "`synced` means no push has failed, not that the marketplace was told. `manual` means the marketplace must be updated by hand (for example a canceled TCGplayer order) and the store has been told what to do."
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "OrderSyncStatus": {
        "description": "Order sync status for a store: the connection state of every marketplace, the 100 most recent orders, and how many of those arrived today.\n",
        "type": "object",
        "required": [
          "store",
          "recent_orders",
          "recent_syncs",
          "today_orders_detected",
          "visibility"
        ],
        "properties": {
          "store": {
            "$ref": "#/components/schemas/OrderSyncStoreState"
          },
          "recent_orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderSyncRecentOrder"
            }
          },
          "recent_syncs": {
            "type": "array",
            "description": "Always empty; sync attempt records are not kept in PostgreSQL yet.",
            "items": {
              "$ref": "#/components/schemas/SyncTaskSummary"
            }
          },
          "today_orders_detected": {
            "type": "integer",
            "description": "How many of `recent_orders` were received today (UTC)."
          },
          "visibility": {
            "description": "Always null; the health metrics have not been migrated to PostgreSQL yet.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderSyncVisibility"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "OrderSyncStoreState": {
        "description": "Current credential and webhook state for all platforms on a store.",
        "type": "object",
        "properties": {
          "store_id": {
            "type": "string",
            "format": "uuid"
          },
          "is_active": {
            "type": "integer",
            "description": "1 if any platform is active, 0 otherwise"
          },
          "tcg_active": {
            "type": "integer",
            "description": "1 if TCGPlayer platform is active"
          },
          "mp_active": {
            "type": "integer",
            "description": "1 if ManaPool platform is active"
          },
          "shopify_active": {
            "type": "integer",
            "description": "1 if Shopify platform is active"
          },
          "square_active": {
            "type": "integer",
            "description": "1 if Square platform is active"
          },
          "activated_at": {
            "type": "string",
            "format": "date-time"
          },
          "mp_webhook_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "mp_webhook_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "shopify_webhook_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "shopify_webhook_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "shopify_risk_webhook_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "GraphQL subscription ID for the `ORDERS_RISK_ASSESSMENT_CHANGED` topic (fraud warnings). Null when the store has no such subscription."
          },
          "shopify_shop_domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected Shopify store domain (e.g. my-store.myshopify.com). A non-secret identifier, returned in full so the Integrations UI can show which store is connected.\n"
          },
          "shopify_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected Shopify app's Client ID (the public \"API key\"). A non-secret identifier, returned in full. The Client Secret is never returned — see shopify_client_secret_present.\n"
          },
          "shopify_client_secret_present": {
            "type": "boolean",
            "description": "Whether a Shopify app Client Secret is stored for this store. The secret mints Admin API tokens and verifies webhook HMAC and is write-only, so the status surfaces only its presence, never the value (mirrors ct_shared_secret_present).\n"
          },
          "square_merchant_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Square merchant ID for the connected account"
          },
          "cardtrader_active": {
            "type": "integer",
            "description": "1 if CardTrader platform is active"
          },
          "cardmarket_active": {
            "type": "integer",
            "description": "1 if Cardmarket platform is active (#2494). Sys-admin-only preview."
          },
          "cardmarket_connected_via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "dedicated_app",
              "oauth",
              null
            ],
            "description": "How the active Cardmarket connection was made: `dedicated_app` (the seller's own Dedicated App keys, pasted through `PUT /credentials`) or `oauth` (HippoLink's app). Null when Cardmarket is not active or the connection predates this field."
          },
          "cardmarket_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Cardmarket username the pasted keys belong to, read from Cardmarket when they were checked; null when unknown."
          },
          "cardmarket_oauth_available": {
            "type": "boolean",
            "description": "Whether \"Connect Cardmarket\" (HippoLink's app, OAuth) is configured in this environment. False means only a Dedicated App's keys can connect."
          },
          "ebay_active": {
            "type": "integer",
            "description": "1 if eBay platform is active (#2600). Set by the OAuth connect flow (EBAY-04)."
          },
          "cardnexus_active": {
            "type": "integer",
            "description": "1 if CardNexus is connected and active (#3634)."
          },
          "cardnexus_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected CardNexus account id; null when CardNexus was never connected."
          },
          "cardnexus_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected seller's CardNexus username, when known."
          },
          "cardnexus_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "The CardNexus account's selling currency (ISO 4217), read at connect. Null when it could not be read; inventory push waits until it is known.\n"
          },
          "cardnexus_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Permissions HippoLink needs that the seller's CardNexus approval did not grant; reconnecting grants them. Null when CardNexus is not connected.\n"
          },
          "cardnexus_connect_available": {
            "type": "boolean",
            "description": "Whether Connect CardNexus is configured in this environment."
          },
          "snapcaster_connect_available": {
            "type": "boolean",
            "description": "Whether Connect Snapcaster is configured in this environment."
          },
          "misprint_active": {
            "type": "integer",
            "description": "1 if Misprint is connected and active (#3663)."
          },
          "misprint_seller_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected Misprint Seller ID; null when Misprint was never connected."
          },
          "whatnot_active": {
            "type": "integer",
            "description": "1 if Whatnot is connected and active (#4223)."
          },
          "whatnot_seller_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Whatnot seller the stored token acts for; null unless Whatnot is connected and active."
          },
          "whatnot_seller_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That seller's Whatnot username, when Whatnot reported one."
          },
          "whatnot_webhook_secret_set": {
            "type": "boolean",
            "description": "Whether a webhook signing secret is stored. False means orders arrive only through the poll, minutes rather than seconds later.\n"
          },
          "sick_deals_active": {
            "type": "integer",
            "description": "1 if Sick Deals is connected and active (#4399)."
          },
          "sick_deals_store_slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Sick Deals store the stored token acts for; null unless connected and active."
          },
          "sick_deals_store_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That store's name on Sick Deals."
          },
          "sick_deals_inventory_set": {
            "type": [
              "string",
              "null"
            ],
            "description": "The inventory set HippoLink keeps in sync; null unless connected and active."
          },
          "sick_deals_webhook_registered": {
            "type": "boolean",
            "description": "Whether HippoLink's order.paid webhook is registered on Sick Deals. False means orders arrive only through the poll, minutes later.\n"
          },
          "lightspeed_connect_available": {
            "type": "boolean",
            "description": "Whether Connect Lightspeed is configured in this environment for any product line."
          },
          "lightspeed_lines_available": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LightspeedLine"
            },
            "description": "The Lightspeed product lines a store can connect in this environment."
          },
          "lightspeed_active": {
            "type": "integer",
            "description": "1 if Lightspeed is connected and active (#4173)."
          },
          "lightspeed_line": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/LightspeedLine"
              },
              {
                "type": "null"
              }
            ],
            "description": "The connected account's product line; null when Lightspeed was never connected."
          },
          "lightspeed_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected Lightspeed account (X-Series: the domain prefix; R-Series: the account id); null when Lightspeed was never connected.\n"
          },
          "lightspeed_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Lightspeed account currency, read or assumed at connect."
          },
          "lightspeed_primary_location_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The location that gets the full sellable count; null until chosen."
          },
          "lightspeed_push_location_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The locations the push writes to; null until chosen."
          },
          "lightspeed_category_layout": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "nested",
              "flat",
              "off",
              null
            ],
            "description": "How HippoLink files its products into Lightspeed categories; null while not connected."
          },
          "lightspeed_category_parent_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Lightspeed category HippoLink's categories sit under; null for the top level."
          },
          "lightspeed_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Scopes HippoLink asks for that the grant lacks; null when not connected or unrecorded."
          },
          "snapcaster_active": {
            "type": "integer",
            "description": "1 if Snapcaster is connected and active (#3742)."
          },
          "snapcaster_seller_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected Snapcaster `sellerId` (as text); null while Snapcaster is not active."
          },
          "snapcaster_seller_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The connected seller's Snapcaster `sellerCode`; null while Snapcaster is not active."
          },
          "snapcaster_store_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The seller's store name on Snapcaster; null while Snapcaster is not active."
          },
          "snapcaster_connected_via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "connect",
              "api_key",
              null
            ],
            "description": "How the key was obtained: `connect` (Snapcaster's Connect flow) or `api_key` (a sandbox Test store's key pasted through `upsertOrderSyncCredentials`). Null while Snapcaster is not active, or for a connection saved before this was recorded.\n"
          },
          "snapcaster_browse_eligible": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether Snapcaster shows the seller's listings to buyers, from the last connect or connection test; null until Snapcaster has been read.\n"
          },
          "snapcaster_incomplete_prerequisites": {
            "type": [
              "array",
              "null"
            ],
            "description": "Setup steps Snapcaster still wants from the seller before their listings are browsable (empty when none). While any are open the store has a `SNAPCASTER_NOT_BROWSABLE` alert.\n",
            "items": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Snapcaster's prerequisite code, for example `PAYOUTS_READY`."
                },
                "message": {
                  "type": "string",
                  "description": "What the seller has to do, in Snapcaster's words."
                }
              }
            }
          },
          "snapcaster_counts": {
            "type": [
              "object",
              "null"
            ],
            "description": "Listing counts Snapcaster reported at the last connect or connection test.",
            "properties": {
              "total": {
                "type": "integer"
              },
              "matched": {
                "type": "integer"
              },
              "unmatched": {
                "type": "integer"
              },
              "browsable": {
                "type": "integer",
                "description": "Zero while the seller is suspended or on vacation."
              }
            }
          },
          "snapcaster_vacation": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the seller's listings are hidden by vacation mode on Snapcaster."
          },
          "manapool_auth": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "oauth",
              "api_key",
              null
            ],
            "description": "How the store's ManaPool connection authenticates (#3403): `oauth` for a connection made through ManaPool's consent screen, `api_key` for a pasted email + access token, null when ManaPool has no credential row."
          },
          "manapool_use_oauth": {
            "type": "boolean",
            "description": "The switch `manaPoolAuthMode` sets: true sends ManaPool calls with the OAuth connection, false with the pasted key. Both stay stored."
          },
          "manapool_oauth_connected": {
            "type": "boolean",
            "description": "Whether an OAuth connection is stored, whichever way the switch points."
          },
          "manapool_key_saved": {
            "type": "boolean",
            "description": "Whether a pasted email + access token is stored, whichever way the switch points."
          },
          "manapool_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ManaPool username of an OAuth connection. Null when no connection is stored, or when the lookup at connect failed."
          },
          "manapool_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "OAuth scopes HippoLink requests that this ManaPool connection was not granted, from what ManaPool confirmed at connect; reconnect to grant them. Null for an API-key connection or no connection."
          },
          "manapool_oauth_available": {
            "type": "boolean",
            "description": "Whether \"Connect ManaPool\" (OAuth) is configured in this environment. False means only the API-key form can connect."
          },
          "ebay_username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The linked eBay username. Non-secret identifier; null when eBay is not connected or the username has not been resolved yet."
          },
          "ebay_refresh_token_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the eBay refresh token (the connection) expires, ISO-8601. Null when eBay is not connected or no expiry is recorded. The token itself is never returned."
          },
          "ebay_setup": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EbaySetupState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the store finished eBay setup (#2752), from what HippoLink has stored (no eBay call); the same check the push makes before creating a listing. Null when eBay is not connected."
          },
          "ebay_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "eBay OAuth scopes HippoLink now requests at connect that this store's stored grant does not name (#3069). The stored list is what was requested, not what eBay confirmed, so a non-empty list means the store connected before a scope was added and must reconnect eBay to grant it. Null when eBay is not connected or the grant recorded no scope list."
          },
          "square_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Square OAuth scopes HippoLink now requests at connect that this store's grant lacks (#417). The list Square confirmed at the last connect is recorded; a grant with no recorded list predates ORDERS_WRITE and PAYMENTS_WRITE and reports those two. A non-empty list means the store must reconnect Square, which keeps its location and listings, before refunds and fulfillment updates work. Null when Square is not connected."
          },
          "shopify_scopes_missing": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Access scopes HippoLink needs that the store's own Shopify app does not hold, read from Shopify (`currentAppInstallation.accessScopes`) at connect, at webhook registration, on a connection test, and from this read at most every 15 minutes while something is missing. The merchant adds them under API access in the Shopify Dev Dashboard, releases the app and approves it in the Shopify admin; nothing is re-pasted. Empty when the grant is complete. Null when Shopify is not connected or the grant has not been read yet."
          },
          "ct_shared_secret_present": {
            "type": "boolean",
            "description": "Whether a CardTrader webhook shared secret is stored for this store. Used by the frontend to indicate webhook readiness."
          },
          "ct_webhook_verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When CardTrader delivered a correctly signed webhook to this store's URL, or null if none has arrived yet (also null while the connection is switched off). The webhook URL is pasted into CardTrader by hand, so null means there is no evidence yet that the store did so. It is not proof that orders are failing: a store that has simply had no CardTrader activity since connecting reads null too."
          },
          "mp_webhook_registered": {
            "type": "boolean",
            "description": "Whether a ManaPool order_created webhook is currently registered"
          },
          "shopify_webhook_registered": {
            "type": "boolean",
            "description": "Whether a Shopify orders/create webhook is currently registered"
          },
          "square_webhook_registered": {
            "type": "boolean",
            "description": "Whether this store will receive Square order webhooks. Square webhook subscriptions are app-level (one per environment, keyed by merchant_id), not per-store — so this is true once the store has a connected Square merchant account (square_merchant_id), which is what the app-level subscription routes inbound events by.\n"
          },
          "marketplace_connections": {
            "type": "array",
            "description": "Per-platform connection-health state (#934). One entry per connected platform whose credential health HippoLink tracks, in a stable order: the inventory marketplaces first, then the shipping carriers (#1674). A `connection_status` of `action_needed` means the credential has permanently failed auth/permission (e.g. a revoked CardTrader token or an EasyPost key that was regenerated) and the store must supply a new one. For an inventory marketplace, sync is skipped until it clears; for a carrier, rate-shopping and label purchase fail while picking and packing carry on. Lets the Integrations UI show an \"action needed\" state alongside the store_alerts banner.\n\n**Carriers were absent from this array before #1674** — a consumer that assumed it only ever contained inventory marketplaces needs to widen.",
            "items": {
              "$ref": "#/components/schemas/MarketplaceConnectionHealth"
            }
          }
        }
      },
      "MarketplaceConnectionHealth": {
        "description": "Connection-health state for one (store, marketplace) credential (#934). Distinct from the `*_active` on/off flags: a connection can be active yet dead. Never contains a credential value — only a machine reason code and a truncated human-readable detail.",
        "type": "object",
        "required": [
          "marketplace",
          "connection_status"
        ],
        "properties": {
          "marketplace": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "CARDMARKET",
              "EBAY",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER",
              "LIGHTSPEED",
              "WHATNOT",
              "SICK_DEALS",
              "EASYPOST",
              "SHIPSTATION",
              "PITNEYBOWES",
              "SHIPPO",
              "CLICKSHIP"
            ],
            "description": "The platform code, one of `schemas.connection_health.CONNECTION_HEALTH_PLATFORMS` (test_connection_health_enum_parity.py keeps them equal). Mostly inventory marketplaces; `EASYPOST` and `SHIPSTATION` are shipping carriers (#1674), which sync no inventory but whose API keys fail in exactly the same way and now run on the same connection-health machinery."
          },
          "connection_status": {
            "type": "string",
            "enum": [
              "healthy",
              "action_needed"
            ],
            "description": "`healthy` = working (or not yet proven otherwise); `action_needed` = auth/permission permanently failing, the store must reconnect."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short machine reason for the last failure (e.g. `cardtrader_export_forbidden`); null when healthy. A few reasons flag `action_needed` without stopping sync, among them `no_price_in_marketplace_currency` (#3735): some in-stock cards have no price in a currency the marketplace lists in (`listing_currency`), so they are not listed there while everything else keeps pushing; `error_detail` carries the count (\"41,200 SKUs have no CAD price for Snapcaster\"). The push sweep raises and clears it."
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Truncated human-readable detail of the last failure (e.g. the HTTP status + response snippet); never a credential value."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the connection was last checked (on a success or a failure)."
          },
          "flagged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the connection was first flagged action_needed; null when healthy."
          },
          "listing_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "live",
              "hidden",
              "partial",
              "unknown",
              null
            ],
            "description": "What the marketplace itself last reported about the store's listings (#2743), read hourly from its own store-wide switch, so it can disagree with HippoLink. `live` = buyers can see the listings; `hidden` = the switch is off (TCGplayer Inventory Status \"Hidden\"); `partial` = part of it is off (ManaPool: one of singles / sealed); `unknown` = the last read failed, and `listing_state_detail.error` says why. Never read as hidden when unknown. Null when this marketplace has no reader (TCGplayer and ManaPool have one) or has not been read yet. A `TCGPLAYER_LISTINGS_OFF` / `MANA_POOL_LISTINGS_OFF` store alert accompanies a state the store did not expect. On ManaPool that alert judges only the switches the store has stock behind, so a `partial` with no alert is normal for a singles-only store that keeps sealed off."
          },
          "listing_state_detail": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "The raw reading behind `listing_state`, e.g. `{\"inventory_status\": \"Hidden\"}` for TCGplayer, `{\"singles_live\": true, \"sealed_live\": false, \"has_singles_stock\": true, \"has_sealed_stock\": false}` for ManaPool, or `{\"error\": \"<kind>\"}` when the state is `unknown` (e.g. `dead_cookie`, `transport`, `connection_action_needed`). Never contains a credential value."
          },
          "listing_state_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When `listing_state` was last read, successful or not."
          },
          "currency_supported": {
            "type": "boolean",
            "description": "False only when nothing this store can price is in a currency the marketplace lists in, so the inventory push skips it (#3180, #3735): a multi-currency marketplace that does not list in the store's currency. True for a marketplace whose one listing currency is not the store's (it lists the cards priced in `listing_currency`), and when the currency is unknown."
          },
          "listing_currency": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "USD",
              "EUR",
              "CAD",
              "MXN",
              null
            ],
            "description": "The currency this marketplace lists the store's cards in, which the store's prices are converted to and a manual price may be pinned in (#3735, FX-5): CAD for a USD store's Snapcaster, USD for a CAD store's TCGplayer, the store's own currency for a marketplace that takes it, the account's recorded currency for CardNexus. Null when unknown or when nothing can list."
          }
        }
      },
      "OrderSyncVisibility": {
        "description": "Comprehensive health metrics, staleness indicators, anomalies, and per-platform health for a store's sync activity.\n",
        "type": "object",
        "required": [
          "overall_health",
          "platform_health",
          "counts",
          "staleness",
          "anomalies",
          "metrics"
        ],
        "properties": {
          "overall_health": {
            "$ref": "#/components/schemas/PlatformHealthStatus"
          },
          "platform_health": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PlatformHealthStatus"
            },
            "description": "Per-platform health keyed by platform name"
          },
          "latest_orders": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "external_order_id": {
                  "type": "string"
                },
                "detected_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "latest_syncs": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "last_attempt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "last_success": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                }
              }
            }
          },
          "latest_failure": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "sync_task_id": {
                "type": "string"
              },
              "error_code": {
                "type": "string"
              },
              "error_message": {
                "type": "string"
              },
              "completed_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "counts": {
            "type": "object",
            "properties": {
              "pending": {
                "type": "integer"
              },
              "dispatched": {
                "type": "integer"
              },
              "running": {
                "type": "integer"
              },
              "succeeded": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              },
              "failed_terminal": {
                "type": "integer"
              }
            }
          },
          "staleness": {
            "type": "object",
            "properties": {
              "last_order_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_sync_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_poll_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "anomalies": {
            "type": "object",
            "properties": {
              "stuck_items": {
                "type": "integer"
              },
              "retryable_items": {
                "type": "integer"
              }
            }
          },
          "metrics": {
            "type": "object",
            "description": "Rolling 24-hour window metrics",
            "properties": {
              "orders_24h": {
                "type": "integer"
              },
              "syncs_succeeded_24h": {
                "type": "integer"
              },
              "syncs_failed_24h": {
                "type": "integer"
              },
              "avg_sync_duration_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              }
            }
          }
        }
      },
      "TcgCookieStatusResult": {
        "description": "The JWT-route counterpart of `PluginCookieStatusResult` (Backend#1539) -- same underlying credential row, reached with this store's own JWT instead of a plugin bearer token. No `store_name`/`store_slug` (the JWT route already has `store_uuid`); adds `seller_key_bound` so the frontend can flag a store whose wrong-account guard isn't armed instead of showing a plain green `active`. Never contains the cookie, any part of it, a derivative of it, or the raw seller-account key.\n",
        "type": "object",
        "required": [
          "cookie_revision",
          "captured_at",
          "last_pushed_at",
          "last_validated_at",
          "pushed_by_device",
          "seller_key_bound",
          "status"
        ],
        "properties": {
          "cookie_revision": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null when no TCGplayer credential row exists yet for this store."
          },
          "captured_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The `captured_at` of the last accepted push."
          },
          "last_pushed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Server-side time of the last accepted push, stamped only inside the push-write path. Distinct from `captured_at`, which is the client-supplied capture time.\n"
          },
          "last_validated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a push was last confirmed live by TCGplayer's session probe."
          },
          "pushed_by_device": {
            "type": [
              "string",
              "null"
            ],
            "description": "The label of the plugin token that last pushed a cookie, if any."
          },
          "seller_key_bound": {
            "type": "boolean",
            "description": "Whether this store is bound to a TCGplayer seller account (`tcg_seller_key` is set). False for a legitimate non-Direct store that has never had one asserted, and also for a store whose only pushes so far carried no `LastSeller` -- in both cases the wrong-account guard is not armed for this store. Never the key value itself.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "invalid",
              "never_configured",
              "disconnected",
              "subscription_required"
            ],
            "description": "Same derivation and ordering as `PluginCookieStatusResult.status`. `active` + `seller_key_bound: false` together is the unbound-but- live case worth flagging distinctly from a plain green `active`.\n"
          }
        }
      },
      "RunValueByCurrency": {
        "type": "object",
        "required": [
          "currency",
          "total_value"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of these orders."
          },
          "total_value": {
            "type": "number",
            "description": "What the run's cards from these orders sold for, in `currency`."
          }
        }
      },
      "ActiveRun": {
        "type": "object",
        "required": [
          "run_uuid",
          "strategy",
          "status",
          "created_at",
          "updated_at",
          "order_count",
          "card_count",
          "picked_count",
          "total_value",
          "by_currency",
          "problematic_order_count",
          "is_pickup_run",
          "executor",
          "split",
          "pool_cards",
          "stretches",
          "name"
        ],
        "description": "Summary of an in-progress run (picking or unassigned) for the Active Runs board.",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run's name: `LABEL - YYMMDD - N` by default (renameFulfillmentRun changes it), a CardChaos run's picklist name, or null on a run created before run names existed.\n"
          },
          "split": {
            "type": "boolean",
            "description": "A Walk Path run shared by several pickers as stretches of whole boxes.\n"
          },
          "pool_cards": {
            "type": "integer",
            "description": "Open cards nobody holds yet (split runs; 0 otherwise)."
          },
          "stretches": {
            "type": "array",
            "description": "Active stretches only (split runs).",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunStretch"
            }
          },
          "executor": {
            "type": "string",
            "enum": [
              "hippolink",
              "cardchaos"
            ]
          },
          "cc_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "picker_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null when the run is unassigned."
          },
          "picker_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "picker_display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name of the picker (\"First Last\"), resolved at read time. Falls back to the email in `picker_email` when the name is blank; null when the run is unassigned (no picker).\n"
          },
          "strategy": {
            "type": "string",
            "enum": [
              "by_order",
              "by_game_set_alpha",
              "by_location"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "picking",
              "unassigned"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "released_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "order_count": {
            "type": "integer"
          },
          "card_count": {
            "type": "integer"
          },
          "picked_count": {
            "type": "integer",
            "description": "How many of the run's cards are already picked (for progress)."
          },
          "total_value": {
            "type": "number",
            "description": "Sum of the run's pick-item values with no regard to currency, so it means nothing on a run that mixes currencies. Show `by_currency` instead."
          },
          "by_currency": {
            "type": "array",
            "description": "The run's pick-item values, one entry per order currency, sorted by code. Nothing converts between them (#3700). Empty on an RI run, which has no order lines.",
            "items": {
              "$ref": "#/components/schemas/RunValueByCurrency"
            }
          },
          "problematic_order_count": {
            "type": "integer",
            "description": "How many of order_count are currently flagged Order.is_problematic -- e.g. an order with no catalog-matched lines, or one whose lines came up with no stock anywhere at allocation time. Neither case shows up in card_count, so a run can read as \"10 orders\" with a lower card total than expected and no other clue why; this is that clue at a glance. Per-order detail (which orders, and their reason) is on the run itself (FulfillmentRun.problematic_orders) once opened.\n"
          },
          "is_pickup_run": {
            "type": "boolean",
            "description": "True when every order on this run is collected in the shop rather than mailed (`fulfillment_method` \"pickup\" — every kiosk order, plus any marketplace order whose buyer chose in-store collection). Such a run has no Ship Review stage: `completeFulfillmentRun` already stamped each order ready for pickup and emailed the customer, and there is no label to buy — `purchaseShippingLabel` and `getShippingRates` refuse a kiosk order outright. Close the run out from Package Sort with `shipFulfillmentRun`, which releases the locks without shipping anything. `createFulfillmentRun` refuses a batch that mixes the two methods, so this is never partially true. Read over the run's orders (locks plus pick items), so it stays correct after the locks are released.\n"
          }
        }
      },
      "StoreStatus": {
        "type": "object",
        "required": [
          "fulfillment",
          "pull_alerts",
          "transfers",
          "split_orders",
          "recounts"
        ],
        "properties": {
          "fulfillment": {
            "type": "object",
            "required": [
              "orders_to_pick",
              "my_active_runs",
              "ready_to_pack"
            ],
            "properties": {
              "orders_to_pick": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Orders waiting to be picked (the Pick Orders list's total)."
              },
              "my_active_runs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Active runs that need the caller: runs they are picking, split runs where they hold an active stretch, and split runs with cards nobody has taken yet.\n"
              },
              "ready_to_pack": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Runs waiting in Pack & Ship."
              }
            }
          },
          "pull_alerts": {
            "type": "object",
            "required": [
              "pending"
            ],
            "properties": {
              "pending": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Pull alerts waiting to be pulled or dismissed."
              }
            }
          },
          "transfers": {
            "type": "object",
            "required": [
              "inbound_in_transit"
            ],
            "properties": {
              "inbound_in_transit": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Transfers on their way to this store and not yet received (the inbound Transfers list filtered to `in_transit`).\n"
              }
            }
          },
          "split_orders": {
            "type": "object",
            "required": [
              "transfers_in_transit",
              "ready_to_consolidate",
              "staging_returns"
            ],
            "properties": {
              "transfers_in_transit": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Order transfers on their way and not yet received (`listOrderTransfers`'s default `in_transit` view). Null when the caller cannot call that list.\n"
              },
              "ready_to_consolidate": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Orders waiting in the consolidation queue (`listConsolidationQueue`), by their stored state. Null when the caller cannot call that list.\n"
              },
              "staging_returns": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Cancelled orders still holding a staging slot until their cards are put back (`listStagingReturns`). Null when the caller cannot call that list.\n"
              }
            }
          },
          "recounts": {
            "type": "object",
            "required": [
              "open_flags"
            ],
            "properties": {
              "open_flags": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "Bin recount flags still open in bins holding at least the store's `recount_alert_min_flags_per_bin` of them, holding bins included (`listRecountFlags`' `total` with `status=open` and no other filter). Null when the caller cannot call that list.\n"
              }
            }
          }
        }
      },
      "OrderTransferCard": {
        "type": "object",
        "description": "One picked card in an order transfer's bundle, or in an order's departed part.",
        "required": [
          "pick_item_uuid",
          "tcgplayer_sku_id",
          "product_name",
          "condition",
          "quantity"
        ],
        "properties": {
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the SKU is not in the catalog."
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "OrderTransfer": {
        "type": "object",
        "description": "Location picking: one order's bundle of cards picked at another top-level location, travelling to the order's ship location.\n",
        "required": [
          "transfer_uuid",
          "order_uuid",
          "marketplace_order_id",
          "from_location_uuid",
          "from_location_name",
          "to_location_uuid",
          "to_location_name",
          "status",
          "staging_slot",
          "created_at",
          "cards"
        ],
        "properties": {
          "transfer_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "from_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "to_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "to_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "in_transit",
              "received",
              "short",
              "cancelled"
            ]
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The order's staging slot at its ship location, where its other cards wait; null until it has one.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "cards": {
            "type": "array",
            "description": "The cards the bundle carries; a card received short is no longer listed.",
            "items": {
              "$ref": "#/components/schemas/OrderTransferCard"
            }
          }
        }
      },
      "ConsolidationQueueItem": {
        "type": "object",
        "description": "Location picking: an order split across top-level locations whose every part waits at its ship location, ready for a consolidation run.\n",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "fulfillment_method",
          "staging_slot",
          "ship_location_uuid",
          "ship_location_name",
          "transfers",
          "card_count"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "fulfillment_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "`pickup` orders and shipped orders go in separate consolidation runs."
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Where the cards picked at its ship location wait; null when nothing was picked there (every part came on a transfer).\n"
          },
          "ship_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Where the order is packed and shipped: the location its transfers went to. A consolidation run takes orders of one ship location.\n"
          },
          "ship_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "transfers": {
            "type": "array",
            "description": "The transfers received from other locations for the order (in full or short).",
            "items": {
              "type": "object",
              "required": [
                "transfer_uuid",
                "from_location_name"
              ],
              "properties": {
                "transfer_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "from_location_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "card_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies the order's runs pulled for it (a card received short is not counted)."
          }
        }
      },
      "StagingReturn": {
        "type": "object",
        "description": "Location picking (#4276): a cancelled order still holding a staging slot, with the cards in it.\n",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "staging_slot",
          "staging_location_uuid",
          "staging_location_name",
          "cards"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "staging_slot": {
            "type": "integer",
            "minimum": 1
          },
          "staging_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The location the slot is in (the order's ship location). Null for an order with no transfer."
          },
          "staging_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cards": {
            "type": "array",
            "description": "The cards in the slot, by SKU. Empty when nothing reached it.",
            "items": {
              "$ref": "#/components/schemas/StagingReturnCard"
            }
          }
        }
      },
      "StagingReturnCard": {
        "type": "object",
        "required": [
          "pick_item_uuid",
          "tcgplayer_sku_id",
          "product_name",
          "condition",
          "quantity",
          "bin_location_uuid",
          "bin_name",
          "restocked"
        ],
        "properties": {
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "description": "The card actually pulled (a substitute's SKU when one was picked)."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "bin_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin the card was pulled from, where it goes back."
          },
          "bin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "restocked": {
            "type": "boolean",
            "description": "True when the cancel already gave this copy back to the bin's stock. False when the cancel did not restock it (a no-restock cancel, or a restock the cancel had to skip): adjust stock if the card goes back on the shelf.\n"
          }
        }
      },
      "StagingSlotReleased": {
        "type": "object",
        "required": [
          "order_uuid",
          "staging_slot"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "staging_slot": {
            "type": "integer",
            "description": "The slot number freed."
          }
        }
      },
      "CreateConsolidationRunRequest": {
        "type": "object",
        "required": [
          "order_uuids"
        ],
        "properties": {
          "order_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "Orders from the consolidation queue.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "PreviewRunLocationsRequest": {
        "type": "object",
        "required": [
          "order_uuids"
        ],
        "properties": {
          "order_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "The orders selected for the run.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "RunLocationsPreview": {
        "type": "object",
        "required": [
          "locations"
        ],
        "properties": {
          "locations": {
            "type": "array",
            "description": "One per top-level location, in the store's location order.",
            "items": {
              "$ref": "#/components/schemas/RunLocationPreview"
            }
          }
        }
      },
      "RunLocationPreview": {
        "type": "object",
        "required": [
          "location_uuid",
          "name",
          "complete",
          "partial",
          "none",
          "orders"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "complete": {
            "type": "integer",
            "minimum": 0
          },
          "partial": {
            "type": "integer",
            "minimum": 0
          },
          "none": {
            "type": "integer",
            "minimum": 0,
            "description": "Orders this location can supply nothing of; a run here leaves them out."
          },
          "orders": {
            "type": "array",
            "description": "Every selected order, in request order.",
            "items": {
              "type": "object",
              "required": [
                "order_uuid",
                "coverage",
                "end_location_uuid",
                "end_location_name"
              ],
              "properties": {
                "order_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "coverage": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "partial",
                    "none"
                  ]
                },
                "end_location_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid",
                  "description": "The location this order ends at, when it is not this one; null otherwise."
                },
                "end_location_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "ReceiveOrderTransferShortRequest": {
        "type": "object",
        "required": [
          "missing_pick_item_uuids"
        ],
        "properties": {
          "missing_pick_item_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "The transfer's pick items that did not arrive.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "FulfillmentRunConsolidationOrder": {
        "type": "object",
        "description": "An order and the staging slot where its parts wait at its ship location.",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "staging_slot",
          "transfer_uuids",
          "cards"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ]
          },
          "transfer_uuids": {
            "type": "array",
            "description": "The transfers received (in full or short) for the order.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "cards": {
            "type": "array",
            "description": "The cards in the order's staging slot: picked on runs it left, and bundles that arrived. A card received short is not here.\n",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunGatheredCard"
            }
          }
        }
      },
      "FulfillmentRunGatheredCard": {
        "type": "object",
        "description": "One pick item in an order's staging slot, named with `FulfillmentPickItem`'s field names. One entry per pick item: two picks of the same card are two entries.\n",
        "required": [
          "pick_item_uuid",
          "order_item_uuid",
          "tcgplayer_sku_id",
          "quantity",
          "product_name",
          "product_set_name",
          "product_number",
          "flavor_name",
          "variant_label",
          "condition",
          "language",
          "finish",
          "game",
          "image_uri",
          "unit_price",
          "currency",
          "is_substitute"
        ],
        "properties": {
          "pick_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "description": "The card in the slot (a substitute's own SKU when it replaced the ordered one)."
          },
          "quantity": {
            "type": "integer"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The order line's unit price."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order's currency."
          },
          "is_substitute": {
            "type": "boolean",
            "description": "The card replaced the one ordered (`order_item_uuid` names the line it fills)."
          }
        }
      },
      "FulfillmentRunDepartedPart": {
        "type": "object",
        "description": "An order that left a location-scoped run at pick-complete, and where the cards picked for it on this run go: its staging slot here (this is its ship location), or the transfer carrying them to its ship location.\n",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "staging_slot",
          "transfer_uuid",
          "to_location_uuid",
          "to_location_name",
          "cards"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "staging_slot": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Set when the order was staged at this location (its ship location)."
          },
          "transfer_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Set when this run sent the cards on an order transfer."
          },
          "to_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Where the transfer goes; null when the order was staged here."
          },
          "to_location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderTransferCard"
            }
          }
        }
      },
      "PackerQueueItem": {
        "type": "object",
        "required": [
          "run_uuid",
          "picker_uuid",
          "picker_email",
          "picker_display_name",
          "strategy",
          "status",
          "created_at",
          "updated_at",
          "order_count",
          "card_count",
          "total_value",
          "by_currency",
          "is_pickup_run",
          "pending_marketplace_notifications",
          "missing_cards",
          "name"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The run's name: `LABEL - YYMMDD - N` by default (renameFulfillmentRun changes it), a CardChaos run's picklist name, or null on a run created before run names existed.\n"
          },
          "prepull_program": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "direct",
              "ct_zero",
              null
            ],
            "description": "The holding program of a pre-pull run (`direct` or `ct_zero`), or null for any other run. Dismissing a pre-pull run asks whether its cards are back on the shelf or go into holding.\n"
          },
          "missing_cards": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Copies this order run failed to pull (`FulfillmentRun.missing.cards`). Null on an RI, pre-pull or Zero invoice run.\n"
          },
          "pending_marketplace_notifications": {
            "type": "integer",
            "minimum": 0,
            "description": "Labels bought in this run's Ship Review whose marketplace notification is still waiting for `shipFulfillmentRun`. A non-zero count on a run nobody is finishing is the warning that buyers have not been told their order shipped. See `FulfillmentRun.pending_marketplace_notifications`.\n"
          },
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The Reimbursement Invoice an RI pull run picked, or null for an order run. An RI run has no orders and is settled at pick-complete: it is closed with `shipFulfillmentRun`, never sorted or labelled.\n"
          },
          "picker_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "picker_email": {
            "type": "string"
          },
          "picker_display_name": {
            "type": "string",
            "description": "Display name of the picker (\"First Last\"), resolved at read time. Falls back to the email in `picker_email` when no name is on file.\n"
          },
          "strategy": {
            "type": "string",
            "enum": [
              "by_order",
              "by_game_set_alpha",
              "by_location",
              "consolidation"
            ],
            "description": "`consolidation`: a location-picking run that picks nothing, made from the consolidation queue; its cards are the ones its orders' earlier runs pulled.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready_to_pack"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "order_count": {
            "type": "integer"
          },
          "card_count": {
            "type": "integer"
          },
          "total_value": {
            "type": "number",
            "description": "Sum of the run's pick-item values with no regard to currency, so it means nothing on a run that mixes currencies. Show `by_currency` instead."
          },
          "by_currency": {
            "type": "array",
            "description": "The run's pick-item values, one entry per order currency, sorted by code. Nothing converts between them (#3700). Empty on an RI run, which has no order lines.",
            "items": {
              "$ref": "#/components/schemas/RunValueByCurrency"
            }
          },
          "is_pickup_run": {
            "type": "boolean",
            "description": "True when every order on this run is collected in the shop rather than mailed. The packer closes it out from Package Sort — there is no Ship Review stage and no label to buy. See `FulfillmentRun.is_pickup_run`.\n"
          }
        }
      },
      "PaginatedAuditEventList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CursorMeta"
          },
          {
            "type": "object",
            "required": [
              "events"
            ],
            "properties": {
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AuditEvent"
                }
              }
            }
          }
        ]
      },
      "PaginatedBuylistPurchaseList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "purchases"
            ],
            "properties": {
              "purchases": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BuylistPurchase"
                }
              }
            }
          }
        ]
      },
      "StoreBuylistOfferCondition": {
        "type": "object",
        "required": [
          "condition",
          "tcgplayer_sku_id",
          "language",
          "cash",
          "quantity_on_hand"
        ],
        "properties": {
          "condition": {
            "type": "string"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "language": {
            "type": "string",
            "description": "Canonical card language name for this SKU (e.g. English, Japanese) -- the global_identifiers.language value. One product can list multiple languages."
          },
          "max_qty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cash": {
            "type": "number"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "quantity_on_hand": {
            "type": "integer",
            "description": "Copies of this SKU the store already holds, summed across every live inventory location. Operator-only -- the public storefront browse does not return it. 0 when the store holds none.\n"
          },
          "locked": {
            "type": "boolean",
            "default": false,
            "description": "True when this offer's cash/credit is frozen against the rebuild (#1175). Operator-only -- the public storefront browse does not return it.\n"
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the offer was locked. Null while unlocked."
          }
        },
        "description": "One buyable grade of a card. The operator counterpart of the public browse's condition entry, plus the stock already on the shelf.\n"
      },
      "StoreBuylistOfferProduct": {
        "type": "object",
        "required": [
          "tcgplayer_product_id",
          "product_name",
          "set_name",
          "set_code",
          "finish",
          "is_foil",
          "hotlist",
          "conditions"
        ],
        "properties": {
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": "string"
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (Magic only), when it has one."
          },
          "set_name": {
            "type": "string"
          },
          "set_code": {
            "type": "string"
          },
          "set_release_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Chronological release date of the card's set; null if unavailable."
          },
          "set_icon_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": "string"
          },
          "is_foil": {
            "type": "boolean"
          },
          "treatments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hotlist": {
            "type": "boolean"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreBuylistOfferCondition"
            }
          }
        },
        "description": "A card the store buys, as one printing (product + finish; a foil and a normal printing are separate entries) carrying every grade it buys.\n"
      },
      "BuylistMarginWarning": {
        "type": "object",
        "description": "One buylist offer priced too close to the store's own retail price. Flat per SKU (a grade), since that is where a margin exists.\n",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "condition",
          "finish",
          "cash",
          "retail_price",
          "margin_pct",
          "margin_dollars",
          "locked",
          "hotlist",
          "quantity_on_hand"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_icon_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "hotlist": {
            "type": "boolean"
          },
          "cash": {
            "type": "number",
            "description": "What the store pays for this card in cash."
          },
          "credit": {
            "type": [
              "number",
              "null"
            ],
            "description": "Store-credit offer, null when the matched rule offers cash only."
          },
          "retail_price": {
            "type": "number",
            "description": "What the store sells this SKU for (`pricing_data.retail_price`)."
          },
          "margin_pct": {
            "type": "number",
            "description": "`(retail_price - cash) / retail_price * 100`. Negative when the store buys the card for more than it sells it -- a real state, so it is not clamped.\n"
          },
          "margin_dollars": {
            "type": "number",
            "description": "`retail_price - cash`. Carried beside the percent because they rank differently: 2% on a bulk common is noise, 2% on a $400 card is the row to fix first.\n"
          },
          "quantity_on_hand": {
            "type": "integer",
            "description": "Copies of this SKU the store already holds, across every live location. Always at least 1: a zero-stock SKU is excluded from this report entirely."
          },
          "locked": {
            "type": "boolean",
            "description": "Whether this offer's price is frozen against the rebuild (#1175)."
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The buylist rule that set this price, as of the last rebuild. The link to the fix. Denormalized provenance rather than a foreign key, so it can point at a since-deleted rule until the next rebuild re-derives the row.\n"
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of that rule, null when it no longer exists."
          }
        }
      },
      "PaginatedBuylistMarginWarningList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "offers",
              "threshold_pct"
            ],
            "properties": {
              "offers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BuylistMarginWarning"
                }
              },
              "threshold_pct": {
                "type": "number",
                "description": "The margin percent these results were judged against -- the request's `threshold_pct`, or the store's configured `min_buylist_margin_pct` when none was given. Echoed so the UI can label the page without a second config read.\n"
              }
            }
          }
        ]
      },
      "BuylistOfferPriceRequest": {
        "type": "object",
        "required": [
          "cash"
        ],
        "properties": {
          "cash": {
            "type": "number",
            "minimum": 0,
            "description": "Cash offer to write, in the store's currency. Rounded to 4 decimals -- buy-side prices are per card and bulk is bought per thousand, so $12.50/1000 commons is a $0.0125 offer. Payout totals are still whole cents.\n"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Store-credit offer. Omit (or send null) to leave the rule-derived credit offer untouched -- stores that offer cash only never send it.\n"
          }
        }
      },
      "BuylistOfferPrice": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "cash",
          "locked"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "cash": {
            "type": "number"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "locked": {
            "type": "boolean",
            "description": "Always true — writing a price locks it, or the next rebuild would revert it."
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "BuylistOfferExplanation": {
        "type": "object",
        "description": "Why a store's buylist pays what it pays, for one SKU or one card. The store's whole rule set re-evaluated against each SKU right now, beside the stored offer projection the storefront serves.",
        "required": [
          "store_uuid",
          "generated_at",
          "rules",
          "skipped_rules",
          "skus"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the rules were re-evaluated. The result is not cached."
          },
          "rules": {
            "type": "array",
            "description": "Every buylist rule the store has, enabled or not, in evaluation order - so a trace entry can be rendered without a second request.\n",
            "items": {
              "$ref": "#/components/schemas/BuylistExplainRule"
            }
          },
          "skipped_rules": {
            "type": "array",
            "description": "Rules every buylist read path silently ignores because their action is neither BUY nor DECLINE - a SET PRICE rule stored before the buylist action fence landed. They are listed here because a rule that never runs is a common reason a price is not what a store expects.\n",
            "items": {
              "$ref": "#/components/schemas/BuylistExplainSkippedRule"
            }
          },
          "skus": {
            "type": "array",
            "description": "One entry per catalog SKU resolved, in ascending SKU order.",
            "items": {
              "$ref": "#/components/schemas/BuylistSkuExplanation"
            }
          }
        }
      },
      "BuylistExplainRule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "rule_name",
          "rule_source",
          "sequence_index",
          "game",
          "currency",
          "is_enabled"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string"
          },
          "rule_source": {
            "type": "string",
            "description": "The rule's DSL source."
          },
          "sequence_index": {
            "type": "integer"
          },
          "game": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          }
        }
      },
      "BuylistExplainSkippedRule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "rule_name",
          "game",
          "action_type",
          "reason"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string"
          },
          "game": {
            "type": "string"
          },
          "action_type": {
            "type": "string",
            "description": "The action the rule takes, named as the reason it is skipped here, e.g. `set price`. Buylist reads only act on BUY and DECLINE.\n"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "BuylistSkuExplanation": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "game",
          "condition",
          "stored_offer",
          "live",
          "variables",
          "rule_trace",
          "divergence"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "game": {
            "type": "string"
          },
          "condition": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "stored_offer": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistExplainStoredOffer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The saved offer the storefront is serving, or null when the store has no offer for this SKU.\n"
          },
          "live": {
            "$ref": "#/components/schemas/BuylistExplainLiveOutcome"
          },
          "variables": {
            "type": "array",
            "description": "Every variable the store's rules read for this SKU, resolved to its current value - the numbers behind the price.\n",
            "items": {
              "$ref": "#/components/schemas/BuylistExplainVariable"
            }
          },
          "rule_trace": {
            "type": "array",
            "description": "Every rule of this SKU's game, with its own verdict, in evaluation order. Rules for the store's other games are left out: they were never evaluated against this SKU and could not have priced it. They are still listed in `rules`, each with its `game`.\n",
            "items": {
              "$ref": "#/components/schemas/BuylistExplainTraceEntry"
            }
          },
          "divergence": {
            "type": "array",
            "description": "Plain-language notes on every way the stored offer disagrees with what the rules compute now. Empty when they agree. A price lock or a projection older than the last rule edit are legitimate causes, and are named as such rather than reported as a fault.\n",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BuylistExplainStoredOffer": {
        "type": "object",
        "required": [
          "cash",
          "credit",
          "max_qty",
          "hotlist",
          "locked",
          "locked_at",
          "matched_rule_uuid",
          "updated_at"
        ],
        "properties": {
          "cash": {
            "type": "number"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_qty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "hotlist": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean",
            "description": "True when this offer's cash/credit is frozen against the rebuild."
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that set this row at the last rebuild."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BuylistExplainLiveOutcome": {
        "type": "object",
        "description": "What the current rule set computes for this SKU right now.",
        "required": [
          "decision",
          "rule_uuid",
          "cash",
          "credit",
          "on_hand",
          "requested_quantity",
          "accepted_quantity"
        ],
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "buy",
              "decline",
              "no_match"
            ],
            "description": "`buy` - a BUY rule matched. `decline` - a DECLINE rule matched, so the store refuses the card by policy. `no_match` - no rule matched it at all, which the storefront also renders as not buying, but for a different reason and with a different fix.\n"
          },
          "rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "rule_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "cash": {
            "type": [
              "number",
              "null"
            ],
            "description": "Null on a decline, and also when a BUY rule matched but its price variable has no value for this SKU - the second case is a card the store means to buy and silently is not.\n"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_stock": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The matched rule's MAX_STOCK target, or null when uncapped."
          },
          "on_hand": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Copies of this SKU across the store's inventory locations."
          },
          "headroom": {
            "type": [
              "integer",
              "null"
            ],
            "description": "max_stock minus on_hand, floored at zero - how many more copies the cap still allows. Null when the matched rule is uncapped.\n"
          },
          "requested_quantity": {
            "type": "integer",
            "description": "The `quantity` the request asked about, echoed back."
          },
          "accepted_quantity": {
            "type": "integer",
            "description": "How many of `requested_quantity` the store would actually take: the ask clamped to `headroom`, or the whole ask when the matched rule is uncapped. Zero on a decline, on no match, and on a rule that matched but computed no price - the storefront lists none of those.\n"
          },
          "resolved_condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which condition's platform price actually priced this SKU, when the matched rule's price source was a bare (condition-agnostic) variable resolved via the nearest-better-condition fallback. Null for a pinned variable or a composite price source.\n"
          }
        }
      },
      "BuylistExplainVariable": {
        "type": "object",
        "required": [
          "name",
          "kind",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "DSL variable name, e.g. `TCGPLAYER_MARKET`, `RARITY`, `ON_HAND`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "price",
              "attribute",
              "date",
              "flag",
              "context"
            ],
            "description": "How to render `value`. `context` and `flag` mark the two variables always reported whether or not a rule reads them - stock on hand and hotlist membership.\n"
          },
          "value": {
            "description": "The resolved value, typed by `kind`: a number for a price, a string for an attribute or date, an integer for ON_HAND, a boolean for HOTLIST. Null means the SKU has no value for it - which is usually the answer to \"why did my rule not match\".\n"
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a platform price: the condition the price was actually read at. For a bare (condition-agnostic) variable that is the answer to \"you quoted my Moderately Played off a Lightly Played price\" - it differs from the SKU's own condition whenever the nearest-better-condition fallback walked up the grade ladder. For a pinned variable it simply restates the pin. Null for anything that is not a platform price.\n"
          }
        }
      },
      "BuylistExplainTraceEntry": {
        "type": "object",
        "description": "One rule's verdict for one SKU. The verdict only - the rule itself is named by `rule_uuid` and described once in `rules`, which is what that list is for. Repeating a rule's name and DSL source in each of its verdicts made this response scale as rules x grades and pushed it past the gateway's body limit on a wide rule set.\n",
        "required": [
          "rule_uuid",
          "status",
          "matched"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Join against `rules` for this rule's name, source, game and enabled flag."
          },
          "status": {
            "type": "string",
            "enum": [
              "matched",
              "shadowed",
              "no_match",
              "undecidable",
              "disabled",
              "unsupported_action"
            ],
            "description": "`matched` - this rule set the price. `shadowed` - it matched, but a rule above it won. `no_match` - its condition was false. `undecidable` - its condition evaluated to NULL because a *price or date* it compares has no value for this SKU yet, which is a missing feed rather than a rejection. A catalog attribute with no value is never undecidable: a rarity comparison against sealed product or a token, whose rarity the catalog structurally does not hold, is `no_match` (and a negated one matches), because the answer is decidable. `disabled` and `unsupported_action` were never evaluated at all.\n"
          },
          "matched": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The rule's raw predicate. Three-valued on purpose: null is the `undecidable` case above, and is not the same as false.\n"
          },
          "cash": {
            "type": [
              "number",
              "null"
            ],
            "description": "What this rule would pay, computed whether or not it matched - so a store can see what the rule above would have offered. Null on a DECLINE rule, which computes no price.\n"
          },
          "credit": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_stock": {
            "type": [
              "integer",
              "null"
            ]
          },
          "resolved_condition": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RepricePriceExplanation": {
        "type": "object",
        "description": "Why a store's retail price is what it is, for one SKU or one card. The retail twin of BuylistOfferExplanation (#2250) -- the store's reprice rules re-evaluated against each SKU right now, beside the stored `pricing_data` row.",
        "required": [
          "store_uuid",
          "generated_at",
          "rules",
          "skipped_rules",
          "skus"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the rules were re-evaluated. The result is not cached."
          },
          "rules": {
            "type": "array",
            "description": "The store's reprice rules for the games of the SKUs explained, enabled or not, in evaluation order - so a trace entry can be rendered without a second request. Other games' rules are left out: they can never match these SKUs.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceExplainRule"
            }
          },
          "skipped_rules": {
            "type": "array",
            "description": "Rules this report does not explain, each with a `kind` saying why: a `MARKETPLACE`-conditioned rule (it sets a per-channel override, not the base price), a `DO NOT LIST ON` rule (it asserts a suppression, not a price), or a rule whose condition reads `LAST_PRICE_CHANGE_DATE` (it resolves against a pricing row this report cannot project).\n",
            "items": {
              "$ref": "#/components/schemas/RepriceExplainSkippedRule"
            }
          },
          "skus": {
            "type": "array",
            "description": "One entry per catalog SKU resolved, in ascending SKU order.",
            "items": {
              "$ref": "#/components/schemas/RepriceSkuExplanation"
            }
          }
        }
      },
      "RepriceExplainRule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "rule_name",
          "rule_source",
          "sequence_index",
          "game",
          "currency",
          "is_enabled"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string"
          },
          "rule_source": {
            "type": "string",
            "description": "The rule's DSL source."
          },
          "sequence_index": {
            "type": "integer"
          },
          "game": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "is_enabled": {
            "type": "boolean"
          }
        }
      },
      "RepriceExplainSkippedRule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "rule_name",
          "game",
          "action_type",
          "kind",
          "reason"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string"
          },
          "game": {
            "type": "string"
          },
          "action_type": {
            "type": "string",
            "description": "The action the rule takes, named as the reason it is skipped here."
          },
          "kind": {
            "type": "string",
            "enum": [
              "marketplace",
              "base_fallback",
              "currency_mismatch",
              "date_variable",
              "listing",
              "buylist",
              "unsupported"
            ],
            "description": "Why the rule is skipped. Label a skipped rule by this, never by `reason`.\n- `marketplace`: a `MARKETPLACE` term this report cannot split\n  off the rest of the condition (inside an `OR`, a nested group or\n  a negation; refused at save time, so only an old rule has one).\n  Every other `MARKETPLACE` rule is explained in `rule_trace` and\n  `marketplace_live`.\n- `base_fallback`, `currency_mismatch`: no longer emitted. Those\n  rules are explained like any other `MARKETPLACE` rule.\n- `date_variable`: the condition reads `LAST_PRICE_CHANGE_DATE`,\n  which this report cannot evaluate, `MARKETPLACE` rule or not.\n- `listing`: a `DO NOT LIST ON` rule; it hides listings rather\n  than setting a price.\n- `buylist`: a `BUY` or `DECLINE` rule, which retail prices never\n  use.\n- `unsupported`: any other action that sets no retail price.\n"
          },
          "reason": {
            "type": "string",
            "description": "A store-facing sentence saying why the rule is skipped. Wording may change; match on `kind` instead.\n"
          }
        }
      },
      "RepriceSkuExplanation": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "game",
          "condition",
          "stored_pricing",
          "live",
          "marketplace_live",
          "variables",
          "rule_trace",
          "divergence"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "game": {
            "type": "string"
          },
          "condition": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "stored_pricing": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RepriceExplainStoredPricing"
              },
              {
                "type": "null"
              }
            ],
            "description": "The store's saved `pricing_data` row for this SKU, or null when the store has never priced it.\n"
          },
          "last_priced_by_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that most recently set this SKU's base price, from its latest `reprice_snapshots` row. Null when it has never been repriced (e.g. only ever priced by hand or by import).\n"
          },
          "last_priced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "live": {
            "$ref": "#/components/schemas/RepriceExplainLiveOutcome"
          },
          "marketplace_live": {
            "type": "array",
            "description": "One entry per marketplace a `MARKETPLACE` rule of this game names or this SKU has a stored override for, sorted by marketplace: what the next reprice leaves that marketplace's price at. Rules in `skipped_rules` are not modelled, nor are `N PER DAY` holds.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceExplainMarketplaceOutcome"
            }
          },
          "variables": {
            "type": "array",
            "description": "Every variable the store's rules read for this SKU, resolved to its current value - the numbers behind the price.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceExplainVariable"
            }
          },
          "rule_trace": {
            "type": "array",
            "description": "Every rule of this SKU's game, with its own verdict, in evaluation order. Rules for the store's other games are left out: they were never evaluated against this SKU and could not have priced it. They are still listed in `rules`, each with its `game`.\n",
            "items": {
              "$ref": "#/components/schemas/RepriceExplainTraceEntry"
            }
          },
          "divergence": {
            "type": "array",
            "description": "Plain-language notes on every way the stored price, or a stored marketplace price, disagrees with what the rules compute now. Empty when they agree. A price lock or a projection older than the last rule edit are legitimate causes, and are named as such rather than reported as a fault.\n",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RepriceExplainStoredPricing": {
        "type": "object",
        "required": [
          "retail_price",
          "last_cleared_price",
          "currency",
          "price_locked",
          "locked_at",
          "last_repriced_at"
        ],
        "properties": {
          "retail_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "last_cleared_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The price this SKU had when its `retail_price` was last nulled, in `currency`: usually the out-of-stock clear, but also a write that removed the price or a rollback of a first price. Dated by `last_repriced_at`. Null whenever `retail_price` is set, and when the price was never nulled since this field existed.\n"
          },
          "currency": {
            "type": "string"
          },
          "price_locked": {
            "type": "boolean",
            "description": "True when this price is frozen against future reprice runs, by its own lock or a bin's."
          },
          "price_lock_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "bin",
              "both",
              null
            ],
            "description": "Why the price is locked: `manual` (the card's own lock, removable), `bin` (a bin it is stocked in has a standing price lock), `both`, or null when not locked.\n"
          },
          "locked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_repriced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "RepriceExplainLiveOutcome": {
        "type": "object",
        "description": "What the current rule set sets this SKU's base retail price to, right now.",
        "required": [
          "decision",
          "rule_uuid",
          "price"
        ],
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "priced",
              "no_price",
              "no_match"
            ],
            "description": "`priced` - a rule matched and computed a price. For a SKU the store has priced, that is the first rule that matched with a price, as a reprice run skips a rule that computes none; for one it has not, the first rule that matched, as first-pricing does. `no_price` - a rule matched but its price variable has no value for this SKU (and, for a priced SKU, no later matching rule has one), which is a card the rules mean to price and silently do not. `no_match` - no rule matched it at all.\n"
          },
          "rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "rule_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "resolved_condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which condition's platform price actually priced this SKU, when the matched rule's price source was a bare (condition-agnostic) variable resolved via the nearest-better-condition fallback. Null for a pinned variable or a composite price source.\n"
          },
          "authored_by_marketplace_rule": {
            "type": "boolean",
            "description": "True when the game has no rule that sets the base price, so the first matching `MARKETPLACE` rule allowed to sets it as well (a rule reading `CURRENT_PRICE`, or in another currency than the store's, never does). `rule_uuid` names that rule.\n"
          },
          "exact": {
            "type": "boolean",
            "description": "False when a rule in `skipped_rules` (one reading `LAST_PRICE_CHANGE_DATE`) comes before this outcome's rule: a reprice run still evaluates it and may set the price there, so `divergence` hedges instead of comparing. Always true for a SKU the store has not priced, since first-pricing skips such rules.\n"
          }
        }
      },
      "RepriceExplainMarketplaceOutcome": {
        "type": "object",
        "required": [
          "marketplace",
          "decision",
          "rule_uuid",
          "price",
          "cleared_by_rule_uuid",
          "stored_price",
          "exact"
        ],
        "properties": {
          "marketplace": {
            "type": "string",
            "description": "Marketplace key, e.g. `MANA_POOL`."
          },
          "decision": {
            "type": "string",
            "enum": [
              "priced",
              "no_price",
              "cleared",
              "kept",
              "locked",
              "no_match"
            ],
            "description": "`priced` - the first `MARKETPLACE` rule naming this marketplace that matched with a price sets it to `price`; later rules naming it are `shadowed`. `no_price` - a rule matched but computes no price. Any stored override stays. `cleared` - a rule that sets the base price matched and clears this marketplace's override (one in the store's currency), so it lists at the base price: an override set by an earlier `MARKETPLACE` rule, or a stored one no rule sets. `kept` - no rule touches the stored override. `locked` - the card's price is locked, so nothing is written. `no_match` - a rule names this marketplace but none matched, and nothing is stored.\n"
          },
          "rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that decides this marketplace, if any."
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "What that rule sets, for `priced` and `cleared`."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "cleared_by_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "For `cleared`, the rule whose base price takes its place."
          },
          "stored_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The override stored now (`pricing_data_overrides`), or null."
          },
          "stored_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "exact": {
            "type": "boolean",
            "description": "False when a run may decide this marketplace differently: `live` is not exact, a skipped rule naming this marketplace comes first, or the deciding rule reads the base price (`CURRENT_PRICE`, or a `GUARD`) and a rule before it changes the base in the same run. `price` is then computed from the stored base.\n"
          }
        }
      },
      "RepriceExplainVariable": {
        "type": "object",
        "required": [
          "name",
          "kind",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "DSL variable name, e.g. `TCGPLAYER_MARKET`, `RARITY`, `CURRENT_QUANTITY`."
          },
          "kind": {
            "type": "string",
            "enum": [
              "price",
              "attribute",
              "date",
              "flag",
              "context"
            ],
            "description": "How to render `value`."
          },
          "value": {
            "description": "The resolved value, typed by `kind`. Null means the SKU has no value for it - which is usually the answer to \"why did my rule not match\".\n"
          },
          "condition": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a platform price: the condition the price was actually read at. For a bare (condition-agnostic) variable that is the answer to \"you priced my Moderately Played off a Lightly Played price\" - it differs from the SKU's own condition whenever the nearest-better-condition fallback walked up the grade ladder. For a pinned variable it simply restates the pin. Null for anything that is not a platform price.\n"
          }
        }
      },
      "RepriceExplainTraceEntry": {
        "type": "object",
        "description": "One rule's verdict for one SKU. The verdict only - the rule itself is named by `rule_uuid` and described once in `rules`.\n",
        "required": [
          "rule_uuid",
          "status",
          "matched"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Join against `rules` for this rule's name, source, game and enabled flag."
          },
          "marketplaces": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "For a `MARKETPLACE` rule, the marketplaces it names: it was judged on the rest of its condition, `matched` means it decides at least one of them in `marketplace_live` (or sets the base price, per `live.authored_by_marketplace_rule`), and `shadowed` that an earlier rule decides them all. Null for a rule that sets the base price.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "matched",
              "shadowed",
              "no_match",
              "undecidable",
              "disabled",
              "unsupported"
            ],
            "description": "`matched` - this rule set the price. `shadowed` - it matched, but a rule above it won. `no_match` - its condition was false. `undecidable` - its condition evaluated to NULL because a *price or date* it compares has no value for this SKU yet. A catalog attribute with no value is never undecidable: a rarity comparison against sealed product or a token, whose rarity the catalog structurally does not hold, is `no_match` (and a negated one matches), because the answer is decidable. `disabled` and `unsupported` were never evaluated at all (see `skipped_rules` for why a rule is `unsupported`).\n"
          },
          "matched": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The rule's raw predicate. Three-valued on purpose: null is the `undecidable` case above, and is not the same as false.\n"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "What this rule would set the price to, computed whether or not it matched - so a store can see what the rule above would have set.\n"
          },
          "resolved_condition": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaginatedStoreBuylistOfferList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "products"
            ],
            "properties": {
              "products": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoreBuylistOfferProduct"
                }
              }
            }
          }
        ]
      },
      "BuylistPriceListRow": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "condition",
          "finish",
          "cash",
          "currency",
          "hotlist",
          "updated_at"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "game": {
            "type": "string"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "cash": {
            "type": "number",
            "description": "What the store pays in cash for one copy, in `currency`."
          },
          "credit": {
            "type": [
              "number",
              "null"
            ],
            "description": "What the store pays in store credit for one copy; null when the store offers cash only."
          },
          "currency": {
            "type": "string",
            "description": "The store's currency (ISO 4217)."
          },
          "hotlist": {
            "type": "boolean",
            "description": "Whether the store has the card on its hotlist."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last time the offer row changed: a price, the hotlist flag or any other column."
          }
        }
      },
      "BuylistPriceListResponse": {
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuylistPriceListRow"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/CursorMeta"
          }
        }
      },
      "RetailPriceListRow": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "game",
          "condition",
          "finish",
          "language"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "game": {
            "type": "string"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "base": {
            "$ref": "#/components/schemas/RetailPriceListBase",
            "description": "The store's own price. Absent when the card has no base price or a base price of 0, no copies visible to list (all reserved, or a drip-listing target of 0), a do-not-sell tag, or when the caller's key doesn't share the base price.\n"
          },
          "marketplaces": {
            "type": "array",
            "description": "Every shared marketplace this card is listed on, in marketplace-name order; empty when the card is listed only at its base price. Absent when the caller's key shares no marketplace, and under `marketplace=BASE`.\n",
            "items": {
              "$ref": "#/components/schemas/RetailPriceListMarketplace"
            }
          },
          "price_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The last time HippoLink changed this card's base price; null when it never has. It dates the base price only, and is sent whenever shared, even when `marketplace=` leaves `base` out. A first price doesn't set it, and a price cleared then set again reports the clear. Absent unless the caller's key shares it.\n"
          }
        }
      },
      "RetailPriceListBase": {
        "type": "object",
        "description": "The store's own price for the card. Absent when the card has no base price or a base price of 0, has no copies visible to list (all reserved, or a drip-listing target of 0), is tagged do-not-sell, or the caller's key doesn't share the base price.\n",
        "required": [
          "price",
          "currency"
        ],
        "properties": {
          "price": {
            "type": "number",
            "description": "The store's base price for one copy, in `currency`."
          },
          "currency": {
            "type": "string",
            "description": "The store's currency (ISO 4217)."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "The copies visible in the store's sellable bins, capped at the card's drip-listing target: what a marketplace that lists visible stock, such as TCGplayer, is sent before its own caps. Absent unless the caller's key shares quantity.\n"
          }
        }
      },
      "RetailPriceListMarketplace": {
        "type": "object",
        "required": [
          "marketplace",
          "price",
          "currency"
        ],
        "properties": {
          "marketplace": {
            "type": "string",
            "description": "The marketplace this entry is sent to, e.g. `TCGPLAYER`."
          },
          "price": {
            "type": "number",
            "description": "The price the marketplace is sent for one copy, in `currency`."
          },
          "currency": {
            "type": "string",
            "description": "The currency the marketplace lists this card in (ISO 4217)."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "The quantity the push sends to this marketplace, already net of the store's reserves and of orders HippoLink has ingested. Absent unless the caller's key shares quantity.\n"
          }
        }
      },
      "RetailPriceListResponse": {
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetailPriceListRow"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/CursorMeta"
          }
        }
      },
      "PaginatedBuylistRuleList": {
        "type": "object",
        "required": [
          "total",
          "rules"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Number of rules in `rules`, every rule of the game."
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuylistRule"
            }
          }
        }
      },
      "HotlistProduct": {
        "description": "One card on a store's hotlist, as returned by `listHotlistProducts`. Sourced from hotlist membership, so it is present regardless of inventory. The catalog display fields are nullable rather than a `CatalogProduct` reference: a hotlist row can outlive its catalog product row (hotlisting validates a card against the SKU catalog, not the product catalog), and such a row is surfaced instead of hidden so the store can still remove it.\n",
        "type": "object",
        "required": [
          "tcgplayer_product_id",
          "hotlist",
          "in_stock",
          "quantity",
          "added_at"
        ],
        "properties": {
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID (the card, not one of its SKUs)."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the card's catalog product row is missing."
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short set/expansion code (e.g. MKM, DSK)."
          },
          "game": {
            "type": [
              "string",
              "null"
            ],
            "description": "Game family (e.g. magic), resolved from the SKU catalog rather than the product catalog so it survives a missing product row. Null only when the card has no SKU catalog entry either.\n"
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number within the set (e.g. \"123\", \"123a\")."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which printing variant this product id represents — `base`, `etched`, or `alternative_foil`. `base` covers the normal + regular-foil printings; the other two are the finish-specific siblings TCGPlayer lists as their own products. Null when the catalog product row is missing: the marker is defined by which of that row's id arrays the id belongs to, so there is no other source for it.\n"
          },
          "hotlist": {
            "type": "boolean",
            "description": "Always true — every row of this collection is hotlisted."
          },
          "in_stock": {
            "type": "boolean",
            "description": "Whether `quantity` is greater than zero."
          },
          "quantity": {
            "type": "integer",
            "description": "Total on-hand quantity across every SKU of this card at this store, counting live locations only. 0 when the store does not stock it.\n"
          },
          "added_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the card was added to the hotlist (UTC, ISO 8601)."
          }
        }
      },
      "InventorySearchSuggestions": {
        "type": "object",
        "required": [
          "field",
          "suggestions"
        ],
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "set",
              "rarity",
              "tag"
            ]
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "value",
                "label",
                "game"
              ],
              "properties": {
                "value": {
                  "type": "string",
                  "description": "What to insert after the operator (`set:` code, stored rarity, tag slug)."
                },
                "label": {
                  "type": "string",
                  "description": "Human-readable form (set name, rarity, tag name)."
                },
                "game": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The game a set or rarity belongs to; null when it applies across games or is a tag."
                }
              }
            }
          }
        }
      },
      "PaginatedHotlistProductList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "products"
            ],
            "properties": {
              "products": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/HotlistProduct"
                }
              }
            }
          }
        ]
      },
      "PaginatedInventoryList": {
        "description": "Product-aggregated inventory list (one row per TCGPlayer product). On a sync request (`sync=true` or `after`) `inventory` holds the changed products, `removed` the products the store no longer stocks, `offset` is 0, and `total`, `total_quantity`, `total_value` and `total_stocked_skus` cover this page's `inventory` rows only.\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "inventory",
              "total_quantity",
              "total_value",
              "total_stocked_skus"
            ],
            "properties": {
              "inventory": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductInventorySummary"
                }
              },
              "removed": {
                "type": "array",
                "description": "Present only on a sync request. Products changed since `after` that are not stocked now, in any bin: drop them from your copy if you have them. A product can appear here without ever having been stocked (an unstocked card was priced).\n",
                "items": {
                  "type": "object",
                  "required": [
                    "tcgplayer_product_id"
                  ],
                  "properties": {
                    "tcgplayer_product_id": {
                      "type": "integer",
                      "format": "int64"
                    }
                  }
                }
              },
              "next_cursor": {
                "type": "string",
                "description": "Present only on a sync request. Pass it as `after` for the next page while `has_more` is true, and keep the last one to poll from later.\n"
              },
              "has_more": {
                "type": "boolean",
                "description": "Present only on a sync request. True when another page of this walk is ready now; false when the walk has caught up. A page can hold fewer than `limit` products while this is true: each change to a product counts toward `limit`, and a product changed more than once in the walk is listed once per page.\n"
              },
              "total_stocked_skus": {
                "type": "integer",
                "description": "Distinct SKUs (condition / finish / language variants) with at least one copy, across EVERY product matching the filters — the same filtered, pagination-independent set as `total` and `total_quantity`. A sold-out SKU of a matching product is not counted, and a SKU stocked in several bins counts once. Mirrored on the `X-Total-Stocked-Skus` response header.\n"
              },
              "total_quantity": {
                "type": "integer",
                "description": "Aggregate sum of `total_quantity` (physical copies) across EVERY product matching the filters — the same filtered set as `total`, ignoring `limit`/`offset` pagination. Distinct from each `inventory[]` item's own `total_quantity` (ProductInventorySummary), which is that single product's copy count. Mirrored on the `X-Total-Quantity` response header.\n"
              },
              "total_value": {
                "type": "number",
                "format": "double",
                "description": "What the stock behind `total_quantity` is worth at the store's own asking price, in USD: the sum of `quantity × retail_price` over every storage row of every product matching the filters, on the same filtered, pagination-independent set as `total` and `total_quantity`. Mirrored on the `X-Total-Value` response header.\n\nThis is a **retail** figure, not a cost basis — it is what the shelf would bring in at current prices, not what the store paid for it (that is COGS, `getProductCogs`). Copies with no `retail_price` (never priced, or carrying only a `listed_target`) contribute 0 rather than being excluded, so a store that has priced none of its stock sees 0 here while `total_quantity` still reports the copies. Catalog-search results are not holdings and report 0.\n"
              }
            }
          }
        ]
      },
      "PaginatedJobList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "jobs"
            ],
            "properties": {
              "jobs": {
                "type": "array",
                "description": "Each row carries its type's full shape: an import row is an `ImportJob` (including `tag_review_state`), an export row an `ExportJob`.\n",
                "items": {
                  "$ref": "#/components/schemas/AsyncJob"
                }
              }
            }
          }
        ]
      },
      "PaginatedLocationProductList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "products"
            ],
            "properties": {
              "products": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LocationProduct"
                }
              }
            }
          }
        ]
      },
      "PaginatedOrderList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "orders"
            ],
            "properties": {
              "orders": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OrderSummary"
                }
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Present only when the request sent `updated_after` or `after`. The position after this page: pass it as `after` for the next page, and keep the last one to poll from later. Null only when a first page found nothing. On these responses `offset` is 0 and `total` is the count of matching orders when the walk started (its first page), carried unchanged on every later page.\n"
              },
              "has_more": {
                "type": "boolean",
                "description": "Present only when the request sent `updated_after` or `after`. True when another page is ready now; false when the walk has caught up.\n"
              }
            }
          }
        ]
      },
      "ReimbursementInvoiceItem": {
        "type": "object",
        "description": "One SKU-resolved line on a Reimbursement Invoice.",
        "required": [
          "item_uuid",
          "tcgplayer_sku_id",
          "quantity"
        ],
        "properties": {
          "item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The universal cross-platform variant id (from the widget's `ProductCondition_{sku}`)."
          },
          "quantity": {
            "type": "integer"
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable product line for display."
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "description": "TCGplayer storage-location code."
          },
          "discrepancy": {
            "type": [
              "integer",
              "null"
            ],
            "description": "TCGplayer's discrepancy count for the line."
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card image URL from catalog; null if the SKU is not yet in the catalog."
          },
          "position": {
            "type": "integer",
            "description": "The line's position on TCGplayer's pull sheet."
          },
          "finish": {
            "type": [
              "string",
              "null"
            ],
            "description": "The SKU's finish from the catalog (normal, foil, etched, ...); null if the SKU is not in the catalog."
          },
          "covered_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Quantity of this SKU attributed to (and pulled for) held Direct orders. Null until the RI is fulfilled: it is derived from the order links the fulfill action writes, so there is nothing to attribute before then.\n"
          },
          "in_catalog": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the SKU resolves in our catalog (global_identifiers)."
          },
          "coverage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "covered",
              "short",
              "unmatched",
              "uncatalogued",
              null
            ],
            "description": "The item's coverage classification (see ReimbursementItemCoverage). Null until the RI is fulfilled, for the same reason as covered_quantity — do not read it as `unmatched`. `in_catalog` is populated throughout.\n"
          },
          "missing_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Copies of this line the pull did not find: the line's quantity minus the copies picked on the run that settled the RI. Counts partial finds and lines with no stock to route, not only stops the picker marked missing. Independent of `coverage`, which is about held Direct sales, not the shelf. Null when the RI was not pulled through a pick run (still picking, or settled with the no-picking fulfill).\n"
          },
          "missing_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The picker's notes on this line's missing stops, joined with `; `. Null when there are none.\n"
          },
          "confirmed_missing_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Copies of this line the seller confirmed missing for the packing slip (`confirmReimbursementMissing`), printed as `-N` in its Notes cell. Null until the invoice's missing counts are confirmed.\n"
          }
        }
      },
      "ReimbursementRatesRequest": {
        "type": "object",
        "description": "Optional overrides for the RI parcel rate-shop. The destination is never one of them — it is derived from the RI's tier server-side.\n",
        "properties": {
          "parcel": {
            "$ref": "#/components/schemas/Parcel"
          },
          "from_address": {
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "ReimbursementRatesResponse": {
        "type": "object",
        "required": [
          "ri_uuid",
          "rates",
          "from_address",
          "to_address",
          "parcel"
        ],
        "properties": {
          "ri_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "easypost_shipment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Legacy field; null for ShipStation and Pitney Bowes. Each EasyPost rate_id carries its own."
          },
          "shipping_provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ]
          },
          "rates": {
            "type": "array",
            "description": "Real carrier rates only. Unlike the order-scoped rate list this carries no synthetic stamp or pickup options: neither can send this parcel, and offering an option the purchase would refuse is worse than not offering it.\n",
            "items": {
              "$ref": "#/components/schemas/ShippingRate"
            }
          },
          "from_address": {
            "$ref": "#/components/schemas/Address"
          },
          "to_address": {
            "$ref": "#/components/schemas/Address"
          },
          "parcel": {
            "$ref": "#/components/schemas/Parcel"
          }
        }
      },
      "ReimbursementLabelRequest": {
        "type": "object",
        "required": [
          "rate_id"
        ],
        "properties": {
          "rate_id": {
            "type": "string",
            "description": "The selected rate_id from getReimbursementShippingRates (opaque)."
          },
          "shipping_provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "description": "The carrier the rate was shopped under, echoed back. Defaults to easypost."
          },
          "easypost_shipment_id": {
            "type": "string",
            "description": "Only consulted when the rate_id carries no shipment of its own. A composite EasyPost rate_id is authoritative over it. Omit for ShipStation and Pitney Bowes.\n"
          },
          "label_format": {
            "$ref": "#/components/schemas/LabelFormat"
          },
          "from_address": {
            "$ref": "#/components/schemas/Address"
          },
          "parcel": {
            "$ref": "#/components/schemas/Parcel"
          }
        }
      },
      "ReimbursementDestination": {
        "type": "object",
        "description": "Where a Direct RI's parcel is shipped. A constant keyed on the RI's tier, not a stored or configurable value — see `ReimbursementInvoice.hub_destination`.\n",
        "required": [
          "name",
          "line1",
          "city",
          "state",
          "zip_code",
          "country"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Recipient line, e.g. `TCGplayer RI - PRF`. The only part that varies by tier."
          },
          "line1": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zip_code": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "ReimbursementHubTrackingRequest": {
        "type": "object",
        "description": "The seller's outbound parcel for an RI. Both fields optional, and a key the body omits is left unchanged. An empty or whitespace-only `tracking_number` clears the pair, which is the undo for a mistyped number — that blank is the only thing that clears.\n",
        "properties": {
          "tracking_number": {
            "type": "string",
            "maxLength": 200,
            "description": "The tracking code for the one parcel carrying this RI's whole pull sheet. Recorded on the RI; nothing is pushed to TCGplayer, which has no write API for it, so the seller still marks the batch shipped on TCGplayer's site.\n"
          },
          "tracking_company": {
            "type": "string",
            "maxLength": 200,
            "description": "Carrier for `tracking_number`. Ignored when the RI ends up with no number, since a carrier on its own describes no parcel.\n"
          }
        }
      },
      "ReimbursementMissingConfirmationRequest": {
        "type": "object",
        "description": "The seller's final missing counts. Lines not listed are saved as 0.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "item_uuid",
                "missing_quantity"
              ],
              "properties": {
                "item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "missing_quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Copies missing, 0 to the line's `quantity`."
                }
              }
            }
          }
        }
      },
      "ReimbursementInvoice": {
        "type": "object",
        "description": "A TCGplayer Direct Reimbursement Invoice (the pull sheet).",
        "required": [
          "ri_uuid",
          "ri_id",
          "reim_order_id",
          "tier",
          "status",
          "tcg_url",
          "generated_at",
          "is_read",
          "is_open",
          "is_fulfilled",
          "settle_job"
        ],
        "properties": {
          "ri_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_id": {
            "type": "string",
            "description": "TCGplayer's self-describing id, e.g. `R20260708-9605b6b9-PRF-001`."
          },
          "reim_order_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGplayer's internal numeric id."
          },
          "tier": {
            "type": "string",
            "enum": [
              "PRF",
              "STD",
              "RMV"
            ]
          },
          "status": {
            "type": "string",
            "description": "Scraped from the detail page (e.g. OPEN, SHIPPED, RECEIVED, COMPLETED)."
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The detail page's tracking number as TCGplayer has it: the seller's outbound parcel, whoever entered it. Refreshed on every re-scan, so it is TCGplayer's copy, not ours; once a push succeeds, the next scan reads the pushed `hub_tracking_number` back here.\n"
          },
          "hub_tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The parcel the seller shipped to TCGplayer for this RI (#2002), set via `setReimbursementHubTracking` or by buying the RI's label. The Direct counterpart of what a CardTrader Zero invoice records for its hub leg. Sent to TCGplayer whenever it is set (#1897).\n"
          },
          "hub_tracking_company": {
            "type": [
              "string",
              "null"
            ],
            "description": "The carrier for `hub_tracking_number`. Null whenever that is null."
          },
          "hub_tracking_pushed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When TCGplayer accepted the current `hub_tracking_number` (#1897). Null before any attempt, after a refused one, and whenever the number changes.\n"
          },
          "hub_tracking_push_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why TCGplayer did not take the current `hub_tracking_number`, e.g. its own \"We cannot identify tracking number ...\" or an expired TCGplayer session. Null on success and whenever the number changes.\n"
          },
          "missing_confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the missing counts for the packing slip were last confirmed; null before the first."
          },
          "hub_destination": {
            "description": "Where this RI's parcel goes, **derived from `tier`** rather than stored, so it cannot drift from the id the RI is named by. Every tier ships to the same building and only the recipient line differs, which is why this is neither store config nor an operator-facing choice — asking a seller to re-pick what the id already states only creates a way to send the PRF batch to the STD line.\nRender it read-only next to the tracking field so the operator can check it against the label. Null only for a tier we have no address for, which the tier enum makes unreachable today.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReimbursementDestination"
              },
              {
                "type": "null"
              }
            ]
          },
          "tcg_url": {
            "type": "string",
            "description": "Deep link to the TCGplayer detail page."
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "first_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "notified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "hl_read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "is_read": {
            "type": "boolean"
          },
          "is_open": {
            "type": "boolean",
            "description": "True while the status is OPEN (the 24-hour ship clock is running)."
          },
          "fulfilled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the seller fulfilled the RI (pulled + shipped the batch). Null until fulfilled."
          },
          "fulfilled_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The user who fulfilled the RI."
          },
          "is_fulfilled": {
            "type": "boolean",
            "description": "True once the RI has been fulfilled (physical pull applied, covered orders shipped)."
          },
          "settle_job": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RiSettleJob"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest background fulfill/unfulfill job, or null if none has run."
          }
        }
      },
      "RiSettleJob": {
        "type": "object",
        "description": "Background fulfill/unfulfill job for a Reimbursement Invoice (#2977). `queued` and `running` are in progress; poll the RI detail until `succeeded` or `failed`. `failed` is final (the worker does not retry it); a new request replaces it. A `queued`/`running` job older than 10 minutes is dead and is reported as `failed` with `error_code` `stale`. `error_code` says why a job failed; key client copy on it, never on the `error` text.\n",
        "required": [
          "kind",
          "state",
          "requested_at",
          "requested_by",
          "started_at",
          "finished_at",
          "error",
          "error_code",
          "result"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "fulfill",
              "unfulfill"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "requested_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The backend's own wording of the failure, for logs and support. Null for `worker_error` (the raw exception stays server-side).\n"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "stale",
              "pick_run_active",
              "at_cardchaos",
              "enqueue_failed",
              "holding_settle_unsupported",
              "prepull_run_active",
              "worker_error",
              null
            ],
            "description": "Why the job failed, null unless `state` is `failed`. `stale`: it did not finish; request again. `pick_run_active`: an RI pick run holds the RI; finish or cancel it, then request again. `at_cardchaos`: the RI is queued in CardChaos; pick it there. `enqueue_failed`: it could not be queued; request again. `holding_settle_unsupported`: written only by jobs that ran before the fulfill drained holding (the store had Direct cards pre-pulled into holding); request again. `prepull_run_active`: a Direct pre-pull run is open; finish or cancel it, then request again. `worker_error`: the worker raised; request again.\n"
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "description": "Counts for the completion message. Fulfill: `orders_shipped`, `coverage` (same shape as ReimbursementFulfillmentResult.coverage), `already_fulfilled` and `holding`. Unfulfill: `orders_reopened`, `was_fulfilled` and `holding`. Null until the job succeeds. A job that found the work already done sets its flag and counts 0. The two flags are absent on results recorded before they existed; read absent as \"the job did the work\".\n",
            "properties": {
              "orders_shipped": {
                "type": "integer"
              },
              "orders_reopened": {
                "type": "integer"
              },
              "coverage": {
                "$ref": "#/components/schemas/ReimbursementCoverageSummary"
              },
              "already_fulfilled": {
                "type": "boolean",
                "description": "The RI was already fulfilled when the job ran, so nothing changed."
              },
              "was_fulfilled": {
                "type": "boolean",
                "description": "False when the RI was not fulfilled when the job ran, so nothing was reversed."
              },
              "holding": {
                "type": "array",
                "description": "Fulfill: the copies the job took from the Direct holding box; unfulfill: the copies it put back into it, per SKU and holding bin. Tell the operator to gather these from (or return these to) that bin rather than the shelf. Empty with holding off or when nothing was moved; absent on results recorded before it existed.\n",
                "items": {
                  "$ref": "#/components/schemas/HoldingCopies"
                }
              }
            }
          }
        }
      },
      "RiSettleJobResponse": {
        "type": "object",
        "required": [
          "settle_job"
        ],
        "properties": {
          "settle_job": {
            "$ref": "#/components/schemas/RiSettleJob"
          }
        }
      },
      "ReimbursementInvoiceDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ReimbursementInvoice"
          },
          {
            "type": "object",
            "required": [
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReimbursementInvoiceItem"
                }
              },
              "hub_shipment": {
                "description": "The label bought for this invoice's parcel, or null when none is live. Carried here so the seller can reprint it after the buy dialog has closed -- `label_url` was otherwise unreachable the moment it did.\nA voided label is excluded rather than returned with `voided: true`: its postage is refunded, and reprinting it would put a dead barcode on a real box.\n",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Shipment"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "coverage": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ReimbursementCoverageSummary"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Null until the RI is fulfilled — see ReimbursementInvoiceItem.coverage."
              },
              "pull": {
                "description": "What the pick run that settled this RI failed to find, rolled up from each item's `missing_quantity`. Null when the RI was not pulled through a pick run.\n",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ReimbursementPullSummary"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        ]
      },
      "ReimbursementPullSummary": {
        "type": "object",
        "description": "The settling pick run's shortfall against the RI.",
        "required": [
          "run_uuid",
          "missing_quantity",
          "missing_lines"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The pick run that settled the RI."
          },
          "missing_quantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Total copies not found, across every line."
          },
          "missing_lines": {
            "type": "integer",
            "minimum": 0,
            "description": "Lines with at least one copy not found."
          }
        }
      },
      "FulfillmentRunMissing": {
        "type": "object",
        "description": "What a ready_to_pack order run failed to pull: per order line, the copies asked for minus the copies picked. A copy that came up short at one bin and was then picked at another bin, or replaced by a substitute, is not missing. Copies refunded or cancelled after the run started still count, flagged in `refunded`.\n",
        "required": [
          "cards",
          "lines",
          "orders",
          "refunded_cards",
          "items"
        ],
        "properties": {
          "cards": {
            "type": "integer",
            "minimum": 0,
            "description": "Total copies not pulled, across every line."
          },
          "lines": {
            "type": "integer",
            "minimum": 0,
            "description": "Order lines with at least one copy not pulled."
          },
          "orders": {
            "type": "integer",
            "minimum": 0,
            "description": "Orders with at least one short line."
          },
          "refunded_cards": {
            "type": "integer",
            "minimum": 0,
            "description": "Of `cards`, how many were refunded or cancelled since the run started."
          },
          "items": {
            "type": "array",
            "description": "Short lines only, ordered by marketplace order id then card name.",
            "items": {
              "$ref": "#/components/schemas/FulfillmentRunMissingItem"
            }
          }
        }
      },
      "FulfillmentRunMissingItem": {
        "type": "object",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "order_item_uuid",
          "tcgplayer_sku_id",
          "card_name",
          "set_name",
          "condition",
          "finish",
          "asked",
          "picked",
          "missing",
          "refunded",
          "notes"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "order_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "asked": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies the run had to pull for this line, including any refunded since it started."
          },
          "picked": {
            "type": "integer",
            "minimum": 0
          },
          "missing": {
            "type": "integer",
            "minimum": 1
          },
          "refunded": {
            "type": "integer",
            "minimum": 0,
            "description": "Of `missing`, copies refunded or cancelled since the run started."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The picker's notes from marking the line's stops missing, joined with \"; \"."
          }
        }
      },
      "ReimbursementInvoiceList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "reimbursement_invoices",
              "unread",
              "open"
            ],
            "properties": {
              "unread": {
                "type": "integer",
                "description": "Count of RIs the store has not marked read."
              },
              "open": {
                "type": "integer",
                "description": "Count of RIs still in OPEN status."
              },
              "reimbursement_invoices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReimbursementInvoice"
                }
              }
            }
          }
        ]
      },
      "CardTraderZeroOrder": {
        "type": "object",
        "description": "One individual CardTrader Zero sale. Informational — the store never picks or ships these one by one; the cards leave in the weekly consolidated parcel represented by a `CardTraderZeroInvoice`.\n",
        "required": [
          "order_uuid",
          "marketplace_order_id",
          "code",
          "status",
          "item_count",
          "card_count"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": "string",
            "description": "CardTrader's numeric order id."
          },
          "code": {
            "type": "string",
            "description": "CardTrader's human-facing order code, e.g. `20260813ahiosm`."
          },
          "cardtrader_state": {
            "type": [
              "string",
              "null"
            ],
            "description": "CardTrader's own state. `hub_pending` — sold, awaiting consolidation into a future invoice. `closed` — already folded into an invoice.\n"
          },
          "status": {
            "type": "string",
            "description": "Always `cardtrader_zero` (the held status) for these."
          },
          "ordered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "order_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal as a string. A consolidated sale reads `0.00`: CardTrader moves its value onto the invoice when it closes the sale.\n"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_order_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "item_count": {
            "type": "integer"
          },
          "card_count": {
            "type": "integer",
            "description": "Sum of line quantities (cards, not lines)."
          }
        }
      },
      "CardTraderZeroOrderList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "orders"
            ],
            "properties": {
              "orders": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardTraderZeroOrder"
                }
              }
            }
          }
        ]
      },
      "CardTraderZeroInvoice": {
        "type": "object",
        "description": "A weekly consolidated CardTrader Zero invoice — the pull sheet for one hub parcel, carrying the items of every Zero sale CardTrader closed into it.\n",
        "required": [
          "invoice_order_uuid",
          "marketplace_order_id",
          "code",
          "status",
          "is_fulfilled",
          "item_count",
          "card_count"
        ],
        "properties": {
          "invoice_order_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The invoice's `order_uuid` — it is a real order, not a separate entity."
          },
          "marketplace_order_id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "description": "CardTrader's human-facing code, e.g. `20260813ahiosm`."
          },
          "cardtrader_state": {
            "type": [
              "string",
              "null"
            ],
            "description": "CardTrader's own state; `paid` while the parcel is owed to the hub."
          },
          "status": {
            "type": "string",
            "enum": [
              "cardtrader_zero_invoice",
              "shipped"
            ],
            "description": "`cardtrader_zero_invoice` while awaiting fulfillment, `shipped` once settled.\n"
          },
          "is_fulfilled": {
            "type": "boolean"
          },
          "ordered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "order_total": {
            "type": [
              "string",
              "null"
            ],
            "description": "Decimal as a string."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_order_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "hub_tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The parcel the seller ships to CardTrader's hub, set either by typing a number in or by buying a label for it. Named to match what a Direct RI calls the same leg; on this row it is unambiguous, since an invoice has exactly one parcel and it only ever goes one way.\n"
          },
          "hub_tracking_company": {
            "type": [
              "string",
              "null"
            ],
            "description": "The carrier for `hub_tracking_number`."
          },
          "item_count": {
            "type": "integer"
          },
          "card_count": {
            "type": "integer"
          }
        }
      },
      "CardTraderZeroInvoiceItem": {
        "type": "object",
        "description": "One pull line on a consolidated invoice.",
        "required": [
          "order_item_uuid",
          "quantity",
          "billable"
        ],
        "properties": {
          "order_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Null on a non-HL line that never resolved to our catalog."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Catalog product name, falling back to CardTrader's own line text."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "covered_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much of this line has been matched to held Zero sales. Below `quantity` means the invoice lists more than the store's held sales account for. Null until the invoice is settled — computed from `cardtrader_zero_invoice_links`, written only by the fulfill/settle action, so reading it beforehand would show every line as `0` regardless of what the seller actually holds.\n"
          },
          "billable": {
            "type": "boolean"
          }
        }
      },
      "CardTraderZeroInvoiceDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CardTraderZeroInvoice"
          },
          {
            "type": "object",
            "required": [
              "items"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardTraderZeroInvoiceItem"
                }
              },
              "hub_shipment": {
                "description": "The label bought for this invoice's parcel, or null when none is live. Carried here so the seller can reprint it after the buy dialog has closed -- `label_url` was otherwise unreachable the moment it did.\nA voided label is excluded rather than returned with `voided: true`: its postage is refunded, and reprinting it would put a dead barcode on a real box.\n",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Shipment"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "covered_order_count": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Distinct held sales this invoice has been matched to. Null until the invoice is settled — like `covered_quantity`, it counts `cardtrader_zero_invoice_links` rows, which only the fulfill/settle action writes, so a number before then would understate coverage as `0` rather than report it as not yet computed.\n"
              }
            }
          }
        ]
      },
      "CardTraderZeroInvoiceList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "invoices",
              "open"
            ],
            "properties": {
              "open": {
                "type": "integer",
                "description": "Count of invoices still awaiting fulfillment."
              },
              "invoices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CardTraderZeroInvoice"
                }
              }
            }
          }
        ]
      },
      "CardTraderZeroFulfillRequest": {
        "type": "object",
        "description": "Optional hub-leg tracking for the parcel going to CardTrader, supplied either as a hand-typed tracking number or as `shipment_uuid` — a label bought for the parcel through the ordinary shipping routes.\n",
        "properties": {
          "tracking_number": {
            "type": "string",
            "description": "Recorded on the invoice and pushed to CardTrader with the ship-back. CardTrader requires a tracking code before a Zero order can be marked shipped, so omitting it leaves the ship-back to fail upstream and land on `marketplace_sync_status`. Mutually exclusive with `shipment_uuid`.\n"
          },
          "tracking_company": {
            "type": "string"
          },
          "shipment_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "A shipping label bought for the hub parcel through `purchaseShippingLabel` on the **invoice's own** order_uuid, used instead of typing a tracking number in. That route rates and buys against the invoice order's ship-to address, which for a CardTrader Zero invoice is CardTrader's hub, so no separate destination has to be supplied anywhere.\nThe tracking number and carrier are read off the named shipment. It must be a live (non-voided) shipment on this invoice; otherwise the request is refused 422 `hub_label_not_found`. Sending it together with `tracking_number` is refused 422 `hub_tracking_conflict` rather than one silently winning.\nOmitting both fields falls back to the invoice's own live shipment if it has one, so buying a label and then shipping works without plumbing this id through. With no label and no typed tracking, the parcel ships untracked as before.\n"
          },
          "allow_uncovered": {
            "type": "boolean",
            "default": false,
            "description": "Ship the invoice even though the pick left lines uncovered (`shipFulfillmentRun` only). Without it such a ship is refused 409 `zero_invoice_not_settled`; this is the operator confirming the parcel goes short. The shortfall is recorded on the invoice's status history and the uncovered held sales stay held.\n"
          }
        }
      },
      "CardTraderZeroFulfillmentItem": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "invoice_quantity",
          "covered_quantity",
          "pulled_quantity",
          "coverage"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "invoice_quantity": {
            "type": "integer"
          },
          "covered_quantity": {
            "type": "integer"
          },
          "pulled_quantity": {
            "type": "integer",
            "description": "How many copies the shelf could actually cover; below `covered_quantity` means oversell."
          },
          "returned_quantity": {
            "type": "integer",
            "description": "Pick-run path only. Copies the picker pulled that no held sale turned out to cover, put back on the shelf — the operator re-shelves them. Always 0 on the FIFO `fulfill` path, which pulls only what it has already covered.\n"
          },
          "coverage": {
            "type": "string",
            "enum": [
              "covered",
              "short",
              "unmatched"
            ]
          }
        }
      },
      "CardTraderZeroUncoveredLine": {
        "type": "object",
        "description": "One invoice line the pick could not fully cover. `held_sale_remaining` is what separates a line a further pass could still settle from one nothing can — only the former refuses a ship.\n",
        "required": [
          "tcgplayer_sku_id",
          "invoice_quantity",
          "covered_quantity",
          "uncovered_quantity",
          "held_sale_remaining"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "invoice_quantity": {
            "type": "integer"
          },
          "covered_quantity": {
            "type": "integer"
          },
          "uncovered_quantity": {
            "type": "integer"
          },
          "held_sale_remaining": {
            "type": "integer",
            "description": "Units of this SKU still sitting on uncovered held Zero sales. Above zero means a further pass could cover the line, which is what makes an unforced ship refuse.\n"
          }
        }
      },
      "CardTraderZeroFulfillmentSummary": {
        "type": "object",
        "required": [
          "invoice_order_uuid",
          "marketplace_order_id",
          "code",
          "status",
          "already_fulfilled"
        ],
        "properties": {
          "invoice_order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "already_fulfilled": {
            "type": "boolean",
            "description": "True when the invoice was already settled and this call changed nothing."
          },
          "tracking_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The hub leg the parcel shipped under, read off the invoice rather than echoed from the request — it may have come from a label bought via `shipment_uuid` rather than being typed in. Null when the parcel shipped untracked.\n"
          },
          "tracking_company": {
            "type": [
              "string",
              "null"
            ],
            "description": "The carrier for `tracking_number`, from the bought label when there was one."
          },
          "fully_settled": {
            "type": "boolean",
            "description": "Whether every line was covered. False on a parcel shipped short via `allow_uncovered`, in which case `uncovered_lines` says what was missing.\n"
          },
          "uncovered_lines": {
            "type": "array",
            "description": "Per-SKU shortfall on a parcel shipped short. Empty when everything was covered. The same shape appears in the 409 `zero_invoice_not_settled` body that refuses such a ship before it happens.\n",
            "items": {
              "$ref": "#/components/schemas/CardTraderZeroUncoveredLine"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardTraderZeroFulfillmentItem"
            }
          },
          "orders_shipped": {
            "type": "array",
            "description": "The held Zero sales this fulfillment shipped.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "orders_reopened": {
            "type": "array",
            "description": "On unfulfill, the sales reverted to the held status.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "holding": {
            "type": "array",
            "description": "Fulfill: the copies this call took from the Zero holding box; unfulfill: the copies it put back into it, per SKU and holding bin. Gather these from (or return these to) that bin rather than the shelf. Empty with holding off, on an already-fulfilled re-report, or when nothing was moved.\n",
            "items": {
              "$ref": "#/components/schemas/HoldingCopies"
            }
          }
        }
      },
      "PullAlert": {
        "type": "object",
        "description": "A \"pull this card now\" nudge raised when an online sale removes a copy that is physically present in a customer-browsable display case (double-sell guard, #973).\n",
        "required": [
          "alert_uuid",
          "status",
          "quantity",
          "marketplace",
          "tcgplayer_sku_id",
          "order_uuid",
          "location_uuid",
          "location_name",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "alert_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "pulled",
              "dismissed",
              "canceled"
            ]
          },
          "quantity": {
            "type": "integer",
            "description": "Copies sold of this SKU on the order."
          },
          "marketplace": {
            "type": "string",
            "description": "The marketplace the online sale came from."
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "order_status": {
            "type": "string",
            "description": "Current status of the originating order."
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_order_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_name": {
            "type": "string",
            "description": "Human name of the flagged display case (e.g. \"Case A\")."
          },
          "location_custom_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Materialized breadcrumb path to the location."
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolved_by_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PullAlertList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "pull_alerts"
            ],
            "properties": {
              "pull_alerts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PullAlert"
                }
              }
            }
          }
        ]
      },
      "ReimbursementItemCoverage": {
        "type": "object",
        "description": "How one RI line item reconciled against the store's held Direct orders.",
        "required": [
          "tcgplayer_sku_id",
          "ri_quantity",
          "covered_quantity",
          "in_catalog",
          "coverage"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "ri_quantity": {
            "type": "integer",
            "description": "Quantity the RI lists for this SKU."
          },
          "covered_quantity": {
            "type": "integer",
            "description": "Quantity attributed to (and pulled for) held Direct orders."
          },
          "in_catalog": {
            "type": "boolean",
            "description": "Whether the SKU resolves in our catalog (global_identifiers)."
          },
          "coverage": {
            "type": "string",
            "enum": [
              "covered",
              "short",
              "unmatched",
              "uncatalogued"
            ],
            "description": "`covered` — fully covered; `short` — held orders cover fewer copies than the RI lists (drift); `unmatched` — in catalog but no held Direct order carries it; `uncatalogued` — a SKU TCGplayer lists that isn't in our catalog.\n"
          }
        }
      },
      "ReimbursementCoverageSummary": {
        "type": "object",
        "description": "Roll-up of RI line items by coverage classification.",
        "required": [
          "covered",
          "short",
          "unmatched",
          "uncatalogued"
        ],
        "properties": {
          "covered": {
            "type": "integer"
          },
          "short": {
            "type": "integer"
          },
          "unmatched": {
            "type": "integer"
          },
          "uncatalogued": {
            "type": "integer"
          }
        }
      },
      "ReimbursementFulfillmentResult": {
        "type": "object",
        "description": "The outcome of fulfilling a Reimbursement Invoice.",
        "required": [
          "ri_uuid",
          "ri_id",
          "status",
          "already_fulfilled",
          "orders_shipped",
          "items",
          "coverage"
        ],
        "properties": {
          "ri_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "The RI's scraped status (unchanged by fulfillment)."
          },
          "fulfilled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "fulfilled_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "already_fulfilled": {
            "type": "boolean",
            "description": "True when the RI was already fulfilled — the call was an idempotent no-op."
          },
          "orders_shipped": {
            "type": "array",
            "description": "Held Direct order uuids this RI's fulfillment transitioned to `shipped`.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReimbursementItemCoverage"
            }
          },
          "coverage": {
            "$ref": "#/components/schemas/ReimbursementCoverageSummary"
          },
          "holding": {
            "type": "array",
            "description": "The copies this call took from the Direct holding box, per SKU and holding bin: gather these from that bin, not the shelf. Empty with holding off, on an already-fulfilled re-report, or when nothing came from holding.\n",
            "items": {
              "$ref": "#/components/schemas/HoldingCopies"
            }
          }
        }
      },
      "ReimbursementUnfulfillResult": {
        "type": "object",
        "description": "The outcome of reversing a Reimbursement Invoice fulfillment.",
        "required": [
          "ri_uuid",
          "ri_id",
          "was_fulfilled",
          "orders_reopened"
        ],
        "properties": {
          "ri_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_id": {
            "type": "string"
          },
          "was_fulfilled": {
            "type": "boolean",
            "description": "False when the RI wasn't fulfilled — the call was a no-op."
          },
          "orders_reopened": {
            "type": "array",
            "description": "Direct order uuids reverted from `shipped` back to `direct` (held).",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "holding": {
            "type": "array",
            "description": "The copies this call put back into the Direct holding box, per SKU and holding bin: return these to that bin; the rest of the RI goes back to the shelf. Empty with holding off or when nothing had come from holding.\n",
            "items": {
              "$ref": "#/components/schemas/HoldingCopies"
            }
          }
        }
      },
      "HoldingCopies": {
        "type": "object",
        "description": "Copies of one SKU taken from, or put back into, one holding bin by a manual fulfill or unfulfill (holding-box pre-pull).\n",
        "required": [
          "tcgplayer_sku_id",
          "quantity",
          "location_uuid",
          "bin_name"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The holding bin."
          },
          "bin_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The holding bin's name, as the operator sees it."
          }
        }
      },
      "ReimbursementCoverageGap": {
        "type": "object",
        "description": "A line item on a fulfilled RI that didn't fully reconcile against held orders.",
        "required": [
          "ri_uuid",
          "ri_id",
          "tcgplayer_sku_id",
          "ri_quantity",
          "covered_quantity",
          "coverage"
        ],
        "properties": {
          "ri_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "ri_id": {
            "type": "string"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "ri_quantity": {
            "type": "integer"
          },
          "covered_quantity": {
            "type": "integer"
          },
          "coverage": {
            "type": "string",
            "enum": [
              "short",
              "unmatched",
              "uncatalogued"
            ]
          },
          "product_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReimbursementStuckHold": {
        "type": "object",
        "description": "A held Direct order reserved but not yet pulled onto any RI, past the age threshold.",
        "required": [
          "order_uuid",
          "age_days"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ordered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "age_days": {
            "type": "integer"
          }
        }
      },
      "ReimbursementReview": {
        "type": "object",
        "description": "The store's Direct review/exceptions surface — coverage gaps + stuck holds + reserve drift.",
        "required": [
          "coverage_gaps",
          "stuck_holds",
          "reserve_drift_qty",
          "holding_drift",
          "stuck_hold_days"
        ],
        "properties": {
          "coverage_gaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReimbursementCoverageGap"
            }
          },
          "stuck_holds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReimbursementStuckHold"
            }
          },
          "reserve_drift_qty": {
            "type": "integer",
            "description": "Total committed-but-unpulled quantity across all held Direct orders."
          },
          "holding_drift": {
            "type": "array",
            "description": "Holding (container, SKU) pairs whose stock disagrees with their open commitments; empty when consistent.",
            "items": {
              "type": "object",
              "required": [
                "container_uuid",
                "tcgplayer_sku_id",
                "on_hand",
                "committed"
              ],
              "properties": {
                "container_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "tcgplayer_sku_id": {
                  "type": "integer",
                  "format": "int64"
                },
                "on_hand": {
                  "type": "integer",
                  "description": "Copies physically in the container's holding bins."
                },
                "committed": {
                  "type": "integer",
                  "description": "Copies owed to open holding commitments."
                }
              }
            }
          },
          "stuck_hold_days": {
            "type": "integer",
            "description": "Age threshold (days) past which a held Direct order counts as stuck."
          }
        }
      },
      "PaginatedProductSalesList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "sales"
            ],
            "properties": {
              "sales": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductSale"
                }
              }
            }
          }
        ]
      },
      "BuylistOfferRebuildStatus": {
        "type": "string",
        "enum": [
          "running",
          "completed",
          "failed",
          "skipped"
        ],
        "description": "Lifecycle of one offer-rebuild run. `skipped` means a concurrent rebuild held the store's lock, so this attempt did no work — not a failure, but its own delta waited for the next rebuild.\n"
      },
      "BuylistOfferRebuildJobType": {
        "type": "string",
        "enum": [
          "rebuild",
          "rebuild_game",
          "product_refresh"
        ],
        "description": "`rebuild` is the request to recompute the store's whole buy list. It does no work itself — it plans the run and enqueues one `rebuild_game` per game the store needs, so each game's catalog scan gets its own worker instead of sharing one with every other game. `rebuild_game` is one of those games, where the row counts and the minutes of work live. `product_refresh` re-derives one card's rows (milliseconds), which is what a hotlist toggle triggers.\n"
      },
      "BuylistOfferRebuildTrigger": {
        "type": "string",
        "enum": [
          "rule_change",
          "price_lock",
          "schedule",
          "manual",
          "hotlist_toggle",
          "unknown"
        ],
        "description": "What asked for the rebuild — `price_lock` an offer price lock/unlock, `schedule` the hourly sweep on the store's `repricing_hours`, `manual` a sys-admin forced rebuild, `hotlist_toggle` a card's hotlist membership changing. `unknown` is a run that could not be attributed, which is every run recorded before this was tracked. `rule_change` stays a valid value for older runs but is no longer produced — a buylist rule edit no longer triggers its own rebuild, since that let any store role force the same whole-catalog rebuild that the administrator-only `rebuildBuylistOffers` operation exists to gate. A rule edit now surfaces at the store's next hourly sweep.\n"
      },
      "BuylistOfferRebuildRun": {
        "type": "object",
        "description": "One rebuild of the store's buylist offer projection.",
        "required": [
          "run_uuid",
          "job_type",
          "trigger_source",
          "status",
          "started_at"
        ],
        "properties": {
          "run_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "job_type": {
            "$ref": "#/components/schemas/BuylistOfferRebuildJobType"
          },
          "trigger_source": {
            "$ref": "#/components/schemas/BuylistOfferRebuildTrigger"
          },
          "status": {
            "$ref": "#/components/schemas/BuylistOfferRebuildStatus"
          },
          "game": {
            "type": [
              "string",
              "null"
            ],
            "description": "The game a `rebuild_game` run covered. Null on the other job types.\n"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "The language a `rebuild_game` run covered when its game is rebuilt one language at a time (Magic). Null when the run covered the whole game, and on the other job types.\n"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The card a `product_refresh` re-derived. Null on a whole-catalog rebuild.\n"
          },
          "offers_written": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Offer rows this run published. Null when the run wrote none — still running, skipped, or failed, or a `rebuild` run, which only plans the per-game fan-out — which is distinct from a completed run that wrote 0, the tell that the store's rules currently buy nothing.\n"
          },
          "games_enqueued": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many games this `rebuild` handed out. A game rebuilt one language at a time (Magic) has one `rebuild_game` run per language underneath it, each naming its `language`. Null on the other job types.\n"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the worker picked the run up."
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Null while the run is still in flight."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null while the run is still in flight."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable snake_case code for why a `failed` run failed (`offer_rebuild_timed_out`, `offer_rebuild_busy`, `offer_rebuild_price_rejected`, `offer_rebuild_database_unavailable`, `offer_rebuild_stranded`, `offer_rebuild_failed_unexpected`). A run recorded before codes existed reads as `offer_rebuild_failed_unexpected`, or `offer_rebuild_stranded` when it was reaped. Null otherwise.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-facing explanation of why a `failed` run failed. Plain language, safe to show to the store; never exception text. Null otherwise.\n"
          }
        }
      },
      "PaginatedBuylistOfferRebuildHistoryList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "runs"
            ],
            "properties": {
              "runs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BuylistOfferRebuildRun"
                }
              }
            }
          }
        ]
      },
      "PaginatedRepriceHistoryList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "executions"
            ],
            "properties": {
              "executions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepriceHistorySummary"
                }
              }
            }
          }
        ]
      },
      "RulesetWarning": {
        "type": "object",
        "description": "An advisory problem with a game's ruleset taken as a whole, as opposed to a single rule's syntax. Never blocks a save.\n",
        "required": [
          "code",
          "game",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "no_base_pricing_rule"
            ],
            "description": "`no_base_pricing_rule` — every enabled pricing rule for this game is scoped to a marketplace, so nothing sets the card's base price. Newly added cards are based on the first marketplace rule that matches them, and any marketplace without a rule of its own is pushed that price. A rule that prices off `CURRENT_PRICE`, or whose currency is not the store's, cannot stand in; when none can, new cards are not priced at all, and `message` says which case applies and what to change.\n"
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation, safe to show to the store owner."
          }
        }
      },
      "PaginatedRuleList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rules"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Rule"
                }
              },
              "ruleset_warnings": {
                "type": "array",
                "description": "Advisory problems with this game's ruleset as a whole. Empty when there are none. Present on the rule list and on the responses to replacing or reordering a ruleset, so the rule builder can surface them both on load and immediately after an edit.\n",
                "items": {
                  "$ref": "#/components/schemas/RulesetWarning"
                }
              }
            }
          }
        ]
      },
      "PaginatedRuleRepriceHistory": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rule_uuid",
              "changes"
            ],
            "properties": {
              "rule_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "The rule this history pertains to"
              },
              "changes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleRepriceChange"
                }
              }
            }
          }
        ]
      },
      "PaginatedShippingRuleList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rules"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ShippingRuleItem"
                }
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Advisory notes about the rules that were **just saved** — present on the write responses, absent on a plain read. A rule naming a `service_code` the store's shipping provider does not offer will never match a quoted rate, and this says so.\n\nDeliberately not a validation error: rejecting would lock a store that already holds one dead rule out of saving *any* rule until it had fixed them all. Empty when every rule is quotable, and when no carrier catalog has been fetched for the store yet.\n"
              },
              "global_rules": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GlobalShippingRule"
                },
                "description": "HippoLink's global rules for the marketplaces this store has an active connection to. Present on a read (`listShippingRules`), absent on the write responses. Not editable and not part of `rules`, `total` or the ETag.\n"
              }
            }
          }
        ]
      },
      "GlobalShippingRule": {
        "type": "object",
        "description": "A HippoLink global shipping rule: a marketplace requirement HippoLink enforces on every store connected to that marketplace. Read-only, never stored, and not part of rule evaluation; the rate shop and the ship gates apply it directly.\n",
        "required": [
          "key",
          "name",
          "description",
          "marketplace",
          "requirement",
          "conditions",
          "enforces"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "tcgplayer_expedited_tracking",
              "tcgplayer_tracking",
              "tcgplayer_signature",
              "mana_pool_tracking",
              "misprint_tracking",
              "snapcaster_tracking",
              "sick_deals_tracking"
            ]
          },
          "name": {
            "type": "string",
            "example": "TCGplayer Required Tracked Shipping Rules"
          },
          "description": {
            "type": "string",
            "example": "TCGplayer requires tracking on orders of $50.00 or more. HippoLink makes sure these orders ship with a tracking number."
          },
          "marketplace": {
            "type": "string",
            "example": "TCGPLAYER"
          },
          "requirement": {
            "type": "string",
            "enum": [
              "tracking",
              "signature"
            ]
          },
          "conditions": {
            "type": "array",
            "description": "When the rule applies, as display text for the read-only detail view.",
            "items": {
              "$ref": "#/components/schemas/GlobalShippingRuleCondition"
            }
          },
          "enforces": {
            "type": "array",
            "description": "What HippoLink does to enforce the rule, as display text.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GlobalShippingRuleCondition": {
        "type": "object",
        "required": [
          "field",
          "operator",
          "value"
        ],
        "properties": {
          "field": {
            "type": "string",
            "example": "Order total"
          },
          "operator": {
            "type": "string",
            "example": "is at least"
          },
          "value": {
            "type": "string",
            "example": "$50.00"
          }
        }
      },
      "PaginatedSkuRepriceHistory": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "tcgplayer_sku_id",
              "changes"
            ],
            "properties": {
              "tcgplayer_sku_id": {
                "type": "integer",
                "format": "int64",
                "description": "The SKU this history pertains to"
              },
              "changes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SkuRepriceChange"
                }
              }
            }
          }
        ]
      },
      "PaginatedSkuSalesRollupList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "skus"
            ],
            "properties": {
              "skus": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SkuSalesRollupRow"
                }
              }
            }
          }
        ]
      },
      "MarketplaceSyncRejection": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "marketplace",
          "reason_code",
          "first_seen_at",
          "last_seen_at"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU the marketplace refused to list."
          },
          "marketplace": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "EBAY",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER",
              "LIGHTSPEED",
              "WHATNOT",
              "SICK_DEALS"
            ],
            "description": "The marketplace that rejected the SKU (UPPERCASE platform code)."
          },
          "reason_code": {
            "type": "string",
            "enum": [
              "product_not_found",
              "duplicate",
              "unpriced",
              "validation",
              "price_drift",
              "unknown"
            ],
            "description": "Why the SKU was rejected."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable explanation (e.g. the marketplace's error body)."
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this rejection was first recorded."
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this rejection was most recently re-observed."
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the SKU last synced cleanly, clearing the rejection (null if still open)."
          }
        }
      },
      "MarketplaceHeldPushReason": {
        "type": "string",
        "enum": [
          "daily_creation_cap",
          "creation_queued",
          "setup_incomplete",
          "ebay_selling_limit",
          "ebay_quota",
          "ebay_api_budget",
          "ebay_free_listings_used_up",
          "ebay_fee_check_failed"
        ],
        "description": "Why a push is holding a card back. daily_creation_cap: the marketplace allows only so many new listings a day (Shopify over 50,000 variants). creation_queued: the push ran out of time and creates it next. setup_incomplete: the store has not finished the marketplace's setup. ebay_selling_limit: the eBay account reached its monthly selling limit. ebay_quota: an eBay quota that resets at the next day boundary. ebay_api_budget: HippoLink paused eBay listing calls to stay inside eBay's API limit. ebay_free_listings_used_up: the month's free eBay listings are used and the store's listing-fee setting is free listings only. ebay_fee_check_failed: eBay would not say whether listing the card costs a fee, so it was held back to be safe.\n"
      },
      "MarketplaceHeldPush": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "marketplace",
          "reason",
          "waiting_since"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "marketplace": {
            "type": "string",
            "enum": [
              "TCGPLAYER",
              "MANA_POOL",
              "CARD_TRADER",
              "SHOPIFY",
              "SQUARE",
              "CARDMARKET",
              "EBAY",
              "CARD_NEXUS",
              "MISPRINT",
              "SNAPCASTER"
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/MarketplaceHeldPushReason"
          },
          "waiting_since": {
            "type": "string",
            "format": "date-time",
            "description": "When the card first became owed a push to this marketplace."
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When HippoLink next tries it (null when it is due now)."
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the catalog has no entry for the SKU."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MarketplaceHeldPushesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "held"
            ],
            "properties": {
              "held": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MarketplaceHeldPush"
                }
              }
            }
          }
        ]
      },
      "MarketplaceSyncRejectionsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rejections"
            ],
            "properties": {
              "rejections": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MarketplaceSyncRejection"
                }
              }
            }
          }
        ]
      },
      "SkuInventoryAggregate": {
        "type": "object",
        "required": [
          "quantity",
          "quantity_visible"
        ],
        "properties": {
          "quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          }
        }
      },
      "SkuLocationBreakdown": {
        "type": "object",
        "required": [
          "location_uuid",
          "location_name",
          "slot",
          "total_quantity",
          "quantity_visible"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_name": {
            "type": "string",
            "description": "Full breadcrumb path (e.g. \"Main Shelf > Aetherdrift > S\")."
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "description": "Which of this SKU's positions in the location this entry is. 0 is the main row; a bin holding the SKU at more than one separate spot has further rows (1, 2, ...). An identity, not an order: shelf order is `sequence_index`. Pass it back as `slot` to edit this exact position.\n"
          },
          "total_quantity": {
            "type": "integer"
          },
          "quantity_visible": {
            "type": "integer"
          }
        }
      },
      "InventoryHistoryWarning": {
        "type": "object",
        "required": [
          "type",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "desync",
              "oversell"
            ]
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ManualInventoryEdit": {
        "type": "object",
        "required": [
          "audit_uuid",
          "event_time",
          "api_action",
          "result_code",
          "matched_via"
        ],
        "properties": {
          "audit_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "event_time": {
            "type": "string",
            "format": "date-time"
          },
          "api_action": {
            "type": "string",
            "description": "The routeKey that produced this edit, e.g. \"PATCH /v1/stores/{store_uuid}/inventory/{tcgplayer_sku_id}\".\n"
          },
          "result_code": {
            "type": "integer"
          },
          "actor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Actor email, or null when unresolved (e.g. a truncated audit payload)."
          },
          "matched_via": {
            "type": "string",
            "enum": [
              "path",
              "body_array",
              "bulk_delete"
            ],
            "description": "How this row was matched to the SKU: path (tcgplayer_sku_id in the route path, e.g. a single-SKU PATCH/DELETE), body_array (the SKU id was found inside a bulk PATCH/intake request's JSON array body), or bulk_delete (matched by SKU id or the SKU's product id inside a bulk-delete request body).\n"
          },
          "request_body": {
            "type": "object",
            "description": "The redacted request payload as persisted in audit_logs.request_body_redacted (method, path, query, path_params, body, caller). May be a truncation marker ({_truncated, _original_size_bytes, _preview}) for a very large bulk request.\n"
          }
        }
      },
      "ManualInventoryEditList": {
        "type": "object",
        "required": [
          "edits",
          "truncated"
        ],
        "properties": {
          "edits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManualInventoryEdit"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "True when more matching audit_log rows exist than the cap returned."
          }
        }
      },
      "OnlineSalePullAlertSummary": {
        "type": "object",
        "required": [
          "alert_uuid",
          "order_uuid",
          "tcgplayer_sku_id",
          "quantity",
          "marketplace",
          "status",
          "created_at"
        ],
        "properties": {
          "alert_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_item_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer"
          },
          "marketplace": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "pulled",
              "dismissed",
              "canceled"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SkuInventoryHistorySummary": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "aggregate",
          "locations",
          "location_sum",
          "desynced",
          "warnings",
          "manual_edits",
          "marketplace_sync_rejections",
          "marketplace_held_pushes",
          "pull_alerts"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "aggregate": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SkuInventoryAggregate"
              }
            ],
            "deprecated": true,
            "description": "Deprecated (#3856): always equal to location_sum. It used to read pricing_data's quantity columns, which are no longer maintained; marketplace quantity is derived per marketplace from bin stock.\n"
          },
          "locations": {
            "type": "array",
            "description": "One entry per storage row, in shelf order.",
            "items": {
              "$ref": "#/components/schemas/SkuLocationBreakdown"
            }
          },
          "location_sum": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SkuInventoryAggregate"
              }
            ],
            "description": "SUM(locations.total_quantity / quantity_visible) -- what the store's own inventory detail page shows."
          },
          "desynced": {
            "type": "boolean",
            "deprecated": true,
            "description": "Deprecated (#3856); always false. The desync warning is no longer emitted."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InventoryHistoryWarning"
            }
          },
          "manual_edits": {
            "$ref": "#/components/schemas/ManualInventoryEditList"
          },
          "marketplace_sync_rejections": {
            "type": "array",
            "description": "Open (unresolved) rejections only.",
            "items": {
              "$ref": "#/components/schemas/MarketplaceSyncRejection"
            }
          },
          "marketplace_held_pushes": {
            "type": "array",
            "description": "Marketplaces holding this card back on purpose, and why. Not rejections. The card fields are omitted, since the summary is about this card.",
            "items": {
              "$ref": "#/components/schemas/MarketplaceHeldPush"
            }
          },
          "pull_alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnlineSalePullAlertSummary"
            }
          }
        }
      },
      "InventoryTransactionReasonCode": {
        "type": "string",
        "description": "Mirrors `schemas.models.constants.INVENTORY_TRANSACTION_REASONS`, which is the source of truth for the vocabulary.\n",
        "enum": [
          "purchase",
          "restock",
          "manual_correction",
          "import",
          "order_sale",
          "other",
          "refund_return",
          "substitution",
          "buylist_purchase",
          "shrinkage_theft",
          "shrinkage_damage",
          "shrinkage_lost",
          "shrinkage_miscount",
          "shrinkage_giveaway",
          "shrinkage_other",
          "relist",
          "import_revert",
          "pick_complete",
          "pickup_handover",
          "order_shipped",
          "pull_reversed",
          "transfer_out",
          "transfer_in",
          "kiosk_return_to_origin_out",
          "kiosk_return_to_origin_in",
          "cardchaos_lost",
          "holding_prepull_out",
          "holding_prepull_in",
          "holding_return_out",
          "holding_return_in",
          "sealed_opened",
          "sealed_unopened",
          "reidentify_out",
          "reidentify_in",
          "order_cancel_restore"
        ]
      },
      "InventoryTransactionEvent": {
        "type": "object",
        "required": [
          "transaction_uuid",
          "tcgplayer_sku_id",
          "direction",
          "reason_code",
          "quantity_before",
          "quantity_delta",
          "quantity_after",
          "source_service",
          "source_operation",
          "created_at"
        ],
        "properties": {
          "transaction_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bin's full path (\"Chaos 3 > C - 20\") when the row was written: where a card was pulled from or put away. It does not follow a later rename, move or delete of the bin. Null when the row names no bin (e.g. an order_sale, which moves no card) or its bin was deleted before the path was recorded.\n"
          },
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out",
              "adjust"
            ]
          },
          "reason_code": {
            "$ref": "#/components/schemas/InventoryTransactionReasonCode"
          },
          "quantity_before": {
            "type": "integer"
          },
          "quantity_delta": {
            "type": "integer"
          },
          "quantity_after": {
            "type": "integer"
          },
          "source_service": {
            "type": "string"
          },
          "source_operation": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_supabase_uuid": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The actor's first and last name from their account. Null when the row has no actor or the account has no name on file; show actor_email then.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "order": {
            "type": [
              "object",
              "null"
            ],
            "description": "Present only for reason_code=order_sale, when the linked order still exists.",
            "properties": {
              "order_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "order_item_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "marketplace": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "ordered_at": {
                "type": "string",
                "format": "date-time"
              },
              "order_item_quantity": {
                "type": "integer"
              },
              "order_item_unit_price": {
                "type": "number",
                "format": "double",
                "description": "The line's unit price, in `currency`."
              },
              "currency": {
                "type": "string",
                "description": "ISO 4217 currency of the order, which is not always the store's (a CAD Snapcaster sale on a USD store). Format `order_item_unit_price` with it (#4074).\n"
              },
              "oversell_detected": {
                "type": "boolean",
                "description": "True when order_item_quantity > abs(quantity_delta) -- the transaction floored the deduction at available stock, so the order recorded selling more than was actually removed.\n"
              }
            }
          },
          "unit_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Per-copy cost the stock came in at (purchase_price_at_event): the buylist line's agreed price, or the cost entered on a manual intake or import. Null on movements that carry no price, such as sales, removals and adjustments.\n"
          },
          "buylist": {
            "type": [
              "object",
              "null"
            ],
            "description": "Present only for reason_code=buylist_purchase, when the purchase that pushed the stock still exists.\n",
            "required": [
              "purchase_uuid"
            ],
            "properties": {
              "purchase_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "buylist_number": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "customer_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "accepted_by_email": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Staff member who accepted the offer."
              },
              "accepted_by_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "First and last name of the staff member who accepted the offer. Null when the account has no name on file; show accepted_by_email then.\n"
              },
              "payout_type": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "cash",
                  "credit",
                  null
                ]
              }
            }
          }
        }
      },
      "PaginatedInventoryTransactionList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CursorMeta"
          },
          {
            "type": "object",
            "required": [
              "transactions"
            ],
            "properties": {
              "transactions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InventoryTransactionEvent"
                }
              }
            }
          }
        ]
      },
      "LocationMoveEvent": {
        "type": "object",
        "required": [
          "event_uuid",
          "tcgplayer_sku_id",
          "from_location_uuid",
          "to_location_uuid",
          "quantity",
          "source",
          "created_at"
        ],
        "properties": {
          "event_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "from_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "from_location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The source bin's full path when the move was made."
          },
          "to_location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "to_location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The destination bin's full path when the move was made."
          },
          "quantity": {
            "type": "integer",
            "description": "Copies of this SKU the move took from the one bin to the other."
          },
          "source": {
            "type": "string",
            "enum": [
              "transfer",
              "move_cards",
              "merge",
              "relocation",
              "move_undo"
            ],
            "description": "What moved them: a transfer from a bin's contents, a bulk move (`move_cards`), a bin merge, a CSV or template relocation job, or the undo of a bulk move.\n"
          },
          "ref_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The move's own id where it has one: the bulk move's `move_uuid`, the relocation job, or the transfer's id. Null for a merge.\n"
          },
          "actor_supabase_uuid": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaginatedLocationMoveList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CursorMeta"
          },
          {
            "type": "object",
            "required": [
              "moves"
            ],
            "properties": {
              "moves": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LocationMoveEvent"
                }
              }
            }
          }
        ]
      },
      "PaginatedStoreList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "stores"
            ],
            "properties": {
              "stores": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoreSummary"
                }
              }
            }
          }
        ]
      },
      "PaginationMeta": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "CursorMeta": {
        "type": "object",
        "description": "Keyset (cursor) pagination metadata. Unlike PaginationMeta, there is no offset and no unconditional total: page forward with `next_cursor` until `has_more` is false. `total` appears only when the request set `count=true`.\n",
        "required": [
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean",
            "description": "True when another page exists after this one."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque token to pass as `after` for the next page. Null (or absent) on the last page, i.e. when `has_more` is false.\n"
          },
          "total": {
            "type": "integer",
            "description": "Full count of matching rows ignoring the cursor. Present only when the request set `count=true`; omitted otherwise.\n"
          }
        }
      },
      "Parcel": {
        "type": "object",
        "description": "A per-order parcel override (#3537). Which fields it needs depends on `package_type`: a `package` (the default when `package_type` is left out) needs all three dimensions and the weight; a `letter` or `flat` needs only the weight, its size being the USPS class maximum (dimensions sent with one, e.g. echoed from a rates response, are ignored). Alternatively a carrier `predefined_package` name alone. A `letter` or `flat` cannot carry a signature or insurance: with either add-on in force it is refused 422 `validation_error` on `parcel.package_type`. It is refused the same way when the order must be tracked (`tracking_required` on the rates response), because USPS letters and flats carry no tracking.\n",
        "anyOf": [
          {
            "title": "Package",
            "required": [
              "length_inches",
              "width_inches",
              "height_inches",
              "weight_ounces"
            ],
            "properties": {
              "package_type": {
                "const": "package"
              }
            }
          },
          {
            "title": "Letter or flat",
            "required": [
              "package_type",
              "weight_ounces"
            ],
            "properties": {
              "package_type": {
                "enum": [
                  "letter",
                  "flat"
                ]
              }
            }
          },
          {
            "title": "Predefined package",
            "required": [
              "predefined_package"
            ]
          }
        ],
        "properties": {
          "length_inches": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Length in inches"
          },
          "width_inches": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Width in inches"
          },
          "height_inches": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Height in inches"
          },
          "weight_ounces": {
            "type": "number",
            "format": "double",
            "exclusiveMinimum": 0,
            "maximum": 1120,
            "description": "Weight in ounces. At most 3.5 for a `letter` and 13 for a `flat`."
          },
          "package_type": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "package"
            ],
            "description": "Mail class of the override (#3537). Defaults to `package`. `letter` and `flat` take their size from the USPS class maximum.\n"
          },
          "predefined_package": {
            "type": "string",
            "description": "EasyPost predefined package name (e.g. \"FlatRateEnvelope\", \"SmallFlatRateBox\"). When set, dimensions are ignored.\n"
          }
        }
      },
      "PendingInvitation": {
        "type": "object",
        "required": [
          "invite_uuid",
          "store_uuid",
          "store_name",
          "role",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "invite_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_name": {
            "type": "string",
            "description": "Name of the store the invitation is for"
          },
          "role": {
            "$ref": "#/components/schemas/StaffRole",
            "description": "Role the user will receive upon acceptance"
          },
          "invited_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "User UUID of the person who created the invitation, or null if that user was deleted"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation was created"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the invitation expires"
          }
        }
      },
      "PlatformHealthStatus": {
        "type": "string",
        "enum": [
          "healthy",
          "degraded",
          "failing",
          "inactive"
        ]
      },
      "SlabGrading": {
        "type": "object",
        "description": "A graded slab's grading, as the inventory grid shows it (#3506).",
        "required": [
          "store_item_uuid",
          "status",
          "grader_code",
          "grader_name",
          "grade_code",
          "grade_label",
          "cert_number"
        ],
        "properties": {
          "store_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "grader_code": {
            "type": "string",
            "description": "The grading company's code, e.g. PSA."
          },
          "grader_name": {
            "type": "string",
            "description": "The grading company as the store reads it, e.g. \"Beckett (BGS)\"."
          },
          "grade_code": {
            "type": "string"
          },
          "grade_label": {
            "type": "string",
            "description": "The grade as printed on the label, e.g. \"10\" or \"Black Label 10\"."
          },
          "cert_number": {
            "type": "string",
            "description": "The certification number, as intake stored it (no spaces or hyphens)."
          },
          "base_tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The product of the card the slab holds, whose detail page shows the slab (#3528). Null for a store item with no base card.\n"
          }
        }
      },
      "ProductInventorySummary": {
        "description": "One row per TCGPlayer product the store owns, aggregated across all SKU variants (conditions/languages/finishes). Used by the inventory list endpoint. Drill into a product via `GET /v1/stores/{store_uuid}/products/{tcgplayer_product_id}/inventory` for the per-SKU breakdown.\n",
        "type": "object",
        "required": [
          "tcgplayer_product_id",
          "game",
          "product_name",
          "set_name",
          "total_quantity",
          "total_quantity_visible",
          "sku_count",
          "price_locked",
          "first_inventoried_at",
          "last_inventoried_at",
          "variant_label"
        ],
        "properties": {
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product."
          },
          "game": {
            "type": "string",
            "enum": [
              "magic",
              "pokemon",
              "lorcana",
              "onepiece",
              "riftbound",
              "unionarena",
              "pokemonjp",
              "gundam",
              "starwars",
              "yugioh",
              "cyberpunk",
              "palworld",
              "digimon",
              "fleshblood",
              "cookierun",
              "sleeves",
              "sorcery",
              "wow",
              "deckboxes",
              "playmats",
              "binders",
              "colstorage",
              "counters",
              "vanguard",
              "dbsmasters",
              "dbsfusion",
              "weiss"
            ],
            "description": "Game family this product belongs to."
          },
          "product_name": {
            "type": "string"
          },
          "flavor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Promotional alternate name printed on the card (e.g. Godzilla series, Secret Lair, Universes Beyond crossovers), when the card has one. Null otherwise. Magic only."
          },
          "token_pairing_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a double-sided token, the name of the back face this product's TCGPlayer product id is physically paired with (e.g. \"Gremlin\" on a Glimmer // Gremlin token). Null for a non-token product, a solo (single-face) token listing, or when the pairing could not be resolved. Magic only."
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which printing this is when the name and set alone don't say (e.g. \"Art Card\", \"Reversible\", \"Borderless\", \"Showcase\", \"Reversible, Signature\"). Null for a plain printing and for every non-Magic game. Never \"Retro Frame\" on this endpoint."
          },
          "set_name": {
            "type": "string",
            "description": "Card set or edition name."
          },
          "set_code": {
            "type": "string",
            "description": "Short set/expansion code (e.g. MKM, DSK)."
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card rarity (e.g. Common, Uncommon, Rare, Mythic)."
          },
          "product_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collector number within the set (e.g. 123a)."
          },
          "cogs_avg": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Weighted-average cost of goods per unit across remaining inventory lots, or null if no lots exist."
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product type (e.g. card, token, sealed, graded)."
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "URI for the product image, or null if unavailable."
          },
          "total_quantity": {
            "type": "integer",
            "description": "Sum of `quantity` across every SKU variant the store owns for this product."
          },
          "total_quantity_visible": {
            "type": "integer",
            "description": "Sum of `quantity_visible` across every SKU variant."
          },
          "sku_count": {
            "type": "integer",
            "description": "Number of distinct SKU variants the store owns for this product."
          },
          "price_min": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Lowest priced SKU among this store's variants for this product, or null if no SKUs are priced."
          },
          "price_max": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Highest priced SKU among this store's variants for this product, or null if no SKUs are priced."
          },
          "price_locked": {
            "type": "boolean",
            "description": "Whether every priced SKU variant of this product is locked against reprice rule changes. False if the product has no priced SKUs.\n"
          },
          "buylist_cash_min": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Lowest cash price the store's buylist pays across this product's SKU variants (#1913) — the buy side of the margin, beside `price_min`. Null when the store's buylist rules decline every variant it holds. Read from the `store_buylist_offer` projection, which refreshes on the store's offer-rebuild schedule, so it can lag a rule edit by up to one rebuild.\n"
          },
          "buylist_cash_max": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Highest cash price the store's buylist pays across this product's variants, or null if it buys none of them."
          },
          "first_inventoried_at": {
            "type": "string",
            "format": "date-time",
            "description": "Earliest `first_inventoried_at` across all SKU variants."
          },
          "last_inventoried_at": {
            "type": "string",
            "format": "date-time",
            "description": "Latest `last_inventoried_at` across all SKU variants."
          },
          "last_copy_sold_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Most recent order placement (ordered-at) of any SKU variant of this product, excluding canceled and refunded orders — the per-product roll-up (MAX across variants) of the per-SKU `last_copy_sold_at` on the inventory detail endpoint. Null if no variant has a non-canceled, non-refunded sale.\n"
          },
          "graded": {
            "description": "The grading of a graded slab (#2260), whose product holds exactly one SKU: grader, grade and cert, so the grid can show them and the row can open the slab. Null for every other card.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SlabGrading"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every tag slug the store has put on this card, at either grain, sorted alphabetically. `[]` if the card carries none.\n\nIndependent of stock since #2290: a card the store has sold out of, or never carried, keeps its tags, because assignments live in a store-keyed catalog table rather than on the pricing row.\n"
          }
        }
      },
      "ProductInventoryVariant": {
        "description": "One SKU variant the store currently owns for a given TCGPlayer product, with totals and a per-location breakdown.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "condition",
          "language",
          "finish",
          "variant_label",
          "price",
          "quantity",
          "quantity_visible",
          "locations"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product."
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which printing the parent product is when the name and set alone don't say (e.g. \"Art Card\", \"Reversible\", \"Borderless\", \"Retro Frame\", \"Reversible, Signature\"). The same on every variant of the product. Null for a plain printing and for every non-Magic game."
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "language": {
            "type": "string",
            "description": "Card language."
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. normal, foil, etched)."
          },
          "finish_label": {
            "type": "string",
            "description": "Display-only finish label, refined to the specific foil treatment when known (e.g. \"Surge Foil\" instead of the generic \"Foil\"). Derived from the printing's promo types; `finish` remains the canonical machine value.\n"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Store's retail price in USD from pricing_data. Null if no pricing row exists for this SKU."
          },
          "quantity": {
            "type": "integer",
            "description": "Total quantity owned across all locations."
          },
          "quantity_visible": {
            "type": "integer",
            "description": "Total visible (sellable) quantity across all locations."
          },
          "listed_target": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU drip-listing cap on `quantity_visible`. The effective target is COALESCE(this, the store's `default_listed_target`); null inherits the store default. Setting or lowering the target pulls the listing down and pushes the change to marketplaces; raising or clearing it applies on the next write only (no automatic relist).\n"
          },
          "reserved_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "Per-SKU quantity held back from online marketplaces for in-store use, independent of `listed_target`. Null means no reserve.\n"
          },
          "online_listable": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Store-reserve cap on `quantity_visible`: MAX(0, this SKU's quantity minus outstanding committed quantity minus reserved_for_store). Null when reserved_for_store is null.\n"
          },
          "held_for_store": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much of this SKU's quantity the reserve is currently holding back: LEAST(reserved_for_store, this SKU's quantity). Null when reserved_for_store is null.\n"
          },
          "quantity_committed": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies of this SKU still owed to open orders (sold but not yet pulled from the shelf). `quantity` does not drop until pick, so `quantity - quantity_committed` is what can still be listed; raising `quantity_visible` past that (less any `reserved_for_store`) is rejected with a 400. Always present, unlike `online_listable`. Can exceed `quantity` when the SKU is oversold.\n"
          },
          "buylist_cash": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "What the store's buylist pays for this exact grade, from the `store_buylist_offer` projection (#1913) — the buy price beside the sell price, so the margin is visible where prices are set. Null when the store's buylist rules decline the card, which is most of a typical holding. Refreshed on the store's offer-rebuild schedule, so it can lag a rule edit by up to one rebuild.\n"
          },
          "buylist_credit": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Store-credit buy offer for this SKU. Null when the rule offers cash only, or when there is no offer."
          },
          "buylist_price_locked": {
            "type": "boolean",
            "description": "Whether the buy price is frozen against the offer rebuild (#1175) — either a plain lock or a manual override (`setBuylistOfferPrice`). False when there is no offer at all.\n"
          },
          "price_locked": {
            "type": "boolean",
            "description": "Whether the sell price is locked against reprice rules, by the card's own lock or a bin's."
          },
          "price_lock_source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "bin",
              "both",
              null
            ],
            "description": "Why the price is locked: `manual` (the card's own lock, removable), `bin` (a bin it is stocked in has a standing price lock), `both`, or null when not locked.\n"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "This SKU's tags. Never null — an untagged SKU, or one with no `pricing_data` row at all, returns `[]`.\n"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-text operator note for this SKU, or null if unset."
          },
          "locations": {
            "type": "array",
            "description": "Per-position breakdown: one entry per storage row, in shelf order (location `sequence_index`, then the row's place in the bin).\n",
            "items": {
              "$ref": "#/components/schemas/InventoryLocationEntry"
            }
          }
        }
      },
      "ProductCogsEntry": {
        "description": "One cost lot — a single intake of a SKU variant of the product at a single price. Created by whichever path took the copies in (manual add, CSV import, buylist push, transfer receive), and consumed oldest-first as the card sells.\n",
        "type": "object",
        "required": [
          "lot_id",
          "tcgplayer_sku_id",
          "condition",
          "language",
          "finish",
          "received_at",
          "unit_cost",
          "quantity_received",
          "quantity_remaining",
          "quantity_consumed",
          "total_cost",
          "remaining_cost",
          "cost_basis_source",
          "editable",
          "cost_batch_uuid",
          "cost_batch_name"
        ],
        "properties": {
          "lot_id": {
            "type": "integer",
            "format": "int64",
            "description": "Pass this to `bulkUpdateProductCogs` to correct the row's cost."
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU variant these copies were taken in as."
          },
          "graded": {
            "description": "The slab this lot is, under `include_slabs`; null for the card's own copies (#3528).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SlabGrading"
              },
              {
                "type": "null"
              }
            ]
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "language": {
            "type": "string"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the copies were taken in. Server-set; lots are consumed oldest-first."
          },
          "unit_cost": {
            "type": "number",
            "format": "double",
            "description": "Per-unit cost (COGS) paid for this batch, in USD."
          },
          "quantity_received": {
            "type": "number",
            "description": "How many copies this intake brought in."
          },
          "quantity_remaining": {
            "type": "number",
            "description": "How many of them are still on hand (not yet sold or removed)."
          },
          "quantity_consumed": {
            "type": "number",
            "description": "quantity_received minus quantity_remaining."
          },
          "total_cost": {
            "type": "number",
            "format": "double",
            "description": "unit_cost × quantity_received — what the whole batch cost."
          },
          "remaining_cost": {
            "type": "number",
            "format": "double",
            "description": "unit_cost × quantity_remaining — the cost still sitting on the shelf."
          },
          "cost_basis_source": {
            "type": "string",
            "enum": [
              "manual",
              "buylist_assumed",
              "buylist_purchase",
              "synthetic_zero",
              "cardchaos_migration",
              "batch_pending",
              "cost_batch"
            ],
            "description": "Where unit_cost came from. `manual`: a caller-supplied cost. `buylist_assumed`: Auto COGS Mode filled it from the store's own buylist offer — an estimate, correct it here if it's wrong. `buylist_purchase`: a real, agreed price from an accepted buylist purchase. `synthetic_zero`: no cost was given and no assumption applied. `cardchaos_migration`: carried over from CardChaos. `batch_pending`: a card in an open cost batch, at the cost it arrived with until the batch is finished (not editable). `cost_batch`: set when its cost batch was finished.\n"
          },
          "editable": {
            "type": "boolean",
            "description": "Whether `bulkUpdateProductCogs` will accept a correction for this row. False once the lot is fully consumed: that cost is snapshotted onto the orders it filled and frozen there, so rewriting it would change nothing downstream. False too for a lot in a cost batch that is not finished.\n"
          },
          "cost_batch_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The cost batch this lot belongs to (`getCostBatch`), or null when it is in none. While that batch is open or finishing the lot is not editable.\n"
          },
          "cost_batch_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That batch's name, for display. Null when the lot is in no batch."
          }
        }
      },
      "ProductCogsSummary": {
        "description": "Totals across the whole filtered ledger, not just the returned page. All zero (and `average_unit_cost` null) for a product the store has no cost lots for.\n",
        "type": "object",
        "required": [
          "entry_count",
          "quantity_received",
          "quantity_remaining",
          "total_cost",
          "remaining_cost",
          "average_unit_cost"
        ],
        "properties": {
          "entry_count": {
            "type": "integer",
            "description": "How many lots match the filters."
          },
          "quantity_received": {
            "type": "number",
            "description": "Total copies taken in across those lots."
          },
          "quantity_remaining": {
            "type": "number",
            "description": "Total copies from those lots still on hand."
          },
          "total_cost": {
            "type": "number",
            "format": "double",
            "description": "Total spent across those lots, in USD."
          },
          "remaining_cost": {
            "type": "number",
            "format": "double",
            "description": "Cost of the copies still on hand, in USD."
          },
          "average_unit_cost": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Quantity-weighted average cost per copy (total_cost ÷ quantity_received), so a 10-copy lot at $1 and a 1-copy lot at $10 average to $1.82 rather than $5.50. Null when no copies matched.\n"
          }
        }
      },
      "PaginatedProductCogsList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "entries",
              "summary"
            ],
            "properties": {
              "entries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductCogsEntry"
                }
              },
              "summary": {
                "$ref": "#/components/schemas/ProductCogsSummary"
              }
            }
          }
        ]
      },
      "ProductSale": {
        "description": "A single order line item that sold one SKU variant of a TCGPlayer product. Multiple line items can share `order_id` when one order purchased several SKUs of the same product.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "order_id",
          "order_date",
          "marketplace",
          "order_status",
          "condition",
          "language",
          "finish",
          "quantity_sold",
          "price_per_unit"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU variant that was sold."
          },
          "graded": {
            "description": "The slab sold, under `include_slabs`; null for the card's own copies (#3528).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SlabGrading"
              },
              {
                "type": "null"
              }
            ]
          },
          "order_id": {
            "type": "string",
            "format": "uuid",
            "description": "HippoLink order UUID. Line items from the same order share this value."
          },
          "order_date": {
            "type": "string",
            "format": "date-time",
            "description": "When the order was placed (ISO 8601)."
          },
          "marketplace": {
            "$ref": "#/components/schemas/OrderMarketplace"
          },
          "order_status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "language": {
            "type": "string"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "quantity_sold": {
            "type": "integer",
            "minimum": 1
          },
          "price_per_unit": {
            "type": "number",
            "format": "double",
            "description": "Unit price paid, in the order's `currency`."
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of the order, which is not always the store's (a CAD Snapcaster order on a USD store, #3736). Format `price_per_unit` with it.\n"
          }
        }
      },
      "ProfitReportResponse": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "rows",
          "totals"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfitReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/ProfitReportTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/ProfitReportCurrency"
            }
          }
        }
      },
      "ProfitReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProfitReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/ProfitReportTotals"
          }
        }
      },
      "ProfitReportRow": {
        "type": "object",
        "required": [
          "date",
          "marketplace",
          "revenue_usd",
          "cogs_usd",
          "hl_fee_usd",
          "cc_fee_usd",
          "platform_fee_usd",
          "fees_usd",
          "profit_usd"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Truncated date for the grouping period."
          },
          "marketplace": {
            "type": "string",
            "description": "Marketplace name. Always present (groups by marketplace when no filter is applied)."
          },
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cogs_usd": {
            "type": "number",
            "format": "double",
            "description": "FIFO COGS. COALESCE'd to 0 for orders without cost data. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "hl_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "HippoLink's marginal fee, derived from the store's billing tier. 0 on flat tiers. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cc_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Credit-card / processing fee from the store's configured formula (0 when unconfigured). Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "platform_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Marketplace commission. Provider-reported marketplace_fee_usd when present, else the store's configured platform formula. Amount in the store's currency (the `_usd` suffix is historical).\n"
          },
          "fees_usd": {
            "type": "number",
            "format": "double",
            "description": "hl_fee_usd + cc_fee_usd + platform_fee_usd. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "profit_usd": {
            "type": "number",
            "format": "double",
            "description": "revenue_usd - cogs_usd - fees_usd. Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "fees_estimated": {
            "type": "boolean",
            "description": "False when this order's configured credit-card and platform fees were not estimated, because their flat fees and caps are in the store's currency and the order is in another (the platform has no exchange rate). Those two fees are then 0; a fee reported by the marketplace and the HL fee are still included. On a total, false when any order in it was not estimated.\n"
          }
        }
      },
      "ProfitReportTotals": {
        "type": "object",
        "required": [
          "revenue_usd",
          "cogs_usd",
          "hl_fee_usd",
          "cc_fee_usd",
          "platform_fee_usd",
          "fees_usd",
          "profit_usd",
          "orders_awaiting_cost_batch"
        ],
        "properties": {
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cogs_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "hl_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "cc_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "platform_fee_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "fees_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "profit_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "orders_awaiting_cost_batch": {
            "type": "integer",
            "description": "Orders left out of this report because a line's cost waits on a cost batch's finish.\n"
          },
          "fees_estimated": {
            "type": "boolean",
            "description": "False when this order's configured credit-card and platform fees were not estimated, because their flat fees and caps are in the store's currency and the order is in another (the platform has no exchange rate). Those two fees are then 0; a fee reported by the marketplace and the HL fee are still included. On a total, false when any order in it was not estimated.\n"
          }
        }
      },
      "PushPurchaseRequest": {
        "type": "object",
        "required": [
          "target",
          "idempotency_key"
        ],
        "properties": {
          "target": {
            "type": "string",
            "enum": [
              "location",
              "inventory",
              "set_code",
              "chaos"
            ],
            "description": "location = per-line destination assignment (uses BuylistLineItem.destination_location_uuid plus optional line_locations overrides). inventory = all lines to default_location_uuid. set_code = route each line to the location whose intake_set_codes claims the card's set code, falling back to the store's default-intake location. chaos = round-robin lines across the store's active bin locations. For set_code and chaos, default_location_uuid is an optional final fallback.\n"
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "description": "Base key from which per-line keys are derived (key:line_item_uuid)."
          },
          "default_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Required for target='inventory'. Optional fallback for target='location' (used when a line has no destination_location_uuid AND no line_locations override).\n"
          },
          "line_locations": {
            "type": [
              "array",
              "null"
            ],
            "description": "Per-line destination overrides for target='location'.",
            "items": {
              "type": "object",
              "required": [
                "line_item_uuid",
                "location_uuid"
              ],
              "properties": {
                "line_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          },
          "create_holding_bin": {
            "type": "boolean",
            "default": false,
            "description": "Create a new holding bin named `Buylist-<buylist_number>` (zero-padded to four digits) and push every card into it, overriding `target`, `default_location_uuid` and `line_locations` (#2258). The bin is created non-listable (a holding location): the cards are in inventory but sync to no marketplace until they are moved to a listable bin. It goes in `holding_container_uuid`, else the store's buylist config `holding_container_uuid` (null once that container is removed); with neither, 422 `holding_container_missing`, and 422 `holding_container_invalid` when the requested uuid is not one of the store's containers. A replayed push creates no second bin.\n"
          },
          "holding_container_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Container for the holding bin, overriding the store default. Only read when `create_holding_bin` is true.\n"
          },
          "price_and_sync": {
            "type": "boolean",
            "default": true,
            "description": "When true (the default), the pushed SKUs that have no sell price yet are first-priced from the store's reprice rules (the same projection a scheduled reprice run uses) and a pricing.updated event is published so they sync to marketplaces immediately instead of waiting for the next reprice window. Best-effort: a failure here never fails the push. Set false to skip pricing/sync and leave the cards for the next scheduled run.\n"
          },
          "payout_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cash",
              "credit",
              null
            ],
            "description": "How the seller was actually paid. Omit to use the purchase's own payout_type (defaulting to cash when it has none); send a value to override it at the counter, which also updates the purchase. cash_total and credit_total are the same cards priced two ways, so exactly one leg is recorded as paid and the other is zero.\n"
          }
        }
      },
      "BuylistCreditIssue": {
        "type": "object",
        "description": "One purchase's store credit on its way to a POS (#4898). The push never fails on credit: a credit that could not be sent is recorded here with the reason, and retried by retryBuylistCreditIssue.\n",
        "required": [
          "status",
          "destination",
          "amount",
          "currency",
          "attempts"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "issued",
              "needs_customer",
              "failed"
            ],
            "description": "`pending` not yet sent; `issued` credited; `needs_customer` the customer could not be found uniquely, pick one and retry; `failed` see `error`.\n"
          },
          "destination": {
            "type": "string",
            "enum": [
              "shopify"
            ]
          },
          "amount": {
            "type": "string",
            "description": "Credit amount as a decimal string, two places."
          },
          "currency": {
            "type": "string"
          },
          "pos_customer_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "pos_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "issued_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "attempts": {
            "type": "integer"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "code",
              "detail"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              }
            }
          }
        }
      },
      "PushPurchaseResponse": {
        "type": "object",
        "required": [
          "purchase",
          "intake_results"
        ],
        "properties": {
          "credit_issue": {
            "description": "The purchase's store credit to the POS, or null when none is owed. A failed credit does not fail the push.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BuylistCreditIssue"
              },
              {
                "type": "null"
              }
            ]
          },
          "purchase": {
            "$ref": "#/components/schemas/BuylistPurchase"
          },
          "holding_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The holding bin this push created when `create_holding_bin` was set; null otherwise and on an idempotent replay (every intake result names its `location_uuid`).\n"
          },
          "pricing_summary": {
            "type": [
              "object",
              "null"
            ],
            "description": "Outcome of the price-and-sync step. Present only when price_and_sync was requested (the default). Null/absent when price_and_sync was false.\n",
            "required": [
              "attempted",
              "priced",
              "needs_attention",
              "sync_batches"
            ],
            "properties": {
              "attempted": {
                "type": "boolean",
                "description": "False if the price-and-sync step errored (push still succeeded)."
              },
              "priced": {
                "type": "integer",
                "description": "Number of pushed SKUs that were first-priced from the store's rules."
              },
              "needs_attention": {
                "type": "integer",
                "description": "Stocked-but-unpriced pushed SKUs that no rule priced (left for review)."
              },
              "sync_batches": {
                "type": "integer",
                "description": "Number of pricing.updated batches enqueued to the inventory-sync queue."
              }
            }
          },
          "intake_results": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "line_item_uuid",
                "tcgplayer_sku_id",
                "quantity",
                "quantity_visible",
                "idempotent_replay"
              ],
              "properties": {
                "line_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "location_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer"
                },
                "quantity_visible": {
                  "type": "integer",
                  "description": "Post-intake quantity_visible at the destination (what was announced via inventory.updated, when this entry wasn't a replay)."
                },
                "transaction_uuid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "lot_id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "idempotent_replay": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "RecountFlag": {
        "type": "object",
        "description": "A bin flagged for a physical recount after a pick shortfall (#885): a picker found fewer copies of the SKU than the system expected at the bin. The count is left unchanged until a manager recounts; this row carries the discrepancy plus bin + card metadata for the recount UI.\n",
        "required": [
          "flag_uuid",
          "store_uuid",
          "location_uuid",
          "tcgplayer_sku_id",
          "expected_qty",
          "found_qty",
          "current_qty",
          "hidden_qty",
          "bin_open_flag_count",
          "flagged_at"
        ],
        "properties": {
          "flag_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The flagged bin."
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_custom_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_uri": {
            "type": [
              "string",
              "null"
            ]
          },
          "expected_qty": {
            "type": "integer",
            "description": "System count when the picker came up short (the planned pull)."
          },
          "found_qty": {
            "type": "integer",
            "description": "How many the picker actually found at the bin."
          },
          "current_qty": {
            "type": "integer",
            "description": "The bin's current system count for this SKU (0 when the storage row is gone)."
          },
          "hidden_qty": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies of the SKU in this bin kept off sale while the flag is open (#4584); 0 when the store's recount hold is off or the flag is resolved.\n"
          },
          "run_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The fulfillment run that surfaced the discrepancy."
          },
          "run_started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When that run was created; null when the run is unknown or has been deleted."
          },
          "flagged_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Supabase sub of the picker who reported the shortfall."
          },
          "flagged_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The picker's display name (\"First Last\", falling back to their email); null when `flagged_by` is unknown or no longer matches a user.\n"
          },
          "flagged_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolved_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Supabase sub of the manager who resolved the recount."
          },
          "recount_qty": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The manager's true count, set on resolve."
          },
          "bin_open_flag_count": {
            "type": "integer",
            "minimum": 0,
            "description": "Open recount flags in this flag's bin right now, the number `min_flags_per_bin` compares against.\n"
          }
        }
      },
      "RecountFlagSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "recount_hides_stock",
          "recount_alert_min_flags_per_bin"
        ],
        "properties": {
          "recount_hides_stock": {
            "type": "boolean",
            "description": "When true, the copies a bin holds of a SKU with an open recount flag are kept off sale until the flag is resolved. Off by default.\n"
          },
          "recount_alert_min_flags_per_bin": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many open recount flags a bin needs before they count toward the Bin Recounts badge, the aging banner and the default flag list. 1 (the default) counts every flag. It never changes what the recount hold hides.\n"
          }
        }
      },
      "RecountFlagSettingsUpdate": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "Either setting, or both; a field left out keeps its saved value.",
        "properties": {
          "recount_hides_stock": {
            "type": "boolean",
            "description": "When true, the copies a bin holds of a SKU with an open recount flag are kept off sale until the flag is resolved.\n"
          },
          "recount_alert_min_flags_per_bin": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "How many open recount flags a bin needs before they count toward the Bin Recounts badge, the aging banner and the default flag list.\n"
          }
        }
      },
      "RecountFlagBelowThreshold": {
        "type": "object",
        "required": [
          "bins",
          "flags"
        ],
        "description": "Open flags the applied `min_flags_per_bin` leaves out (in bins holding fewer than that many), within any bin filter. Both 0 when the threshold is 1.\n",
        "properties": {
          "bins": {
            "type": "integer",
            "minimum": 0
          },
          "flags": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RecountFlagListResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "min_flags_per_bin",
          "below_threshold",
          "recount_flags"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total count of flags matching the filters (regardless of pagination)."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "min_flags_per_bin": {
            "type": "integer",
            "minimum": 1,
            "description": "The per-bin threshold this page applied (the request's, else the default)."
          },
          "below_threshold": {
            "$ref": "#/components/schemas/RecountFlagBelowThreshold"
          },
          "recount_flags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecountFlag"
            }
          }
        }
      },
      "RecountFlagBin": {
        "type": "object",
        "required": [
          "location_uuid",
          "is_holding",
          "open_flags",
          "missing_copies",
          "oldest_flagged_at",
          "newest_flagged_at"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_custom_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bin's breadcrumb, ancestors joined with \" > \"."
          },
          "is_holding": {
            "type": "boolean",
            "description": "A TCGplayer Direct or CardTrader Zero holding bin, which cannot be recounted or approved as-is."
          },
          "open_flags": {
            "type": "integer",
            "minimum": 1,
            "description": "Open recount flags in the bin (one per card)."
          },
          "missing_copies": {
            "type": "integer",
            "minimum": 0,
            "description": "Copies the pickers came up short by across those flags."
          },
          "oldest_flagged_at": {
            "type": "string",
            "format": "date-time"
          },
          "newest_flagged_at": {
            "type": "string",
            "format": "date-time",
            "description": "Send as `flagged_at_or_before` to approve this bin as-is without approving a newer flag."
          }
        }
      },
      "RecountFlagBinListResponse": {
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "min_flags_per_bin",
          "below_threshold",
          "bins"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Bins at or over `min_flags_per_bin` (regardless of pagination)."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "min_flags_per_bin": {
            "type": "integer",
            "minimum": 1,
            "description": "The per-bin threshold applied (the request's, else the store's)."
          },
          "below_threshold": {
            "$ref": "#/components/schemas/RecountFlagBelowThreshold"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecountFlagBin"
            }
          }
        }
      },
      "ResolveAllRecountFlagsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "flagged_at_or_before": {
            "type": "string",
            "format": "date-time",
            "description": "Only flags raised at or before this time are resolved. Send the newest `flagged_at` on screen. Omit to resolve every open flag.\n"
          },
          "location_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Only flags in these bins. Omit for every bin."
          },
          "min_flags_per_bin": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Only bins holding at least this many open flags, counted before anything is resolved. Defaults to the store's `recount_alert_min_flags_per_bin`; send 1 to approve bins of any size.\n"
          }
        }
      },
      "ResolveAllRecountFlagsResponse": {
        "type": "object",
        "required": [
          "resolved",
          "skipped_holding"
        ],
        "properties": {
          "resolved": {
            "type": "integer",
            "description": "Number of flags resolved at the current count."
          },
          "skipped_holding": {
            "type": "integer",
            "description": "Open flags left open because their bin is a holding location."
          }
        }
      },
      "ResolveRecountFlagRequest": {
        "type": "object",
        "required": [
          "recount_qty"
        ],
        "properties": {
          "recount_qty": {
            "type": "integer",
            "minimum": 0,
            "description": "The manager's physical count of the flagged bin+SKU."
          }
        }
      },
      "ResolveRecountFlagResponse": {
        "type": "object",
        "required": [
          "flag_uuid",
          "location_uuid",
          "tcgplayer_sku_id",
          "previous_qty",
          "recount_qty"
        ],
        "properties": {
          "flag_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "location_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "previous_qty": {
            "type": "integer",
            "description": "The bin's system count before the recount."
          },
          "recount_qty": {
            "type": "integer",
            "description": "The count set by the recount."
          },
          "resolved_by": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OrderRefundSummary": {
        "type": "object",
        "description": "What the order has given back, computed from its refunds and marketplace reports. Amounts are decimal strings in the order's currency (the `_usd` suffix on the source columns is historical).\n",
        "required": [
          "recorded_total",
          "refunded_total",
          "refundable_left"
        ],
        "properties": {
          "recorded_total": {
            "type": "string",
            "description": "Sum of the order's refunds that did not fail (`pending` included). The same sum the refund cap checks.\n"
          },
          "refunded_total": {
            "type": "string",
            "description": "What the buyer got back, as far as HippoLink knows: `recorded_total` plus the part of each sent Square card refund that went to lines HippoLink doesn't stock (never recorded as a HippoLink refund). A refund made in the Square dashboard counts only its stocked part.\n"
          },
          "refundable_left": {
            "type": "string",
            "description": "`order_total` less `recorded_total`, never below 0, and 0 on a `refunded` or `canceled` order: the most a new recorded refund may be.\n"
          }
        }
      },
      "Refund": {
        "type": "object",
        "required": [
          "refund_uuid",
          "order_uuid",
          "store_uuid",
          "amount_usd",
          "reason",
          "return_to_stock",
          "created_by",
          "created_at",
          "source"
        ],
        "properties": {
          "refund_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "amount_usd": {
            "type": "string",
            "description": "Refund amount in USD as a decimal string with up to 2 decimal places. Must be greater than zero.\n",
            "example": "12.50"
          },
          "reason": {
            "type": "string",
            "enum": [
              "oversell",
              "damaged",
              "customer_request",
              "carrier_loss",
              "other"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_refund_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Native marketplace refund ID when the refund originated remotely."
          },
          "refund_status": {
            "type": "string",
            "enum": [
              "pending",
              "issued",
              "failed",
              "not_applicable"
            ],
            "description": "Status of issuing this refund to the originating marketplace. `pending` means dispatch hasn't completed yet; `issued`/`failed` are the result of a real dispatch attempt. `not_applicable` means no dispatch was ever attempted because the marketplace has no seller-initiated refund API: TCGPLAYER (refunds there must be issued directly through TCGplayer's own UI) and CARD_TRADER (no refund endpoint; money moves through CardTrader's own cancellation workflow pre-ship, or CardTrader support post-ship, #1503). The refund row itself is always recorded regardless of status, for COGS and reporting purposes.\n"
          },
          "return_to_stock": {
            "type": "boolean",
            "default": false,
            "description": "When true, `returned_items` lists the SKUs and quantities returned to inventory.\n"
          },
          "returned_items": {
            "type": [
              "array",
              "null"
            ],
            "description": "Items returned to stock. Required when `return_to_stock` is true.\n",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "quantity"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Supabase UUID of the user who recorded the refund. Null when the marketplace reported it (`source: marketplace`): nobody in HippoLink made it.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "enum": [
              "hippolink",
              "marketplace"
            ],
            "description": "Where the refund came from. `hippolink`: recorded in HippoLink (by hand, or by a refund HippoLink sent to the marketplace). `marketplace`: the store refunded on the marketplace directly and HippoLink recorded it from the marketplace's report, e.g. a refund made in the Square dashboard (#3244). Its `amount_usd` is the part for items HippoLink stocks when the marketplace itemized it, else the whole amount, and `marketplace_refund_id` is the marketplace's own id.\n"
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Echoes the Idempotency-Key header when present on the originating request."
          },
          "report_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The marketplace report that recorded this refund (the marketplace refunded the buyer for the reported lines itself). Null on a refund the store recorded by hand.\n"
          }
        }
      },
      "MarketplaceReportRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "description": "Only the lines being reported. The endpoint used to take a `comment`; one sent by an older client is ignored, not refused.\n",
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "The lines being reported, each at most once. Lines left out ship as normal.",
            "items": {
              "type": "object",
              "required": [
                "order_item_uuid",
                "quantity"
              ],
              "additionalProperties": false,
              "properties": {
                "order_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Copies of this line the store can't send."
                }
              }
            }
          },
          "return_to_stock": {
            "type": "boolean",
            "default": false,
            "description": "Whether the refunded or reported copies are in stock. On an order that has not shipped they come off the order either way, and this decides whether they are sellable again (true) or written off the shelf count (false). On a shipped order, true returns them to stock. Mana Pool, Square, Shopify, TCGplayer, CardNexus and Lightspeed. On Lightspeed the register restocks the copies itself either way, and HippoLink's push then sets its count to match this choice.\n"
          },
          "payment_type_id": {
            "type": "string",
            "description": "Lightspeed only: the payment type (one of the quote's `payment_types`) the refund is recorded under. Absent uses the quote's `payment_type_id` (Cash when the account has it). A card refund can't be sent through Lightspeed's API, so only non-card types are offered and the store hands the buyer the money.\n"
          },
          "buyer_note": {
            "type": "string",
            "maxLength": 500,
            "description": "TCGplayer only: the message TCGplayer shows the buyer with the refund. Blank or absent sends \"Refunded by the seller.\" Ignored on other marketplaces.\n"
          }
        }
      },
      "ResolveMarketplaceReportRequest": {
        "type": "object",
        "required": [
          "outcome"
        ],
        "additionalProperties": false,
        "properties": {
          "outcome": {
            "type": "string",
            "enum": [
              "refunded",
              "not_refunded"
            ],
            "description": "What the TCGplayer seller portal shows for this refund."
          }
        }
      },
      "MarketplaceReport": {
        "type": "object",
        "required": [
          "report_uuid",
          "order_uuid",
          "marketplace",
          "kind",
          "return_to_stock",
          "applied_to_order",
          "status",
          "created_at",
          "items"
        ],
        "properties": {
          "report_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "type": "string",
            "description": "The order's marketplace (MANA_POOL, SQUARE, SHOPIFY or TCGPLAYER)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "issue_report",
              "refund"
            ],
            "description": "`issue_report` (Mana Pool: cards the store can't send) or `refund` (Square, Shopify, TCGplayer or CardNexus: refunded through the marketplace)."
          },
          "amount_usd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Square, Shopify, TCGplayer and CardNexus refunds only. The amount asked of the marketplace."
          },
          "return_to_stock": {
            "type": "boolean"
          },
          "applied_to_order": {
            "type": "boolean",
            "description": "True when this report took its copies off an order that had not shipped, lowering each line's quantity. Its copies are already gone from quantity, so a reader must not subtract them again; what was ordered is quantity plus the copies on applied reports.\n"
          },
          "resumed": {
            "type": "boolean",
            "description": "Create response only. True when this send finished an earlier Square or Shopify refund whose answer was lost, instead of the lines in this request."
          },
          "restock_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Create response only. Why the copies could not be returned to stock (\"order is canceled\" or \"order is refunded\": only a shipped order is restocked), or on an order that has not shipped, taken off the order (the order is then flagged problematic); the refund still stands.\n"
          },
          "tender_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Create response only, Square and Shopify. On Square the tender's `type` (`CARD`, `CASH`, `EXTERNAL`, ...); only a `CARD` refund sends money back, and for any other tender Square records the refund and the store hands the buyer the money. On Shopify the payment gateway of the refunded transaction (`shopify_payments`, `manual`, `cash`, ...); only a card processor sends money back. Null on TCGplayer.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "sent",
              "failed"
            ],
            "description": "`pending` while the marketplace call is in flight, `sent` once the marketplace accepted it, `failed` when it refused (see `error`).\n"
          },
          "marketplace_report_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The marketplace's own id for the report. Null until sent."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the marketplace refused the report. Null unless failed."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "refund_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The refund recorded for the reported lines, on the create response and on the order detail. Null when no refund was recorded (the order was already refunded or canceled, or the lines total $0); the report still counts.\n"
          },
          "billing_reprice": {
            "type": "string",
            "enum": [
              "queued",
              "not_configured",
              "failed"
            ],
            "description": "Create response only. Whether the order's billing day was queued for repricing so its HippoLink fee drops the sent report's copies. A day an invoice already claimed is not repriced (billing logs it for a manual billing adjustment). `queued` means the reprice was asked for, not that it applied.\n"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "order_item_uuid",
                "marketplace_product_id",
                "product_type",
                "quantity"
              ],
              "properties": {
                "order_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "marketplace_product_id": {
                  "type": "string",
                  "description": "The marketplace's product id sent for this line."
                },
                "product_type": {
                  "type": "string",
                  "description": "The marketplace's product type sent (Mana Pool `mtg_single` / `mtg_sealed`; `square_line` on a Square refund; `shopify_line` on a Shopify refund; `tcgplayer_sku` on a TCGplayer refund, whose product id is the SKU)."
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "MarketplaceReportQuote": {
        "type": "object",
        "required": [
          "total_usd",
          "hippolink_total_usd",
          "lines",
          "tender_type",
          "pending_refund"
        ],
        "properties": {
          "total_usd": {
            "type": "string",
            "description": "What the marketplace (Square or Shopify) would refund for these lines."
          },
          "hippolink_total_usd": {
            "type": "string",
            "description": "The card lines' part of `total_usd`, the only part HippoLink records as a refund. Lines HippoLink doesn't stock (no SKU: sleeves, a custom amount) are refunded on Square only, so the two differ when one is ticked.\n"
          },
          "tender_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "On Square the tender's `type` (`CARD`, `CASH`, `EXTERNAL`, ...); only a `CARD` refund sends money back, and for any other tender Square records the refund and the store hands the buyer the money. On Shopify the gateway of the first transaction the refund goes to (`shopify_payments`, `manual`, `cash`, ...); only a card processor sends money back. On Lightspeed the name of the default payment type the refund is recorded under; the store always hands the buyer the money.\n"
          },
          "payment_types": {
            "type": "array",
            "description": "Lightspeed only: the account's payment types a refund can be recorded under (no card processor, store credit or disabled type).\n",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "payment_type_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lightspeed only: the payment type a send uses when the request names none (Cash when the account has it); null when the account has none, in which case the refund is made at the register.\n"
          },
          "full_refund": {
            "type": "boolean",
            "description": "TCGplayer only: the send will use TCGplayer's full refund, because the request covers every card copy left on the order (a line with no SKU goes with the rest).\n"
          },
          "shipping_usd": {
            "type": "string",
            "description": "TCGplayer only: the shipping part of `total_usd` (non-zero only on a full refund).\n"
          },
          "pending_refund": {
            "description": "An earlier Square, Shopify or TCGplayer refund on this order that was never confirmed (any age), or null. On Square and Shopify a send finishes this refund, with its own amount and lines, and ignores the request's items. On TCGplayer a send is refused until the store settles it (`resolveMarketplaceReport`).\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MarketplaceReportPendingRefund"
              },
              {
                "type": "null"
              }
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "order_item_uuid",
                "quantity",
                "amount_usd",
                "method"
              ],
              "properties": {
                "order_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                },
                "amount_usd": {
                  "type": "string"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "estimated"
                  ]
                }
              }
            }
          }
        }
      },
      "MarketplaceReportPendingRefund": {
        "type": "object",
        "required": [
          "report_uuid",
          "amount_usd",
          "hippolink_total_usd",
          "items"
        ],
        "properties": {
          "report_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "amount_usd": {
            "type": "string",
            "description": "What the send will ask Square for (this refund's own amount, not the quote's total)."
          },
          "hippolink_total_usd": {
            "type": "string",
            "description": "The card lines' part of `amount_usd`, which is all HippoLink records as a refund when the send finishes; lines HippoLink doesn't stock are refunded on Square only. `0.00` for a refund sent before line amounts were stored that includes such a line, since its card part can't be recovered and no HippoLink refund is recorded for it.\n"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "order_item_uuid",
                "quantity"
              ],
              "properties": {
                "order_item_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "MarketplaceReportError": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorResponse"
          },
          {
            "type": "object",
            "properties": {
              "order_item_uuid": {
                "type": "string",
                "format": "uuid",
                "description": "The line the request was refused for, when one line is at fault."
              },
              "report": {
                "$ref": "#/components/schemas/MarketplaceReport"
              }
            }
          }
        ]
      },
      "RefundsReportResponse": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "rows",
          "totals"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RefundsReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/RefundsReportTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/RefundsReportCurrency"
            }
          }
        }
      },
      "RefundsReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RefundsReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/RefundsReportTotals"
          }
        }
      },
      "RefundsReportRow": {
        "type": "object",
        "required": [
          "date",
          "marketplace",
          "refund_count",
          "refund_amount_usd"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "marketplace": {
            "type": "string"
          },
          "refund_count": {
            "type": "integer"
          },
          "refund_amount_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "RefundsReportTotals": {
        "type": "object",
        "required": [
          "refund_count",
          "refund_amount_usd"
        ],
        "properties": {
          "refund_count": {
            "type": "integer"
          },
          "refund_amount_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "ReplaceDraftLinesRequest": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "minItems": 0,
            "maxItems": 5000,
            "description": "The authoritative line set for the draft purchase, keyed by (tcgplayer_sku_id, condition). Lines present become the set; lines omitted are removed; an empty array clears all lines. Duplicate (tcgplayer_sku_id, condition) pairs are rejected with 422, and so is a set of more than 5,000 lines, the most the quote prices in one call.",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_sku_id",
                "condition",
                "quantity"
              ],
              "properties": {
                "tcgplayer_sku_id": {
                  "type": "integer"
                },
                "condition": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1
                },
                "quoted_cash": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total). Omit both quoted_cash and quoted_credit (or send both as null) and the server prices the line from the store's live buylist rules, the same way the public storefront submit and the CSV import do; send either one and both are stored exactly as given. A SKU the rules decline is stored unpriced."
                },
                "quoted_credit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Decimal string, price of one card (not the line total). See quoted_cash for what an omitted pair means."
                },
                "override": {
                  "type": "boolean",
                  "default": false,
                  "description": "Buy this card although the ruleset declines it. Only a flagged line is checked: if the ruleset declines it and the caller lacks `overrideBuylistDecline`, the request fails with 403 `decline_override_forbidden`. Unflagged declined lines save normally (a draft commits nothing, and a store with no rules declines everything). On a replace of a draft's lines, a line that already carried an override on that draft (same SKU and condition) keeps it for any caller; making a new override still requires the permission."
                }
              }
            }
          }
        }
      },
      "RepriceHistorySummary": {
        "type": "object",
        "description": "One run in the history list. Carries no `rules_applied_snapshot`: on a store with thousands of rules it is megabytes per run, so the list leaves it out and `GET /v1/stores/{store_uuid}/reprice/history/{reprice_job_uuid}` returns it.",
        "required": [
          "job_uuid",
          "status",
          "created_at",
          "total_changes",
          "summary"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "total_changes": {
            "type": "integer"
          },
          "summary": {
            "$ref": "#/components/schemas/RepriceSummary"
          }
        }
      },
      "RepriceJob": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncJob"
          },
          {
            "type": "object",
            "properties": {
              "completed_at": {
                "type": "string",
                "format": "date-time"
              },
              "rules_applied_snapshot": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepriceRuleSnapshot"
                },
                "description": "Rules as they were at execution time"
              },
              "inventory_processed": {
                "type": "integer",
                "description": "Number of inventory processed so far"
              },
              "inventory_total": {
                "type": "integer",
                "description": "Total number of inventory to process"
              },
              "total_changes": {
                "type": "integer",
                "description": "Number of inventory changed (present when completed)"
              },
              "summary": {
                "$ref": "#/components/schemas/RepriceSummary"
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Stable snake_case code for why a reprice or rollback job failed (`reprice_timed_out`, `reprice_busy`, `reprice_database_unavailable`, `reprice_stalled`, `reprice_not_queued`, `reprice_failed_unexpected`). Present, beside `error_message`, only on a failed reprice or rollback job. A job that failed before codes existed is served with the code its old message maps to, else `reprice_failed_unexpected`.\n"
              },
              "error_message": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "User-facing explanation of why a reprice or rollback job failed. Plain language, safe to show to the store; never raw exception text. Present only when the job failed.\n"
              }
            }
          }
        ]
      },
      "RepriceJobDetail": {
        "description": "RepriceJob fields plus paginated changes (used by history detail)",
        "allOf": [
          {
            "$ref": "#/components/schemas/RepriceJob"
          },
          {
            "type": "object",
            "required": [
              "total_changes",
              "limit",
              "offset",
              "changes"
            ],
            "properties": {
              "total_changes": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "offset": {
                "type": "integer"
              },
              "changes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "tcgplayer_sku_id",
                    "tcgplayer_product_id",
                    "price_before",
                    "price_after",
                    "matched_rule_index"
                  ],
                  "properties": {
                    "tcgplayer_sku_id": {
                      "type": "integer",
                      "format": "int64",
                      "description": "TCGPlayer SKU ID — identifies the variant."
                    },
                    "tcgplayer_product_id": {
                      "type": "integer",
                      "format": "int64",
                      "description": "TCGPlayer product ID — identifies the parent product."
                    },
                    "product_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Card or product name."
                    },
                    "set_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Set or expansion name (e.g. \"Murders at Karlov Manor\")."
                    },
                    "set_code": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Short set abbreviation (e.g. \"MKM\")."
                    },
                    "rarity": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Card rarity (e.g. \"Rare\", \"Common\")."
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Product image URL from the catalog."
                    },
                    "condition": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Variant condition (e.g. \"Near Mint\", \"Lightly Played\")."
                    },
                    "language": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Variant language (e.g. \"English\", \"Japanese\")."
                    },
                    "finish": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Variant finish (e.g. \"normal\", \"foil\", \"etched\")."
                    },
                    "game": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Game the product belongs to (e.g. \"magic\", \"pokemon\")."
                    },
                    "price_before": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "format": "double",
                      "description": "Price before this change; null for first-priced rows."
                    },
                    "price_after": {
                      "type": "number",
                      "format": "double"
                    },
                    "matched_rule_index": {
                      "type": "integer",
                      "description": "Index into rules_applied_snapshot identifying the matched rule"
                    },
                    "rule_uuid": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "UUID of the reprice rule attributed to this change."
                    },
                    "rule_name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the attributed rule as it was at execution time."
                    },
                    "resolved_condition": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The condition that actually priced this SKU, when the matched rule's price source was a bare (condition-agnostic) platform variable resolved via the nearest-better-condition fallback (e.g. a Moderately Played SKU priced off a Lightly Played row). Null when the price source was a fixed-condition variable (already implied by \"condition\" above), a non-platform variable, or a composite FIRST_DEFINED/aggregate price source.\n"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "RepricePreview": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "product_name",
          "set_name",
          "language",
          "condition",
          "current_price",
          "new_price",
          "matched_rule_uuid",
          "matched_rule_source"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant being repriced."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product."
          },
          "product_name": {
            "type": "string",
            "description": "Product name"
          },
          "set_name": {
            "type": "string",
            "description": "Set or expansion the card belongs to"
          },
          "language": {
            "type": "string"
          },
          "variation": {
            "type": "string",
            "description": "Card variation (e.g. Extended Art, Borderless)"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product type (e.g. card, token, sealed, graded)"
          },
          "current_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The price before repricing. Null when there is no prior price — a first-priced (previously unpriced) SKU, or a marketplace-override preview row with no existing override.\n"
          },
          "new_price": {
            "type": "number",
            "format": "double"
          },
          "matched_rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "matched_rule_source": {
            "type": "string",
            "description": "The DSL rule string of the matched rule"
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The matched rule's name."
          },
          "marketplace": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when this row previews a per-marketplace override rather than the base price; null for a base-price change.\n"
          }
        }
      },
      "RepriceDraftRule": {
        "type": "object",
        "description": "One rule of an unsaved ruleset, as the rules editor holds it.",
        "required": [
          "rule"
        ],
        "properties": {
          "rule": {
            "type": "string",
            "description": "The rule's DSL source."
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Defaults to \"Rule N\" by position."
          },
          "is_enabled": {
            "type": "boolean",
            "default": true
          },
          "rule_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "A saved rule's id, kept so results attribute to it. Omit for a new rule."
          }
        }
      },
      "RepricePreviewOutcome": {
        "type": "object",
        "description": "What the rules do to one SKU's base price.",
        "required": [
          "tcgplayer_sku_id",
          "in_inventory",
          "current_price",
          "new_price",
          "decision",
          "matched_rule_uuid",
          "matched_rule_name"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "in_inventory": {
            "type": "boolean",
            "description": "False for a card the store has never priced. Its price is projected at quantity 1 and covers the base price only.\n"
          },
          "current_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "new_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "decision": {
            "type": "string",
            "enum": [
              "priced",
              "no_change",
              "no_match",
              "no_price",
              "locked"
            ],
            "description": "`priced` - a rule moved the price. `no_change` - a rule matched but computed the price the card already has. `no_match` - no rule matched. `no_price` - a rule matched but computed no usable price for this card (its price variable has no value). `locked` - the card's price is locked, so no rule can change it.\n"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The card's image, from the catalog. Null when the catalog has none."
          },
          "market_prices": {
            "type": "object",
            "description": "TCGplayer reference prices for the card, resolved at its condition with the same nearest-better-condition fallback a rule reading the variable gets. Null where there is no price.\n",
            "required": [
              "tcgplayer_low",
              "tcgplayer_market"
            ],
            "properties": {
              "tcgplayer_low": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "tcgplayer_market": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              }
            }
          }
        }
      },
      "RepricePreviewMarketplaceOutcome": {
        "type": "object",
        "description": "What the rules do to one SKU's price on one marketplace.",
        "required": [
          "tcgplayer_sku_id",
          "marketplace",
          "current_price",
          "current_currency",
          "new_price",
          "currency",
          "decision",
          "matched_rule_uuid",
          "matched_rule_name"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "marketplace": {
            "type": "string"
          },
          "current_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The card's price on this marketplace now. Null when it has none and lists at the base price."
          },
          "current_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "The currency of `current_price`, which can differ from `currency`."
          },
          "new_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The price after the rules. For `cleared`, the card's new base price. Null for `locked` or `no_price` when the card has no price on this marketplace.\n"
          },
          "currency": {
            "type": "string",
            "description": "The currency of `new_price`."
          },
          "decision": {
            "type": "string",
            "enum": [
              "priced",
              "no_change",
              "cleared",
              "locked",
              "no_price",
              "no_match"
            ],
            "description": "`priced` - a `MARKETPLACE` rule sets a new price. `no_change` - a rule matched but computed the price the card already has there. `cleared` - a base-price rule (`matched_rule_uuid`) matched the card, which removes its price on this marketplace, so it lists at the base price. `locked` - the card's price is locked, so no rule changes it. `no_price` - a rule matched but computed no usable price, so the card keeps the price it has. `no_match` - no rule matched, so the card keeps the price it has.\n"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RepriceListingPreview": {
        "type": "object",
        "description": "A preview row for a listing change rather than a price change: what a `DO NOT LIST ON` rule would do to one SKU's listing on one marketplace. Carries no prices — a suppression is a boolean flag, not a value.",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "product_name",
          "set_name",
          "language",
          "condition",
          "marketplace",
          "action"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID — identifies the variant whose listing would change."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer product ID — identifies the parent product."
          },
          "product_name": {
            "type": "string",
            "description": "Product name"
          },
          "set_name": {
            "type": "string",
            "description": "Set or expansion the card belongs to"
          },
          "language": {
            "type": "string"
          },
          "variation": {
            "type": "string",
            "description": "Card variation (e.g. Extended Art, Borderless)"
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)"
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "product_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product type (e.g. card, token, sealed, graded)"
          },
          "marketplace": {
            "type": "string",
            "description": "The marketplace whose listing would change."
          },
          "action": {
            "type": "string",
            "enum": [
              "suppress",
              "unsuppress"
            ],
            "description": "\"suppress\" — a `DO NOT LIST ON` rule would newly stop this SKU being listed on this marketplace. \"unsuppress\" — the SKU is currently suppressed by a rule that the previewed rule set no longer asserts, so the next run would clear it and the listing would return. Suppressions the store set by hand are never previewed as cleared.\n"
          },
          "matched_rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that would suppress the listing. Null for \"unsuppress\" — a clear is the absence of a match, so there is no rule to attribute.\n"
          },
          "matched_rule_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "The DSL rule string of the matched rule; null for \"unsuppress\"."
          },
          "matched_rule_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The matched rule's name; null for \"unsuppress\"."
          }
        }
      },
      "RepriceRuleSnapshot": {
        "type": "object",
        "description": "A rule as it existed at the moment a reprice job was created. Captured so history reflects the rules that actually ran, even if the rule was later edited or deleted.",
        "required": [
          "rule_uuid",
          "rule_name",
          "rule_source",
          "sequence_index"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rule_name": {
            "type": "string",
            "description": "User-defined name for the rule"
          },
          "rule_source": {
            "type": "string",
            "description": "DSL source of the rule at execution time"
          },
          "sequence_index": {
            "type": "integer",
            "description": "Position of the rule in the store's ordered rule list"
          }
        }
      },
      "RepriceSchedule": {
        "type": "object",
        "required": [
          "repricing_hours"
        ],
        "properties": {
          "repricing_hours": {
            "type": "array",
            "description": "Hours of day (0-23, UTC) at which the store reprices automatically. Sorted ascending with duplicates removed. Empty means disabled.\n",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 23
            }
          }
        }
      },
      "RepriceCoverageGapType": {
        "type": "string",
        "enum": [
          "no_rule_matched",
          "stocked_unpriced"
        ],
        "description": "Why repricing left this SKU alone. `no_rule_matched` — it was priced, and no enabled price rule matched it (the identity behind `RepriceSummary.unmatched`). A `DO NOT LIST ON` match doesn't count, since that rule sets no price. `stocked_unpriced` — it has physical stock but no price, and no rule could give it a first one (the identity behind `RepriceSummary.needs_attention`).\n"
      },
      "RepriceCoverageGap": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "gap_type",
          "uncovered_since"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "gap_type": {
            "$ref": "#/components/schemas/RepriceCoverageGapType"
          },
          "uncovered_since": {
            "type": "string",
            "format": "date-time",
            "description": "When this gap was first observed, not when it was last seen — a run that re-observes an existing gap leaves the stamp alone, so this reads as how long the card has gone uncovered. A gap that is fixed and later reappears gets a fresh stamp.\n"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the SKU is not in the catalog — itself an ordinary reason for no rule to have matched it, so these rows are listed rather than dropped.\n"
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "retail_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The price that stood still. Set for a `no_rule_matched` SKU; null for a `stocked_unpriced` one, which has no price at all — that is what makes it a gap.\n"
          }
        }
      },
      "RepriceWatchlist": {
        "type": "object",
        "required": [
          "game",
          "max_cards",
          "cards"
        ],
        "properties": {
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "max_cards": {
            "type": "integer",
            "description": "The most cards one game's list holds, which is what one preview evaluates."
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepriceWatchlistCard"
            }
          }
        }
      },
      "RepriceWatchlistCard": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "added_at"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Null, like the other catalog fields, when the catalog no longer resolves the SKU. The card stays listed so it can be removed; leave it out of a preview, which needs the product id.\n"
          },
          "condition": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "finish": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "rarity": {
            "type": [
              "string",
              "null"
            ]
          },
          "retail_price": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The store's current price, in the store's currency. Null for a card it has never priced."
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RepriceCoverageGapList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "gaps",
              "counts_by_type"
            ],
            "properties": {
              "gaps": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepriceCoverageGap"
                }
              },
              "counts_by_type": {
                "type": "object",
                "required": [
                  "no_rule_matched",
                  "stocked_unpriced"
                ],
                "description": "Unfiltered totals per gap type, for labelling the filter controls. Unlike `total`, these ignore the request's filters — a count that shrank as you typed in the search box would be useless there.\n",
                "properties": {
                  "no_rule_matched": {
                    "type": "integer"
                  },
                  "stocked_unpriced": {
                    "type": "integer"
                  }
                }
              },
              "job_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "The reprice run these rows came from. Null for a store that has never completed one. A cancelled or failed run can leave its partial rows beside the previous run's until the next completed run reconciles the store, in which case this is the freshest run represented.\n"
              },
              "generated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When that run completed."
              }
            }
          }
        ]
      },
      "RepriceSummary": {
        "type": "object",
        "required": [
          "avg_change_pct",
          "max_increase",
          "max_decrease",
          "increases",
          "decreases",
          "unchanged"
        ],
        "properties": {
          "avg_change_pct": {
            "type": "number",
            "format": "double",
            "description": "Average price change as a percentage across all affected inventory"
          },
          "max_increase": {
            "type": "number",
            "format": "double",
            "description": "Largest single price increase in USD. 0 when there are no increases."
          },
          "max_decrease": {
            "type": "number",
            "format": "double",
            "description": "Largest single price decrease in USD (positive number). 0 when there are no decreases."
          },
          "increases": {
            "type": "integer",
            "description": "Number of inventory whose price increased"
          },
          "decreases": {
            "type": "integer",
            "description": "Number of inventory whose price decreased"
          },
          "unchanged": {
            "type": "integer",
            "description": "Number of inventory matched by rules but whose price did not change"
          },
          "unmatched": {
            "type": "integer",
            "description": "Priced, in-stock inventory no enabled rule matched at all (#1396) — a coverage gap in the store's ruleset, distinct from `unchanged` (matched a rule, price didn't move). Price-locked SKUs are excluded (they are reported as `skipped_locked`; no price rule can match one, so counting them here sent owners hunting for cards they had pinned on purpose). Exactly the number of `no_rule_matched` rows returned by `GET /v1/stores/{store_uuid}/reprice/coverage-gaps`, which is the drill-down: this is a count of those rows, not a parallel estimate.\n"
          },
          "needs_attention": {
            "type": "integer",
            "description": "Stocked-but-unpriced SKUs this run could not give a first price, because no enabled rule matched them. Drill down via `GET /v1/stores/{store_uuid}/reprice/coverage-gaps` filtered to `gap_type=stocked_unpriced`, which returns exactly these SKUs.\n"
          },
          "new": {
            "type": "integer",
            "description": "SKUs this run gave a first price to — stocked but previously unpriced, and matched by a rule that could price them.\n"
          },
          "skipped_locked": {
            "type": "integer",
            "description": "The store's price-locked SKUs, which every rule's UPDATE excludes. Deliberately not a coverage gap: they are pinned on purpose, so they are absent from `unmatched` and from the coverage-gaps list, and this is where they are accounted for instead.\n"
          },
          "suppressed_count": {
            "type": "integer",
            "description": "SKU/marketplace pairs a `DO NOT LIST ON` rule newly suppressed this run (#1193). Distinct from the price-domain fields above — a suppression writes no price — so a suppression-only run can report nonzero here with every other count at zero.\n"
          },
          "cleared_count": {
            "type": "integer",
            "description": "SKU/marketplace pairs the per-chunk sweep cleared this run because no enabled rule re-asserted them (#1193) — a deleted or disabled rule, a condition that stopped matching, or a marketplace dropped from the rule's action.\n"
          },
          "skipped_unstocked": {
            "type": "integer",
            "description": "Priced SKUs the run did not reprice because the store holds no copies of them (#3183). Their prices and per-marketplace overrides are left as they are, and they are not coverage gaps. `DO NOT LIST ON` rules still apply to them. Price-locked SKUs are excluded; they are counted in `skipped_locked`.\n"
          },
          "restocked": {
            "type": "integer",
            "description": "SKUs a previous run skipped for having no stock that this run found in stock again and repriced (#3183). Their price writes, base and per-marketplace, skipped the rule's `GUARD` this once, because their current price is the one they sold out at. A restocked SKU no rule priced this run is not counted, and keeps its exemption.\n"
          },
          "refresh": {
            "type": "object",
            "description": "How the pre-pricing price refresh went, keyed by source (`tcgplayer`, `manapool`, `cardkingdom`). Only sources that were refreshed for this run appear; empty when none were. Prices are refreshed so a run prices from data under an hour old.\n",
            "additionalProperties": {
              "type": "object",
              "required": [
                "requested",
                "refreshed",
                "failed",
                "reused",
                "refresh_seconds"
              ],
              "properties": {
                "requested": {
                  "type": "integer",
                  "description": "Price units this run needed from the source."
                },
                "refreshed": {
                  "type": "integer",
                  "description": "Units freshly fetched for this run."
                },
                "failed": {
                  "type": "integer",
                  "description": "Units the refresh could not fetch."
                },
                "reused": {
                  "type": "integer",
                  "description": "Units already fresh enough, so no fetch was needed."
                },
                "refresh_seconds": {
                  "type": "number",
                  "description": "How long the run waited on the refresh, in seconds."
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "description": "Problems the run worked around rather than failed on; the job still completes. Absent when there were none. `fx_rate_unavailable` (FX-4): the store had no exchange rate to `currency`, so every platform price quoted in it read as missing this run (never converted 1:1). `price_refresh_incomplete`: some prices for `source` could not be refreshed in time, so those cards were priced from the last stored prices (the oldest observed at `oldest_observed_at`). The next run tries again.\n",
            "items": {
              "type": "object",
              "required": [
                "code",
                "detail"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "fx_rate_unavailable",
                    "price_refresh_incomplete"
                  ]
                },
                "currency": {
                  "type": "string",
                  "description": "ISO 4217 code of the currency with no rate (`fx_rate_unavailable`)."
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "tcgplayer",
                    "manapool",
                    "cardkingdom"
                  ],
                  "description": "The price source that was not fully refreshed (`price_refresh_incomplete`)."
                },
                "sku_count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "How many prices could not be refreshed (`price_refresh_incomplete`). Null when the refresh failed before anything was requested.\n"
                },
                "oldest_observed_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When the stalest of the prices the run fell back to was last quoted by the source (`price_refresh_incomplete`). Null when unknown.\n"
                },
                "detail": {
                  "type": "string",
                  "description": "What happened and what to do, for the store."
                }
              }
            }
          }
        }
      },
      "ReturnsReportResponse": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "rows",
          "totals"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnsReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/ReturnsReportTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/ReturnsReportCurrency"
            }
          }
        }
      },
      "ReturnsReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnsReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/ReturnsReportTotals"
          }
        }
      },
      "ReturnsReportRow": {
        "type": "object",
        "required": [
          "date",
          "marketplace",
          "return_count",
          "return_value_usd"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "marketplace": {
            "type": "string"
          },
          "return_count": {
            "type": "integer"
          },
          "return_value_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "ReturnsReportTotals": {
        "type": "object",
        "required": [
          "return_count",
          "return_value_usd"
        ],
        "properties": {
          "return_count": {
            "type": "integer"
          },
          "return_value_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          }
        }
      },
      "Rule": {
        "type": "object",
        "required": [
          "rule_uuid",
          "sequence_index",
          "rule",
          "name",
          "is_enabled",
          "currency",
          "game",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "sequence_index": {
            "type": "integer"
          },
          "rule": {
            "type": "string",
            "description": "DSL rule string"
          },
          "name": {
            "type": "string",
            "description": "User-defined name for the rule"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "game": {
            "$ref": "#/components/schemas/GameId",
            "description": "TCG this rule scopes to."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RuleCreateInput": {
        "type": "object",
        "required": [
          "rule",
          "name",
          "game"
        ],
        "properties": {
          "rule": {
            "type": "string",
            "description": "DSL rule string."
          },
          "name": {
            "type": "string",
            "description": "User-defined name for the rule."
          },
          "game": {
            "$ref": "#/components/schemas/GameId"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "description": "1-based position within this game's evaluation order. Appends to the end when omitted.\n"
          }
        }
      },
      "RuleRepriceChange": {
        "type": "object",
        "required": [
          "job_uuid",
          "job_created_at",
          "tcgplayer_sku_id",
          "price_before",
          "price_after",
          "created_at"
        ],
        "properties": {
          "job_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The reprice job that produced this change"
          },
          "job_created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the reprice job was created"
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "Parent product ID (resolved from global_identifiers)"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card or product name."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set or expansion name (e.g. \"Murders at Karlov Manor\")."
          },
          "set_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short set abbreviation (e.g. \"MKM\")."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product image URL from the catalog."
          },
          "price_before": {
            "type": "number",
            "format": "double",
            "description": "Price before this reprice execution"
          },
          "price_after": {
            "type": "number",
            "format": "double",
            "description": "Price after this reprice execution"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the snapshot row was created"
          }
        }
      },
      "TradeReportResponse": {
        "type": "object",
        "required": [
          "from",
          "to",
          "summary",
          "trades",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "summary": {
            "$ref": "#/components/schemas/TradeReportSummary"
          },
          "trades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradeReportTrade"
            }
          },
          "total": {
            "type": "integer",
            "description": "Trades in the whole range, not the page."
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "TradeReportSummary": {
        "type": "object",
        "required": [
          "trade_count",
          "card_count",
          "cash_paid",
          "credit_paid",
          "by_payout_method"
        ],
        "properties": {
          "trade_count": {
            "type": "integer"
          },
          "card_count": {
            "type": "integer",
            "description": "Cards bought (the sum of accepted quantities)."
          },
          "cash_paid": {
            "type": "string",
            "description": "Decimal string with two places."
          },
          "credit_paid": {
            "type": "string",
            "description": "Decimal string with two places."
          },
          "by_payout_method": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradeReportPayoutMethodRow"
            }
          }
        }
      },
      "TradeReportPayoutMethodRow": {
        "type": "object",
        "required": [
          "payout_method",
          "payout_type",
          "trade_count",
          "cash_paid",
          "credit_paid"
        ],
        "properties": {
          "payout_method": {
            "type": [
              "string",
              "null"
            ],
            "description": "The store's own label for how the trade was paid; null when none was recorded."
          },
          "payout_type": {
            "type": "string",
            "enum": [
              "cash",
              "credit"
            ]
          },
          "trade_count": {
            "type": "integer"
          },
          "cash_paid": {
            "type": "string"
          },
          "credit_paid": {
            "type": "string"
          }
        }
      },
      "TradeReportTrade": {
        "type": "object",
        "required": [
          "purchase_uuid",
          "buylist_number",
          "pushed_at",
          "customer_name",
          "source",
          "intake_kind",
          "payout_method",
          "payout_type",
          "cash_paid",
          "credit_paid",
          "card_count"
        ],
        "properties": {
          "purchase_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "buylist_number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "pushed_at": {
            "type": "string",
            "format": "date-time"
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          },
          "intake_kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "payout_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "payout_type": {
            "type": "string",
            "enum": [
              "cash",
              "credit"
            ]
          },
          "cash_paid": {
            "type": "string"
          },
          "credit_paid": {
            "type": "string"
          },
          "card_count": {
            "type": "integer"
          }
        }
      },
      "SalesReportResponse": {
        "type": "object",
        "required": [
          "period",
          "from",
          "to",
          "rows",
          "totals"
        ],
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ]
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/SalesReportTotals"
          },
          "by_currency": {
            "type": "array",
            "description": "Every currency the range's orders are in, the store's own first (#3736). `rows` and `totals` above are the store-currency entry; an order in another currency (a CAD Snapcaster order on a USD store) is reported here and never summed into them. The `_usd` suffix on the amounts is historical: each entry's amounts are in its `currency`.",
            "items": {
              "$ref": "#/components/schemas/SalesReportCurrency"
            }
          }
        }
      },
      "SalesReportCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows",
          "totals"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency of this entry's orders."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SalesReportRow"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/SalesReportTotals"
          }
        }
      },
      "SalesReportRow": {
        "type": "object",
        "required": [
          "date",
          "revenue_usd",
          "units_sold",
          "order_count"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Truncated date for the grouping period."
          },
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Total revenue for this period, in the store's currency (the `_usd` suffix is historical)."
          },
          "units_sold": {
            "type": "integer",
            "description": "Total units sold in this period."
          },
          "order_count": {
            "type": "integer",
            "description": "Number of distinct orders in this period."
          },
          "marketplace": {
            "type": "string",
            "description": "Present when a marketplace filter was applied."
          }
        }
      },
      "SalesReportTotals": {
        "type": "object",
        "required": [
          "revenue_usd",
          "units_sold",
          "order_count"
        ],
        "properties": {
          "revenue_usd": {
            "type": "number",
            "format": "double",
            "description": "Amount in the store's currency (the `_usd` suffix is historical)."
          },
          "units_sold": {
            "type": "integer"
          },
          "order_count": {
            "type": "integer"
          }
        }
      },
      "UntrackedSalesReportResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "from",
              "to",
              "rows"
            ],
            "properties": {
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              },
              "rows": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UntrackedSalesReportRow"
                }
              }
            }
          }
        ]
      },
      "UntrackedSalesReportRow": {
        "description": "One untracked (non-HL) order line (#1362) -- a marketplace-rung sale with no HippoLink catalog match. Matched live against `order_items.billable`: a line the admin reclassification endpoint (#1363) has since flipped `billable = TRUE` stops appearing on the report's very next read.\n",
        "type": "object",
        "required": [
          "order_item_uuid",
          "order_uuid",
          "marketplace",
          "marketplace_order_id",
          "ordered_at",
          "item_name",
          "item_variation",
          "quantity",
          "unit_price",
          "line_total"
        ],
        "properties": {
          "order_item_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "marketplace": {
            "type": "string",
            "description": "The marketplace the order was placed on."
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The marketplace's own order identifier."
          },
          "ordered_at": {
            "type": "string",
            "format": "date-time"
          },
          "item_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace-provided line item name -- no HippoLink catalog product exists for a non-HL line.\n"
          },
          "item_variation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marketplace-provided variation/detail text, when the marketplace supplied one."
          },
          "quantity": {
            "type": "integer"
          },
          "unit_price": {
            "type": "number",
            "format": "double"
          },
          "line_total": {
            "type": "number",
            "format": "double",
            "description": "quantity * unit_price."
          }
        }
      },
      "SellThroughBySetResponse": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SellThroughBySetRow"
            },
            "description": "One row per set, sorted by sell_through_pct DESC then set_code ASC."
          },
          "by_currency": {
            "type": "array",
            "description": "One entry per currency other than the store's that the store's orders are in (#3736); empty when there are none. `rows` above are the store-currency figures, and revenue in another currency is never summed into them.",
            "items": {
              "$ref": "#/components/schemas/SellThroughCurrency"
            }
          }
        }
      },
      "SellThroughCurrency": {
        "type": "object",
        "required": [
          "currency",
          "rows"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "ISO 4217 currency the revenue behind `avg_sale_price_usd` is in."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SellThroughBySetRow"
            },
            "description": "Same shape as the response's `rows`, with `avg_sale_price_usd` taken over this currency's orders only. Stock and copies sold are the same as in `rows`.\n"
          }
        }
      },
      "SellThroughBySetRow": {
        "type": "object",
        "required": [
          "set_code",
          "set_name",
          "total_copies_in_stock",
          "total_copies_sold",
          "sell_through_pct",
          "avg_sale_price_usd"
        ],
        "properties": {
          "set_code": {
            "type": "string",
            "description": "TCGPlayer / MTGJSON set code (e.g. \"MKM\")."
          },
          "set_name": {
            "type": "string",
            "description": "Display name of the set."
          },
          "total_copies_in_stock": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Sum of physical inventory (`inventory_locations_storage.total_quantity`) across all SKUs in this set."
          },
          "total_copies_sold": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Lifetime non-canceled order quantity across all SKUs in this set."
          },
          "sell_through_pct": {
            "type": "number",
            "format": "float",
            "minimum": 0,
            "maximum": 100,
            "description": "sold / (sold + in_stock) * 100, rounded to 1 decimal."
          },
          "avg_sale_price_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "Revenue-weighted average unit price, in the store's currency (the `_usd` suffix is historical), rounded to 2 decimals. Null when total_copies_sold is 0."
          }
        }
      },
      "VoidShippingLabelRequest": {
        "type": "object",
        "properties": {
          "force": {
            "type": "boolean",
            "default": false,
            "description": "Discard the label locally when the carrier permanently refuses to void it (`carrier_void_refused`). The carrier is still asked first, so a refundable label is always refunded rather than thrown away; this only changes what happens after a refusal. It is not a general override — an in-transit shipment, a throttled or unreachable carrier, and a dead carrier credential all refuse exactly as they do without it. Send it only after the user has been told the postage is not refundable.\n"
          }
        }
      },
      "VoidShippingLabelResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Shipment"
          },
          {
            "type": "object",
            "required": [
              "marketplace_still_shipped"
            ],
            "properties": {
              "marketplace_still_shipped": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Set when the marketplace was already told this order shipped on the voided label. A void makes no marketplace call, so the marketplace keeps showing it shipped (with this label's tracking) until something replaces it. Null when the marketplace was never told: the order's marketplace takes no shipped push, the push was still deferred to its run's \"Mark all as shipped\", or it failed.\n",
                "required": [
                  "marketplace",
                  "tracking_number",
                  "replaced_on_reship",
                  "detail"
                ],
                "properties": {
                  "marketplace": {
                    "type": "string",
                    "description": "The order's marketplace (`MARKETPLACES` value)."
                  },
                  "tracking_number": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The voided label's tracking number, null for a label without one."
                  },
                  "replaced_on_reship": {
                    "type": "boolean",
                    "description": "True when the next label's push replaces the tracking on the marketplace (ManaPool, Misprint). False means the seller has to correct it on the marketplace by hand.\n"
                  },
                  "detail": {
                    "type": "string",
                    "description": "A sentence for the seller saying what the marketplace shows and what to do."
                  }
                }
              }
            }
          }
        ]
      },
      "Shipment": {
        "type": "object",
        "required": [
          "shipment_uuid",
          "order_uuid",
          "ri_uuid",
          "easypost_shipment_id",
          "carrier",
          "service",
          "tracking_number",
          "tracking_url",
          "tracking_status",
          "label_url",
          "label_format",
          "rate_paid",
          "rate_currency",
          "voided",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "shipment_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The order this label belongs to, or null when it belongs to a TCGplayer Direct RI parcel instead (#2002) -- an RI is a scraped invoice, not an order, so it has none. Exactly one of `order_uuid` / `ri_uuid` is set; a database CHECK is what keeps that true.\n"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The TCGplayer Direct reimbursement invoice this label belongs to, or null for the ordinary order-owned case. See `order_uuid`.\n"
          },
          "easypost_shipment_id": {
            "type": "string",
            "description": "EasyPost shipment ID"
          },
          "carrier": {
            "type": "string",
            "description": "Carrier name (e.g. USPS, UPS, FedEx)"
          },
          "service": {
            "type": "string",
            "description": "Service level (e.g. First, Priority, Ground)"
          },
          "tracking_number": {
            "type": "string"
          },
          "tracking_url": {
            "type": "string",
            "format": "uri"
          },
          "tracking_status": {
            "$ref": "#/components/schemas/TrackingStatus"
          },
          "tracking_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackingEvent"
            }
          },
          "tracking_unavailable": {
            "type": "string",
            "enum": [
              "credential_invalid",
              "rate_limited",
              "carrier_error"
            ],
            "description": "Present only when the live tracking read failed, saying **why**. Absent on a successful read.\n\nA tracking read never fails the shipment view — the response still returns 200 with an empty `tracking_details`. But \"we could not ask the carrier\" and \"the carrier has no scans yet\" are different facts, and collapsing them made a dead credential, a throttle, and a genuinely untracked parcel indistinguishable (#1667). Use this to say \"we could not reach the carrier\" rather than implying the parcel has not moved. `credential_invalid` additionally means the store needs to reconnect — the same condition that raises the carrier's `*_DISCONNECTED` banner.\n"
          },
          "label_url": {
            "type": "string",
            "format": "uri",
            "description": "URL to download the shipping label. For ShipStation this is a public, signed download link (valid ~90 days).\n"
          },
          "label_format": {
            "$ref": "#/components/schemas/LabelFormat"
          },
          "rate_paid": {
            "type": "number",
            "format": "double",
            "description": "Amount paid for the label, in `rate_currency`, including any signature confirmation and insurance charges.\n"
          },
          "rate_currency": {
            "type": "string",
            "description": "ISO 4217 code `rate_paid` is in, as the provider billed it (#4080). USD for every label bought before the field existed. A stamp or pickup record ($0) carries the order's currency.\n"
          },
          "signature_confirmation": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "signature",
              "adult_signature",
              null
            ],
            "description": "The delivery confirmation the carrier reports this label was bought with, or null for none (#2844). The carrier's answer rather than the request's, so it is the one to trust when checking a marketplace's signature requirement.\n"
          },
          "insured_value": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Declared value the parcel is insured for, in `insured_currency`, or null when uninsured.\n"
          },
          "insured_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code `insured_value` is in (#4080): the currency the rate was quoted in. Null exactly when `insured_value` is; USD for a label bought before the field existed.\n"
          },
          "parcel": {
            "description": "The parcel this label was declared in (#3537), or null for a label bought before parcels were recorded.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ShipmentParcel"
              },
              {
                "type": "null"
              }
            ]
          },
          "voided": {
            "type": "boolean",
            "description": "Whether the label has been voided/refunded"
          },
          "voided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the label was voided, or null while it is not voided."
          },
          "refund_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "submitted",
              "refunded",
              "rejected",
              "not_applicable",
              "unconfirmed",
              null
            ],
            "description": "Where a voided label's postage refund stands at the carrier (#4572). `submitted` is pending and re-checked daily; `refunded` came back; `rejected` and `not_applicable` did not; `unconfirmed` was never settled within 45 days of the void. Null when there is nothing to follow: a label that is not voided, a label-less shipment, a forced discard, a provider that settles the void at once (ShipStation, Pitney Bowes), or a void from before the field.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "scan_form": {
            "description": "The USPS SCAN form this label is on, or null. A label is on at most one form; this is how the order page shows it and reprints it. `document_url` is presigned fresh on every read.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ScanFormSummary"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ScanFormSummary": {
        "type": "object",
        "required": [
          "scan_form_uuid",
          "status",
          "ship_date",
          "shipment_count",
          "document_url",
          "created_at"
        ],
        "properties": {
          "scan_form_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "creating",
              "ready",
              "failed"
            ]
          },
          "ship_date": {
            "type": "string",
            "format": "date"
          },
          "shipment_count": {
            "type": "integer",
            "description": "How many labels the form holds."
          },
          "document_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A short-lived link to the form PDF while `ready`; null otherwise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SkippedShippingLabel": {
        "type": "object",
        "description": "An order whose label did not make it into the merged PDF.",
        "required": [
          "order_uuid",
          "reason"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "enum": [
              "timed_out",
              "unavailable"
            ],
            "description": "`timed_out` -- the carrier was throttling, was too slow, or the request's download budget ran out before this label's turn. Repeating the request for the same run is worth doing: the labels that already arrived come from cache, so the retry spends its whole budget on the few still missing.\n\n`unavailable` -- the link is dead or what it returned is not a document that can be placed on a page. Repeating will not help; print that order's label from the order itself.\n"
          }
        }
      },
      "ShippingLabelBatch": {
        "type": "object",
        "description": "A merged, ready-to-print shipping-label PDF and what went into it.",
        "required": [
          "download_url",
          "expires_at",
          "printed",
          "skipped"
        ],
        "properties": {
          "download_url": {
            "type": "string",
            "format": "uri",
            "description": "Presigned link to the merged PDF. Open it directly (a tab, a print view); it needs no Authorization header and cannot be fetched cross-origin.\n"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the link stops working. The object itself is deleted the next day."
          },
          "printed": {
            "type": "integer",
            "description": "How many of the requested orders contributed a label. Lower than the request when an order has no live shipment or ended up in `skipped`.\n"
          },
          "skipped": {
            "type": "array",
            "description": "Orders that contributed no label, and why. Empty when every order with a live shipment printed.\n",
            "items": {
              "$ref": "#/components/schemas/SkippedShippingLabel"
            }
          }
        }
      },
      "SignatureConfirmationRequest": {
        "type": "string",
        "enum": [
          "none",
          "signature",
          "adult_signature"
        ],
        "description": "The delivery confirmation to quote rates with. `signature` is the carrier's ordinary Signature Confirmation (what TCGplayer requires at $250+); `adult_signature` requires an adult at the address. `none` quotes without one even when the order's rules or marketplace would default to one. **Omit the field to take the order's default.**\n"
      },
      "InsuredValueRequest": {
        "type": "number",
        "format": "double",
        "minimum": 0,
        "description": "Declared value to insure the parcel for, in the currency the store's provider insures this order in (`insurance_currency` on the rates response: the order's own when the provider takes it, else the provider's; USD for every provider today). `0` quotes uninsured even when a shipping rule would insure the order. **Omit the field to take the order's default**: a rule's `insure` declares the order total, converted to that currency at the store's applied exchange rate, and quotes uninsured when the store has no applied rate for it (#3958). Who underwrites it depends on the store's provider: EasyPost's own insurance, the carrier's declared-value cover through ShipStation, USPS Insured Mail through Pitney Bowes.\n"
      },
      "ShippingAction": {
        "type": "object",
        "description": "What a matching shipping rule does. A rule may set a package (`parcel`), a rate choice (a `service_id`, a `packaging` tier, a `cheapest`/`cheapest_of` strategy, or `carrier` + `service`), label add-ons, or any mix of them -- a package-only rule is valid. `carrier` + `service` are required only for the default `fixed` strategy with no `service_id`, no `packaging` tier **and** no package or add-on, and a lone `carrier` or lone `service` is always refused on the missing half. Because the requirement is conditional it is not expressible in `required`, and is enforced at write time with a 422.\n",
        "properties": {
          "carrier": {
            "type": "string",
            "description": "Carrier **display name** (e.g. USPS, UPS, FedEx). Ignored when the rule targets a packaging tier or a synthetic option (see packaging and service). Kept for display and as the legacy match path; prefer `carrier_code`.\nOn `cheapest`/`cheapest_of` this narrows the candidate set to one carrier, the same as on a fixed rule — `carrier_code` takes precedence when both are set.\n"
          },
          "service": {
            "type": "string",
            "description": "Service **display label** (e.g. Priority, Ground). Set to `Plain White Envelope` to target the legacy PWE synthetic option — the rule then recommends it regardless of carrier. For a packaging tier, prefer `packaging`.\nMatching on this string is the legacy path, kept so rules stored before `service_code` existed keep working. It is not stable: it is the provider's human-facing label, and a rename silently kills any rule that matches on it. New rules should set `service_code`.\n"
          },
          "service_id": {
            "type": "string",
            "description": "A HippoLink shipping service (`ShippingCatalogEntry.service_id`), for the `fixed` strategy. **What a new rule should set.** It names the same service under every provider, so the rule keeps matching after the store switches provider; the engine tries it first and then the provider fields below. An unknown id is a 422 (`invalid_choice` on `then.service_id`), as is one sent with another strategy. One the store's provider account hasn't enabled is saved, with a warning.\n"
          },
          "service_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The HippoLink services `cheapest_of` may choose between, in place of `service_codes` (when both are set these win). Unknown ids are a 422 (`invalid_choice` on `then.service_ids`), as is a non-empty list on another strategy. The legacy `carrier`/`carrier_code` do not narrow an id list.\n"
          },
          "carrier_code": {
            "type": "string",
            "description": "The provider's stable carrier identifier, as returned by `getShippingCatalog` and carried on every `ShippingRate`. Optional; when set it narrows a `service_code` match to one carrier.\n"
          },
          "service_code": {
            "type": "string",
            "description": "The provider's stable service identifier, as returned by `getShippingCatalog`. **This is what a new rule should match on.** When present the engine matches on it first and falls back to the carrier/service display strings only if no rate carries the code — so a rule keeps working if a provider stops emitting one.\n"
          },
          "package_type": {
            "type": "string",
            "description": "Optional parcel shape (ShipStation `package_type`, Pitney Bowes `parcelType`). Narrows a `service_code` match when one service is quoted at several package types at different prices — the case that previously forced the disambiguating suffix in the `service` display string.\nIt narrows `cheapest`/`cheapest_of` too. Keep it when moving a rule to one of those: an untracked letter is always cheaper than the tracked package quoted under the same `service_code`, so dropping the pin silently downgrades the shipment.\n"
          },
          "strategy": {
            "type": "string",
            "enum": [
              "fixed",
              "cheapest",
              "cheapest_of"
            ],
            "default": "fixed",
            "description": "How the rule picks a rate. Omitted means `fixed`, so every rule stored before strategies existed behaves exactly as before.\n\n`fixed` names one rate and matches nothing whenever that rate is not quoted — for any reason, including ones unrelated to the rule being wrong (the parcel was too heavy for it, the carrier was not connected that day, the service is suspended for that destination). `cheapest` and `cheapest_of` name a *set* and take the lowest-priced member, so an unavailable service degrades to a different price rather than to a silent non-match.\n\nSynthetic options (stamp tiers, PWE, local pickup) are never selected by `cheapest`/`cheapest_of` — they are fixed estimates and pickup is $0, so they would always win. Reach those deliberately, via `packaging` or by name.\n"
          },
          "service_codes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The services `cheapest_of` may choose between. **Required and non-empty** for that strategy: an empty list would quietly behave as `cheapest` and could buy a service the seller deliberately excluded, so it is rejected instead. Rejected (422) on any other strategy for the same reason — no strategy but `cheapest_of` reads it, and a silently-ignored allow-list has the same failure mode as an empty one.\n"
          },
          "max_cost_usd": {
            "type": "number",
            "format": "double",
            "description": "Optional ceiling for `cheapest`/`cheapest_of`. A rate above it is not selected; if every rate is above it the rule matches nothing and the next rule is tried. Rejected (422) on a `fixed` rule, which names one rate and never consults it — accepting it there would silently drop a cap the seller believes is enforced.\n"
          },
          "max_delivery_days": {
            "type": "integer",
            "description": "Optional ceiling on the carrier's own delivery estimate, for `cheapest`/`cheapest_of`. A rate carrying no estimate is **not** excluded — a carrier that declines to guess should not be dropped for it. Rejected (422) on a `fixed` rule, same as `max_cost_usd`.\n"
          },
          "prefer_negotiated": {
            "type": "boolean",
            "default": false,
            "description": "When the response contains any rate flagged as the store's own negotiated pricing, choose only among those. Reflects `ShippingRate.negotiated_rate`, which only ShipStation reports today; a no-op for providers that always report false. Rejected (422) on a `fixed` rule, which never consults it.\n"
          },
          "packaging": {
            "type": "string",
            "enum": [
              "physical_postage",
              "pwe_1oz",
              "pwe_2oz",
              "large_letter",
              "bubble_mailer"
            ],
            "description": "Optional packaging tier (#1015). When set, the rule matches on this key rather than the carrier/service string: a stamp tier resolves to the estimate-only synthetic option, and `bubble_mailer` drives the parcel dims + pack instruction but still needs carrier + service to select a concrete tracked rate.\n`physical_postage` is the stamp tier to author against. `pwe_1oz`, `pwe_2oz` and `large_letter` are **retired but still valid**: existing rules naming one keep working and resolve onto `physical_postage`, so nothing has to be re-saved, but new rules should not use them.\nA **stamp** tier is rejected (422) alongside `cheapest`/`cheapest_of`, which never select a synthetic option: the rule would buy a real tracked label while reporting a stamp tier, and that key is what decides the label-less vs tracked purchase path. `bubble_mailer` composes with either strategy — there it supplies only the parcel dims and the pack instruction.\n"
          },
          "signature_confirmation": {
            "type": "string",
            "enum": [
              "signature",
              "adult_signature"
            ],
            "description": "Require this delivery confirmation on orders the rule's `when` matches — e.g. \"marketplace is TCGPLAYER and order_total >= 250\". getShippingRates then quotes every carrier rate with it unless the caller overrides.\n\nThis is a requirement on the **order**, resolved before rates are shopped and independently of which rule's rate ends up recommended: the highest-priority matching rule that sets it wins, even if that rule's own carrier/service is not quoted and a later rule supplies the recommendation. A rule cannot say \"no signature\", so a higher-priority rule that leaves this unset does not cancel a lower one that sets it. Rejected (422) alongside a stamp `packaging` tier, which buys no label.\n"
          },
          "insure": {
            "type": "boolean",
            "default": false,
            "description": "Insure orders the rule's `when` matches for their order total. Resolved the same way as `signature_confirmation`, and rejected (422) alongside a stamp `packaging` tier for the same reason.\n"
          },
          "parcel": {
            "$ref": "#/components/schemas/RuleParcel",
            "description": "The package orders this rule matches are quoted in (#3537). Resolved before rates are shopped, like the add-ons: the first enabled rule by priority whose `when` matches and that sets a package supplies it, whichever rule's rate is recommended, and a matching rule without one does not shadow a later rule that has one. A letter or flat is quoted straight away; a package (or a letter or flat forced up by an add-on or a tracking requirement) has no size, so getShippingRates answers 422 `parcel_required` until the order's size is sent. A saved sealed size, and a request `parcel`, both win over it. A rule with no conditions placed last acts as the store's default. Alongside a stamp `packaging` tier the tier decides the purchase path and the package decides what is quoted. Not applied to a CardTrader Zero hub parcel.\n"
          }
        }
      },
      "ShippingCondition": {
        "type": "object",
        "required": [
          "field",
          "op",
          "value"
        ],
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "order_total",
              "item_count",
              "card_count",
              "contains_sealed",
              "sealed_quantity",
              "singles_count",
              "max_single_price",
              "sealed_categories",
              "pack_quantity",
              "non_pack_sealed_quantity",
              "max_pack_price",
              "shipping_method_requested",
              "destination_country",
              "destination_state",
              "marketplace"
            ],
            "description": "`item_count` counts order lines (\"Items\"); `card_count` is their summed quantity (\"Cards\", four copies of one card are four). `contains_sealed` is true when any line is a sealed product. `sealed_quantity` is the summed quantity of sealed lines and `singles_count` that of the other lines. `max_single_price` is the highest per-unit price among the singles, 0 when there are none. `sealed_categories` matches with `in` when every sealed line's category is in the list (true when the order has no sealed lines). `pack_quantity` is the summed quantity of sealed lines that are single booster packs, and `non_pack_sealed_quantity` that of every other sealed line (booster boxes and bundles, cases, kits, blisters, multi-packs, and sealed products whose kind is not recognized); the two sum to `sealed_quantity`. `max_pack_price` is the highest per-unit price among the packs, 0 when there are none."
          },
          "op": {
            "type": "string",
            "enum": [
              "eq",
              "gte",
              "lte",
              "in"
            ]
          },
          "value": {
            "description": "Scalar for eq/gte/lte; array for in. For field=marketplace the value(s) must be canonical marketplace name(s) (e.g. TCGPLAYER, MANA_POOL, SHOPIFY, SQUARE, CARD_TRADER). For field=card_count a number of cards, 0 or more (each element for in). For field=contains_sealed op must be eq and the value true or false. For sealed_quantity, singles_count, max_single_price, pack_quantity, non_pack_sealed_quantity and max_pack_price a number, 0 or more. For field=sealed_categories op must be in and the value a non-empty list of: sleeves, deckboxes, playmats, binders, colstorage, counters, other_sealed."
          }
        }
      },
      "ShippingConditionNode": {
        "description": "A node in a shipping rule's condition tree: either a nested logical group (ShippingLogicalCondition, tagged `type: logical`) or a leaf ShippingCondition (field/op/value). The two are distinguished structurally — the logical node has `type: logical` + `terms`, the leaf has `field` — so no discriminator is needed. Nesting is bounded server-side to depth 5 with at most 50 total leaf conditions per rule (422 otherwise).\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ShippingLogicalCondition"
          },
          {
            "$ref": "#/components/schemas/ShippingCondition"
          }
        ]
      },
      "ShippingLogicalCondition": {
        "type": "object",
        "required": [
          "type",
          "operator",
          "terms"
        ],
        "description": "A logical group combining its `terms` with `operator`: AND = every term must match, OR = any term matches. Each term is itself a ShippingConditionNode, so groups nest to express e.g. `A AND (B OR C)`. The root `when` of every rule is one of these. `terms` may be empty **only on the root** `when`: a rule with no conditions matches every order, so placed last it acts as the store's default (#3537). A nested empty group is refused 422, and a one-condition rule is still wrapped in a root group.\n",
        "properties": {
          "type": {
            "type": "string",
            "const": "logical"
          },
          "operator": {
            "$ref": "#/components/schemas/DslLogicalOperator"
          },
          "terms": {
            "type": "array",
            "minItems": 0,
            "items": {
              "$ref": "#/components/schemas/ShippingConditionNode"
            }
          }
        }
      },
      "ShippingRate": {
        "type": "object",
        "required": [
          "rate_id",
          "carrier",
          "service",
          "rate",
          "currency"
        ],
        "properties": {
          "rate_id": {
            "type": "string",
            "description": "Rate identifier — **opaque**; pass it back to purchaseShippingLabel exactly as received, never parse or construct one. It also carries the add-ons the rate was quoted with. For EasyPost it is a `<shipment_id>::<rate_id>` composite, because one rate list can span several server-side shipments (one per candidate parcel shape) and the buy is scoped to the shipment its rate was quoted under. It may instead be a synthetic option id: the stamp option (`hippolink_pkg_physical_postage`, or the retired per-tier `hippolink_pkg_pwe_1oz` / `_pwe_2oz` / `_large_letter`, which still purchase and resolve to it), the legacy `hippolink_pwe` alias, or `hippolink_pickup` (free local pickup, rate 0).\n"
          },
          "carrier": {
            "type": "string",
            "description": "Carrier name (e.g. USPS, UPS, FedEx). Placeholder for synthetic options."
          },
          "service": {
            "type": "string",
            "description": "Display label for the service level. **Not stable** — it is the provider's human-facing string, and for ShipStation a single `service_code` quoted under several package types is disambiguated here (e.g. \"USPS First Class Mail — Letter\"). Render `service_display` instead — this field is the compatibility surface a shipping rule stored without provider codes still matches on, so it keeps its historical wording. It gains a weight suffix in one narrow case only: a service quoted at several parcel weights suffixes the non-authoritative rows, which no stored rule can be pinned to because they were never returned before. Show `service_display`; match on `service_code`.\n"
          },
          "service_display": {
            "type": "string",
            "description": "The label to render for this rate: `service` plus the parcel weight it was quoted under (e.g. \"USPS First Class Mail — Letter (3 oz)\", \"UPS® Ground (3 oz)\"). Present on every rate — a row that said nothing about weight would read as *the* price for that service, which is how a cheaper quote at a lighter shape goes unnoticed. Falls back to `service` when the rate carries no weight (synthetic stamp/pickup options, whose own labels already name a weight, and the rate-batch path). Never match on this; match on `service_code`.\n"
          },
          "carrier_code": {
            "type": "string",
            "description": "The provider's stable identifier for the carrier (ShipStation `carrier_code`, EasyPost's `carrier` such as `UPSDAP`). Empty for a provider that exposes none, and for synthetic options.\n"
          },
          "service_code": {
            "type": "string",
            "description": "The provider's stable identifier for the service — what a shipping rule should store and match on. Empty for a provider that exposes none, and for synthetic options (stamp tiers, PWE, pickup), which are matched by `packaging` instead.\n"
          },
          "package_type": {
            "type": "string",
            "description": "The parcel shape this rate was quoted for, when the provider distinguishes them (ShipStation `package_type`, Pitney Bowes `parcelType`). Carried as its own field rather than folded into `service`, so a client never parses a suffix back out. Empty when the provider does not distinguish.\n"
          },
          "parcel_weight_ounces": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Weight, in ounces, of the parcel shape this rate was priced under. A rate-shop with no explicit `parcel` in the request quotes several candidate shapes, and a carrier prices the same service differently across them — USPS First Class Mail as a `letter` is ~$0.78 at 1oz and ~$1.36 at 3oz. Both are returned; this is how a client tells them apart, and what a picker should render beside the service label. Null on synthetic options and on the rate-batch path, which shops one shape. The response's top-level `parcel` echoes the authoritative shape, which is not necessarily this one.\n"
          },
          "rate": {
            "type": "number",
            "format": "double",
            "description": "Shipping cost in USD"
          },
          "currency": {
            "type": "string",
            "default": "USD"
          },
          "estimated_delivery_days": {
            "type": "integer",
            "description": "Estimated business days for delivery"
          },
          "delivery_date": {
            "type": "string",
            "format": "date-time",
            "description": "Estimated delivery date, if available"
          },
          "packaging": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "physical_postage",
              "pwe_1oz",
              "pwe_2oz",
              "large_letter",
              "bubble_mailer",
              null
            ],
            "description": "Packaging tier key on a synthetic stamp option (#1015); null on real carrier rates and pickup. A shipping rule matches this key against `then.packaging`.\n`physical_postage` is the only stamp tier offered — one $0.00 option meaning \"the seller applies postage by hand\". `pwe_1oz`, `pwe_2oz` and `large_letter` are **retired**: they are still accepted on a stored rule and resolve onto `physical_postage`, but `getShippingCatalog` no longer offers them and no rate carries them, so do not author a new rule against one. They differed only by a USPS retail estimate that was never charged.\n"
          },
          "negotiated_rate": {
            "type": "boolean",
            "default": false,
            "description": "True when this is the store's own negotiated carrier rate rather than a generic/published one (ShipStation only, #1533). Always false for other providers and synthetic options.\n"
          }
        }
      },
      "ShippingRatesResponse": {
        "type": "object",
        "required": [
          "order_uuid",
          "rates",
          "from_address",
          "to_address",
          "parcel",
          "signature_required",
          "tracking_required"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "easypost_shipment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Legacy field. The EasyPost shipment id of the authoritative rate-shop, which is not necessarily the shipment a given rate belongs to — each EasyPost `rate_id` above carries its own. Echo it back on purchase if you like; the rate_id wins where they disagree. Null when the active provider is ShipStation or Pitney Bowes (neither needs a shipment id: ShipStation buys from rate_id + shipping_provider, Pitney Bowes rates statelessly).\n"
          },
          "shipping_provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "description": "The carrier that produced these rates (the store's active provider)."
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShippingRate"
            }
          },
          "recommended_rate_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rate_id pre-selected by the store's shipping rules, or null if no rule matched."
          },
          "recommended_packaging": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "physical_postage",
              "pwe_1oz",
              "pwe_2oz",
              "large_letter",
              "bubble_mailer",
              null
            ],
            "description": "The packaging tier key from the matched rule (#1015), **resolved** — a rule still pinned to a retired stamp key reports `physical_postage` here, matching what `recommended_rate_id` resolved to, so a client can look the key up in getShippingCatalog and always find it. Null if no rule matched or the matching rule targets only a carrier/service. Drives the pack-page instruction (e.g. \"Use: Bubble mailer\").\n"
          },
          "from_address": {
            "$ref": "#/components/schemas/Address"
          },
          "to_address": {
            "$ref": "#/components/schemas/Address"
          },
          "parcel": {
            "description": "The parcel every rate was quoted for, and where it came from (#3537).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResolvedParcel"
              },
              {
                "$ref": "#/components/schemas/PredefinedParcelEcho"
              }
            ]
          },
          "signature_required": {
            "type": "boolean",
            "description": "True when the order's marketplace requires a signature (TCGplayer at $250+; never a CardTrader Zero hub parcel) (#2154). When true, `signature_confirmation` is never `none`: a request that would quote without one is refused 422 `signature_required`.\n"
          },
          "signature_confirmation": {
            "type": "string",
            "enum": [
              "none",
              "signature",
              "adult_signature"
            ],
            "description": "The delivery confirmation every carrier rate in `rates` was quoted with, and so what buying one gets (#2844). Always present. It can be a signature level while `signature_required` is false, when a store rule or the caller asked for one.\n"
          },
          "insured_value": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "The declared value, in `insured_currency`, every carrier rate in `rates` was quoted with; null when uninsured. Always present.\n"
          },
          "insured_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code `insured_value` is in (#3958): the order's own currency when the store's provider insures in it, else the provider's (USD for EasyPost, ShipStation, Pitney Bowes and Shippo). Null exactly when `insured_value` is.\n"
          },
          "insurance_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 code a typed `insured_value` on this order's next quote is read in, so the picker can label the field before anything is insured (#3958). Present whether or not this quote is insured, and equal to `insured_currency` when it is; null only when the store's provider cannot insure a label at all.\n"
          },
          "tracking_required": {
            "type": "boolean",
            "description": "True when this order cannot be shipped untracked (#2238). Two rules feed it: TCGplayer refuses an untracked ship at $50+; a ManaPool buyer who bought a tracked tier (anything but `first_class`, their letter rate) paid for tracking on this order. Surface it *before* the seller picks: buying a stamp tier on such an order is refused 422 `tracking_required`, and marking it shipped with no tracking number is refused the same way. When true, `recommended_rate_id` is suppressed if the store's shipping rule resolved to a stamp or pickup option, so a client's default selection never lands on a rate the purchase will reject.\n"
          },
          "tracking_required_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "A seller-facing sentence explaining the requirement, or null when `tracking_required` is false. Naming the reason matters most on ManaPool, where 95% of tracked orders show $0.00 shipping collected (ManaPool absorbs the postage above their free-tracked threshold) so the order looks like a letter, and the seller has no other way to tell.\n"
          }
        }
      },
      "RateBatchShipmentRates": {
        "type": "object",
        "required": [
          "order_uuid",
          "easypost_shipment_id",
          "rates"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "easypost_shipment_id": {
            "type": "string",
            "description": "EasyPost shipment ID for this order within the batch, echoed back on purchase."
          },
          "shipping_provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "description": "The carrier that produced these rates. Always `easypost` — the rate-batch path is EasyPost-only by construction (only EasyPost supports batching; ShipStation and Pitney Bowes stores rate-shop one order at a time via getShippingRates). Returned explicitly for shape consistency with ShippingRatesResponse.\n"
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShippingRate"
            }
          },
          "recommended_rate_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rate_id pre-selected by the store's shipping rules for this order, or null if no rule matched. Mirrors ShippingRatesResponse.recommended_rate_id (#1451) — the rate-batch path now runs the same rule evaluation as the single-order path.\n"
          },
          "recommended_packaging": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "physical_postage",
              "pwe_1oz",
              "pwe_2oz",
              "large_letter",
              "bubble_mailer",
              null
            ],
            "description": "The packaging tier key from the matched rule (#1015), **resolved** — a rule still pinned to a retired stamp key reports `physical_postage` here, matching what `recommended_rate_id` resolved to, so a client can look the key up in getShippingCatalog and always find it. Null if no rule matched or the matching rule targets only a carrier/service. Mirrors ShippingRatesResponse.recommended_packaging.\n"
          },
          "tracking_required": {
            "type": "boolean",
            "description": "Mirrors ShippingRatesResponse.tracking_required for this order (#2238). Optional rather than required on this shape alone: a batch's rates are cached in `rates_snapshot` once rated, so a batch rated before this field shipped serves rows without it. Treat an absent value as false.\n"
          },
          "tracking_required_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mirrors ShippingRatesResponse.tracking_required_detail. Absent on a pre-#2238 cached batch, for the same reason as the field above.\n"
          },
          "signature_confirmation": {
            "type": "string",
            "enum": [
              "none",
              "signature",
              "adult_signature"
            ],
            "description": "Mirrors ShippingRatesResponse.signature_confirmation for this order. Absent on a batch cached before it shipped; treat an absent value as `none`.\n"
          },
          "insured_value": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Mirrors ShippingRatesResponse.insured_value for this order."
          },
          "insured_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mirrors ShippingRatesResponse.insured_currency for this order. USD on an insured order of a batch cached before it shipped.\n"
          },
          "insurance_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mirrors ShippingRatesResponse.insurance_currency for this order. USD on a batch stored before it shipped: the rate batch is EasyPost-only, which insures in USD.\n"
          },
          "parcel": {
            "description": "Mirrors ShippingRatesResponse.parcel for this order (#3537): the parcel its rates were quoted in, which each of its carrier `rate_id`s also carries to the buy. Null or absent on a batch created before it was kept; that batch's rate ids carry no parcel, and a buy of one re-resolves the parcel from the purchase body.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResolvedParcel"
              },
              {
                "$ref": "#/components/schemas/PredefinedParcelEcho"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "RateBatchStatusResponse": {
        "type": "object",
        "required": [
          "rate_batch_uuid",
          "status"
        ],
        "properties": {
          "rate_batch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "`creating` while EasyPost is still rating, `ready` once every shipment in the batch has rated (`rates` is then present). Any other value passes through EasyPost's own batch state verbatim.\n"
          },
          "order_uuids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Present on batch creation — the order_uuids submitted, echoed back."
          },
          "rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateBatchShipmentRates"
            },
            "description": "Present once status is `ready`."
          }
        }
      },
      "LabelBatchOrderEntry": {
        "type": "object",
        "required": [
          "order_uuid",
          "rate_id"
        ],
        "description": "One order's purchase args for createLabelBatch — the same shape a purchaseShippingLabel call would take for that order.\n",
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "rate_id": {
            "type": "string",
            "description": "The selected rate_id from that order's getShippingRates response."
          },
          "shipping_provider": {
            "type": "string",
            "enum": [
              "easypost",
              "shipstation",
              "pitneybowes",
              "shippo",
              "clickship"
            ],
            "default": "easypost",
            "description": "The carrier the rate was shopped under. Defaults to easypost."
          },
          "easypost_shipment_id": {
            "type": "string",
            "description": "EasyPost shipment id from that order's getShippingRates response. Only consulted when rate_id carries no shipment of its own; omit for ShipStation and Pitney Bowes.\n"
          },
          "label_format": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LabelFormat"
              }
            ],
            "default": "PNG"
          }
        }
      },
      "LabelBatchResultEntry": {
        "type": "object",
        "required": [
          "order_uuid",
          "outcome"
        ],
        "properties": {
          "order_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "purchased",
              "failed"
            ]
          },
          "shipment_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Present when outcome is `purchased`."
          },
          "error": {
            "description": "Present when outcome is `failed` — the same error body purchaseShippingLabel would have returned for this order (e.g. `{\"error\": \"order_held\"}`, a carrier error, a 409 for an order that already has a shipment).\n"
          }
        }
      },
      "ScanFormOwner": {
        "type": "object",
        "description": "Who a label belongs to: an order, or for a TCGplayer Direct hub parcel its RI (`order_uuid` null, `marketplace` `TCGPLAYER_DIRECT`, `marketplace_order_id` the RI id).\n",
        "required": [
          "order_uuid",
          "ri_uuid",
          "marketplace",
          "marketplace_order_id",
          "buyer_name"
        ],
        "properties": {
          "order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "marketplace": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "buyer_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ScanFormEligibleOrder": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanFormOwner"
          },
          {
            "type": "object",
            "required": [
              "shipment_uuid",
              "provider",
              "carrier",
              "service",
              "tracking_number",
              "label_created_at"
            ],
            "properties": {
              "shipment_uuid": {
                "type": "string",
                "format": "uuid"
              },
              "provider": {
                "type": "string",
                "enum": [
                  "shipstation",
                  "easypost",
                  "shippo"
                ]
              },
              "carrier": {
                "type": "string"
              },
              "service": {
                "type": "string"
              },
              "tracking_number": {
                "type": "string"
              },
              "label_created_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      },
      "ScanFormEligibleList": {
        "type": "object",
        "required": [
          "orders",
          "untracked_count"
        ],
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanFormEligibleOrder"
            }
          },
          "untracked_count": {
            "type": "integer",
            "description": "The store's other live labels since `since` with no package tracking (no number, or a USPS letter's Intelligent Mail barcode); they can't go on a form.\n"
          }
        }
      },
      "CreateScanFormsRequest": {
        "type": "object",
        "required": [
          "ship_date"
        ],
        "description": "Name at least one order or RI; together at most 1,000.",
        "properties": {
          "order_uuids": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "ri_uuids": {
            "type": "array",
            "maxItems": 1000,
            "description": "TCGplayer Direct RIs whose hub parcel label goes on the form.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "ship_date": {
            "type": "string",
            "format": "date",
            "description": "The client's local date. Recorded on the form; the carrier checks its own labels' dates."
          }
        }
      },
      "ScanFormOrder": {
        "type": "object",
        "required": [
          "order_uuid",
          "ri_uuid",
          "marketplace_order_id",
          "tracking_number",
          "voided"
        ],
        "properties": {
          "order_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "ri_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "marketplace_order_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracking_number": {
            "type": "string"
          },
          "voided": {
            "type": "boolean",
            "description": "The label was voided after the form was made."
          }
        }
      },
      "ScanForm": {
        "type": "object",
        "required": [
          "scan_form_uuid",
          "provider",
          "carrier",
          "status",
          "ship_date",
          "shipment_count",
          "document_url",
          "error_code",
          "error_detail",
          "orders",
          "voided_count",
          "created_at",
          "created_by_name"
        ],
        "properties": {
          "scan_form_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "type": "string",
            "enum": [
              "shipstation",
              "easypost",
              "shippo"
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ],
            "description": "As the provider reports it once the form exists."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "creating",
              "ready",
              "failed"
            ],
            "description": "`pending`: the carrier hasn't answered, or its answer was lost; its orders stay held until the carrier's own list shows whether it made the form (up to about 15 minutes). `creating`: the carrier is building it; poll `getScanForm`. `ready`: `document_url` is set. `failed`: see `error_code`; its orders can go on another form.\n"
          },
          "ship_date": {
            "type": "string",
            "format": "date"
          },
          "shipment_count": {
            "type": "integer"
          },
          "document_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A short-lived link to the form PDF while `ready`; null otherwise."
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanFormOrder"
            }
          },
          "voided_count": {
            "type": "integer",
            "description": "Labels on the form voided since; keep those parcels out of the pile."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ScanFormList": {
        "type": "object",
        "required": [
          "scan_forms"
        ],
        "properties": {
          "scan_forms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanForm"
            }
          }
        }
      },
      "PaginatedScanFormList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "$ref": "#/components/schemas/ScanFormList"
          }
        ]
      },
      "LabelBatchStatusResponse": {
        "type": "object",
        "required": [
          "label_batch_uuid",
          "status",
          "total",
          "purchased_count",
          "failed_count",
          "results"
        ],
        "properties": {
          "label_batch_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "run_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Echoed back as submitted, so a reopened Ship Review can confirm which run this batch belongs to.\n"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "completed_with_errors",
              "cancelled"
            ],
            "description": "`pending` until a worker claims it, `running` while purchasing, `completed` once every order purchased cleanly, `completed_with_errors` once finished with at least one failed order, `cancelled` if cancelLabelBatch was called before it finished.\n"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable snake_case code for the problem noted in `error_message` (`label_batch_database_unavailable`, `label_batch_queue_unavailable`, `label_batch_storage_unavailable`, `label_batch_dependency_unavailable`, `label_batch_attempt_failed` while a chunk is redriven; `label_batch_failed` once its last delivery failed, after which nothing retries it: cancel the batch and create a new one). Null whenever `error_message` is. Per-order failures are in `results[].error_code`, not here.\n"
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "User-facing note, set when a chunk raised; cleared, and not served, once the batch completes or is cancelled. A note written before codes existed is served as the generic `label_batch_attempt_failed` text. Plain language, never raw exception text. Present alongside status `running` means the job is failing, not progressing — this job type has no automatic revival, so a `running` batch whose `updated_at` has stopped moving and which carries an `error_message` needs to be cancelled and recreated.\n"
          },
          "total": {
            "type": "integer",
            "description": "Orders submitted."
          },
          "purchased_count": {
            "type": "integer"
          },
          "failed_count": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelBatchResultEntry"
            },
            "description": "Grows as the job processes — present-so-far order outcomes, not necessarily `total` entries until status is terminal.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ParcelSpec": {
        "type": "object",
        "description": "A parcel's mail class and size (#3537). `letter` and `flat` carry a weight only; their size is the USPS maximum for the class. `package` also carries length, width and height.",
        "required": [
          "package_type",
          "weight_ounces"
        ],
        "properties": {
          "package_type": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "package"
            ]
          },
          "weight_ounces": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1120,
            "description": "At most 3.5 for a `letter` and 13 for a `flat`."
          },
          "length_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          },
          "width_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          },
          "height_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          }
        }
      },
      "ShipmentParcel": {
        "type": "object",
        "description": "A purchased label's declared parcel (#3537). A letter or flat carries its USPS class-maximum shape. `machinable` is null on a label bought before it was recorded.",
        "required": [
          "package_type",
          "weight_ounces",
          "length_inches",
          "width_inches",
          "height_inches",
          "source",
          "machinable"
        ],
        "properties": {
          "package_type": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "package"
            ]
          },
          "weight_ounces": {
            "type": "number"
          },
          "length_inches": {
            "type": "number"
          },
          "width_inches": {
            "type": "number"
          },
          "height_inches": {
            "type": "number"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "sealed_product",
              "rule",
              "store_default"
            ]
          },
          "machinable": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "ResolvedParcel": {
        "type": "object",
        "description": "The parcel these rates were quoted for. Always carries all three dimensions (the class maximum for a letter or flat): a package reaches rates only with a size. `source` says where it came from: `manual` (the request's `parcel`), `sealed_product` (a saved sealed size), `rule` (a shipping rule's package; `rule_uuid` and `rule_name` name it), or `store_default` (the built-in 3 oz package, once a size was entered).",
        "required": [
          "package_type",
          "weight_ounces",
          "length_inches",
          "width_inches",
          "height_inches",
          "source",
          "machinable"
        ],
        "properties": {
          "package_type": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "package"
            ]
          },
          "weight_ounces": {
            "type": "number"
          },
          "length_inches": {
            "type": "number"
          },
          "width_inches": {
            "type": "number"
          },
          "height_inches": {
            "type": "number"
          },
          "machinable": {
            "type": "boolean",
            "description": "USPS machinable. False declares a non-machinable piece, which the carrier surcharges. EasyPost and ShipStation declare it; Pitney Bowes ignores it (Shipping 360 has no machinable field, and its non-machinable `NMLETTER` parcel type is not yet mapped), so it has no effect on a Pitney Bowes rate."
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "sealed_product",
              "rule",
              "store_default"
            ]
          },
          "rule_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The shipping rule whose package this is. Set when `source` is `rule`."
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That shipping rule's name, for \"Matched rule: <name>\". Set when `source` is `rule`; null on a parcel read back from a rate id, which carries the rule's uuid only."
          }
        }
      },
      "PredefinedParcelEcho": {
        "type": "object",
        "description": "The rates `parcel` echo when the request sent a carrier `predefined_package`: the name, with no dimensions, and the USPS machinable flag it was quoted with.",
        "required": [
          "predefined_package",
          "machinable",
          "source"
        ],
        "properties": {
          "predefined_package": {
            "type": "string"
          },
          "machinable": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual"
            ]
          }
        }
      },
      "RuleParcel": {
        "type": "object",
        "description": "A shipping rule's package (#3537): a mail class, a weight and USPS machinable. It never carries a size; any of `length_inches`, `width_inches` or `height_inches` is refused 422 on that field. A package's size is entered on each order.",
        "required": [
          "package_type",
          "weight_ounces"
        ],
        "properties": {
          "package_type": {
            "type": "string",
            "enum": [
              "letter",
              "flat",
              "package"
            ]
          },
          "weight_ounces": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 1120,
            "description": "At most 3.5 for a `letter` and 13 for a `flat`."
          },
          "machinable": {
            "type": "boolean",
            "default": true,
            "description": "Stored and returned explicitly; true when a request leaves it out. Applies only to a `letter`: a `flat` or `package` is always machinable and is stored with `true` whatever is sent."
          }
        }
      },
      "SealedParcel": {
        "description": "A saved sealed size. Its parcel can be a letter, flat or package.",
        "type": "object",
        "required": [
          "tcgplayer_product_id",
          "quantity",
          "parcel"
        ],
        "properties": {
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "parcel": {
            "$ref": "#/components/schemas/ParcelSpec"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PaginatedSealedParcelList": {
        "type": "object",
        "required": [
          "total",
          "sealed_parcels"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "sealed_parcels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SealedParcel"
            }
          }
        }
      },
      "SavedBox": {
        "type": "object",
        "description": "A box size the store ships in (#3537 follow-up). No weight; picking it fills only the dimensions.",
        "required": [
          "box_uuid",
          "name",
          "length_inches",
          "width_inches",
          "height_inches"
        ],
        "properties": {
          "box_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "New on every save; the list is replaced, not edited in place."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "length_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          },
          "width_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          },
          "height_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108
          }
        }
      },
      "SavedBoxInput": {
        "type": "object",
        "required": [
          "name",
          "length_inches",
          "width_inches",
          "height_inches"
        ],
        "properties": {
          "box_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Ignored. The list is replaced, so every box is stored with a new id."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "description": "Trimmed before it is checked and stored. Unique in the list, ignoring case."
          },
          "length_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Stored to two decimal places; a value that rounds to 0 is refused."
          },
          "width_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Stored to two decimal places; a value that rounds to 0 is refused."
          },
          "height_inches": {
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 108,
            "description": "Stored to two decimal places; a value that rounds to 0 is refused."
          }
        }
      },
      "SavedBoxList": {
        "type": "object",
        "required": [
          "boxes"
        ],
        "properties": {
          "boxes": {
            "type": "array",
            "description": "In the store's saved order.",
            "items": {
              "$ref": "#/components/schemas/SavedBox"
            }
          }
        }
      },
      "ParcelRequiredParams": {
        "type": "object",
        "description": "`params` of a 422 `parcel_required`: the order resolved to a package -- from a shipping rule, the built-in default, or a letter or flat forced up by an add-on or a tracking requirement -- and packages carry no size until it is entered. Send an explicit `parcel` with its dimensions.",
        "required": [
          "reason",
          "sealed_lines",
          "suggested_parcel",
          "tracking_reason",
          "remembers_size"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "package_size"
            ]
          },
          "remembers_size": {
            "type": "boolean",
            "description": "True when buying a label will save this order's size as the store's saved sealed size (the order is only one sealed product)."
          },
          "order_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Set by the batch rate route -- the first order that needs a package size (see order_uuids)."
          },
          "order_uuids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Set by the batch rate route: every order in the batch that needs a package size, in request order. `order_uuid` is the first of them; `reason`, `sealed_lines`, `suggested_parcel` and `tracking_reason` describe it."
          },
          "sealed_lines": {
            "type": "array",
            "description": "The order's sealed-product lines, so the form can name the product; empty when it has none.",
            "items": {
              "type": "object",
              "required": [
                "tcgplayer_product_id",
                "quantity"
              ],
              "properties": {
                "tcgplayer_product_id": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64"
                },
                "product_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer"
                }
              }
            }
          },
          "suggested_parcel": {
            "$ref": "#/components/schemas/RuleParcel"
          },
          "tracking_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the order must be tracked, whenever its marketplace requires tracking (a letter or flat is then forced up to a package), else null."
          }
        }
      },
      "ShippingRuleInput": {
        "type": "object",
        "required": [
          "name",
          "priority",
          "when",
          "then"
        ],
        "properties": {
          "rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of the store's rule this item updates. Omit it (or send null) for a new rule; an id that is not one of the store's rules also makes a new rule.\n"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "when": {
            "$ref": "#/components/schemas/ShippingLogicalCondition"
          },
          "then": {
            "$ref": "#/components/schemas/ShippingAction"
          },
          "is_enabled": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "ShippingRuleItem": {
        "type": "object",
        "required": [
          "rule_uuid",
          "name",
          "priority",
          "when",
          "then",
          "is_enabled"
        ],
        "properties": {
          "rule_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "when": {
            "$ref": "#/components/schemas/ShippingLogicalCondition"
          },
          "then": {
            "$ref": "#/components/schemas/ShippingAction"
          },
          "is_enabled": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Advisory notes about the rule that was just saved — present on the PATCH response, absent on a plain read. See `PaginatedShippingRuleList.warnings`.\n"
          }
        }
      },
      "EarlyShipRule": {
        "type": "object",
        "required": [
          "product_type",
          "early_ship_days"
        ],
        "properties": {
          "game": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "magic",
              "pokemon",
              "lorcana",
              "onepiece",
              "riftbound",
              "unionarena",
              "pokemonjp",
              "gundam",
              "starwars",
              "yugioh",
              "cyberpunk",
              "palworld",
              "digimon",
              "fleshblood",
              "cookierun",
              "sleeves",
              "sorcery",
              "wow",
              "deckboxes",
              "playmats",
              "binders",
              "colstorage",
              "counters",
              "vanguard",
              "dbsmasters",
              "dbsfusion",
              "weiss",
              null
            ],
            "description": "One of the platform's games, or null for the store's game-agnostic default (applies to every game the store has not overridden with its own rule).\n"
          },
          "product_type": {
            "type": "string",
            "enum": [
              "singles",
              "sealed"
            ]
          },
          "early_ship_days": {
            "type": "integer",
            "minimum": 0,
            "description": "Days before the catalog release date this game/category may ship. 0 (the default when no rule is configured at all) means ship exactly on the release date, matching the platform's behavior before this feature existed.\n"
          }
        }
      },
      "EarlyShipRuleList": {
        "type": "object",
        "required": [
          "rules"
        ],
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarlyShipRule"
            }
          }
        }
      },
      "PickListFieldUse": {
        "type": "object",
        "description": "One field as a pick-list layout places it (#3090). The field catalog names each field's ids, modes, styles and widths.\n",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "A field id from the field catalog (`product`, `set_code`, `rarity`, ...)."
          },
          "mode": {
            "type": "string",
            "description": "A mode the field offers; `bin` takes `auto`, `always` or `never`."
          },
          "style": {
            "type": "string",
            "description": "A style the field offers; `rarity` takes `letter` or `name`."
          },
          "games": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Print this field only on rows of these games; others print it blank."
          }
        }
      },
      "PickListColumn": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PickListFieldUse"
          },
          {
            "type": "object",
            "properties": {
              "below": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PickListFieldUse"
                },
                "description": "Fields printed under this column's value, one line each. Not allowed on `bin`, which prints only on a bin's first row and may be left off the sheet entirely.\n"
              },
              "inline": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PickListFieldUse"
                },
                "description": "Fields printed on this column's own line after \" · \", heading included (\"Set · Number\"). Not allowed on `bin`.\n"
              },
              "width": {
                "type": "number",
                "description": "A fixed width in inches, from the field's floor up to 4 (Product: up to the whole page). Absent, the sheet fits the column to its rows.\n"
              },
              "fit": {
                "type": "string",
                "enum": [
                  "wrap",
                  "shrink"
                ],
                "default": "wrap",
                "description": "What the column does with text wider than itself: wrap onto more lines, or shrink the text (down to 6pt, then wrap). Text is never cut off.\n"
              }
            }
          }
        ]
      },
      "PickListConfig": {
        "type": "object",
        "description": "A store's pick-list layout (#3090). Columns print in order after the checkbox.",
        "required": [
          "version",
          "columns"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "columns": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PickListColumn"
            },
            "description": "Must include `product`; each field id at most once in the whole layout."
          },
          "boxes": {
            "type": "object",
            "description": "Turns a black box off with `false`; an absent box is on.",
            "properties": {
              "qty_gt_1": {
                "type": "boolean"
              },
              "cond_mp_or_worse": {
                "type": "boolean"
              },
              "substitute": {
                "type": "boolean"
              },
              "first_edition": {
                "type": "boolean"
              },
              "promo": {
                "type": "boolean"
              }
            }
          },
          "legend": {
            "type": "object",
            "description": "Leaves a line of the header's legend off with `false`; an absent line prints. `boxes` is \"Double-check when boxed\" (the boxes still print on the cards); `rarity` is the rarity code key, which prints only while Rarity is on the sheet as letter codes; `blanks` says what a blank Finish or Lang means. A setting is kept while its line has nothing to say.\n",
            "properties": {
              "boxes": {
                "type": "boolean"
              },
              "rarity": {
                "type": "boolean"
              },
              "blanks": {
                "type": "boolean"
              }
            }
          },
          "rules": {
            "type": "array",
            "maxItems": 0,
            "items": {
              "type": "object"
            },
            "description": "Reserved for conditional rules; must be empty for now."
          }
        }
      },
      "PickListPreviewRequest": {
        "type": "object",
        "required": [
          "pick_list"
        ],
        "properties": {
          "pick_list": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PickListConfig"
              },
              {
                "type": "null"
              }
            ],
            "description": "The layout to preview, saved or not; `null` previews the default layout."
          }
        }
      },
      "PickListSample": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PickListSampleRow"
            }
          }
        }
      },
      "PickListSampleRow": {
        "type": "object",
        "required": [
          "band",
          "band_note",
          "bin",
          "game",
          "game_label",
          "path",
          "rarity_key",
          "cells",
          "boxes"
        ],
        "properties": {
          "band": {
            "type": "string",
            "description": "The walk heading the row sits under (the location path above its bin)."
          },
          "band_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the band's bins are split on, which its heading prints after the path as \"Bins By Set > Letter\"; the same on every row of a band. Null when the band has one bin or hand-named bins.\n"
          },
          "bin": {
            "type": "string",
            "description": "The bin text the sheet prints for the row; empty when its row and band already say it all."
          },
          "game": {
            "type": "string"
          },
          "game_label": {
            "type": "string",
            "description": "The game's short name, as the legend's rarity line names it."
          },
          "path": {
            "type": "string",
            "description": "The row's full location path; the sheet's summary counts distinct paths as bins."
          },
          "rarity_key": {
            "type": [
              "object",
              "null"
            ],
            "description": "The row's entry in the legend's rarity key; null when its rarity needs no key (none, or no shorter code).\n",
            "required": [
              "code",
              "name"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "cells": {
            "type": "object",
            "description": "Every field id -> the text the PDF prints for it (empty when blank). A field with styles maps style -> text instead (`rarity`: `{letter, name}`). `bin` is not here; use `bin`.\n",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              ]
            }
          },
          "boxes": {
            "type": "object",
            "description": "Which black boxes this row would draw when the box is on.",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "PickListPreviewResponse": {
        "type": "object",
        "required": [
          "pdf_base64",
          "errors",
          "warnings",
          "columns"
        ],
        "properties": {
          "columns": {
            "type": "array",
            "description": "The columns the PDF printed, in order, at the widths it gave them (inches, checkbox excluded). A column blank on every sample row is absent. The designer's live mock snaps its automatic columns to these.\n",
            "items": {
              "type": "object",
              "required": [
                "id",
                "width_in"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "width_in": {
                  "type": "number"
                }
              }
            }
          },
          "pdf_base64": {
            "type": "string",
            "format": "byte",
            "description": "The sample pick list as a base64-encoded PDF."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "description": "What saving this layout would refuse; empty when it would save."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the renderer dropped or clamped to print the layout anyway."
          }
        }
      },
      "OrderSlotsSettings": {
        "type": "object",
        "required": [
          "enabled",
          "slot_count"
        ],
        "description": "Order slots (#3218): when enabled, each order of a new pick run gets a tray slot A, B, ...; a run keeps the setting it was created with.\n",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "slot_count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 52
          }
        }
      },
      "CardStackingSettings": {
        "type": "object",
        "required": [
          "picking",
          "placing"
        ],
        "description": "How the store stacks cards (spec 2026-10-25-card-stacking-settings). Copied onto each run when its picking finishes; a change applies to runs that finish picking afterwards.\n",
        "properties": {
          "picking": {
            "type": "string",
            "enum": [
              "face_down",
              "face_up"
            ],
            "description": "face_down (default): cards are picked face down and the stack flipped, so the first card picked is on top and Placement deals in pick order. face_up: the last card picked is on top, and Placement deals each picker's stack last-picked first.\n"
          },
          "placing": {
            "type": "string",
            "enum": [
              "face_up",
              "face_down"
            ],
            "description": "face_up (default): the first card placed ends at the bottom of its slot, so a packing slip lists the last card placed first. face_down: the slot is flipped to read, so the first card placed is on top and listed first.\n"
          }
        }
      },
      "CustomerEmailsSettings": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "description": "The store-wide switch for HippoLink's customer emails (#4529): the order emails (ready for pickup, Kiosk order placed and canceled) and the buylist offer emails. Each email can also be turned off on its own through its email template's `enabled`.\n",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "false: HippoLink emails none of this store's customers, and does not mark pickup orders ready on Shopify (Shopify would email the buyer). Buylist emails carry the seller's offer status and confirm links, so with them off the store has to send those links itself.\n"
          }
        }
      },
      "VisualPickSettings": {
        "type": "object",
        "required": [
          "picked_swipe"
        ],
        "description": "The Visual picker's swipe direction. Store-level and read live: it is not copied onto runs.\n",
        "properties": {
          "picked_swipe": {
            "type": "string",
            "enum": [
              "right",
              "left"
            ],
            "description": "Which swipe in the Visual picker marks a card picked; not found is the other side. Applies the next time the picker loads. Default right.\n"
          }
        }
      },
      "OrderSettings": {
        "type": "object",
        "required": [
          "unfulfilled_alert_hours",
          "document_layout",
          "pick_list",
          "order_slots",
          "card_stacking",
          "visual_pick",
          "customer_emails",
          "holding",
          "cardtrader_invoice_order",
          "location_picking",
          "direct_invoice_order"
        ],
        "properties": {
          "document_layout": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderDocumentLayout"
              }
            ],
            "description": "The page layout invoices and packing slips use when a request does not name a `layout` (#2859). New stores, and every store that has never changed it, are `standard`. A `layout` on the request always wins over this.\n"
          },
          "unfulfilled_alert_hours": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 8760,
            "description": "How many hours an order may sit unfulfilled before the store gets an `ORDERS_UNFULFILLED_AGING` banner naming how many are waiting and how old the oldest one is. Measured from `ordered_at` (when the buyer placed it), not from when HippoLink ingested it. Orders under a presale hold are never counted. null means the reminder is off for this store.\n"
          },
          "pick_list": {
            "$ref": "#/components/schemas/PickListSettings"
          },
          "card_stacking": {
            "$ref": "#/components/schemas/CardStackingSettings"
          },
          "visual_pick": {
            "$ref": "#/components/schemas/VisualPickSettings"
          },
          "customer_emails": {
            "$ref": "#/components/schemas/CustomerEmailsSettings"
          },
          "order_slots": {
            "$ref": "#/components/schemas/OrderSlotsSettings"
          },
          "holding": {
            "$ref": "#/components/schemas/HoldingSettings"
          },
          "cardtrader_invoice_order": {
            "$ref": "#/components/schemas/CardTraderInvoiceOrderSettings"
          },
          "location_picking": {
            "$ref": "#/components/schemas/LocationPickingSettings"
          },
          "direct_invoice_order": {
            "$ref": "#/components/schemas/DirectInvoiceOrderSettings"
          }
        }
      },
      "LocationPickingSettings": {
        "type": "object",
        "required": [
          "enabled",
          "pickup_end_location_uuid",
          "ship_end_location_uuid",
          "ship_from_location_uuid",
          "substitute",
          "available",
          "locations"
        ],
        "description": "Location-scoped pick runs. When `enabled`, an order pick run is created for one top-level location, and an order with cards in several locations ships from the location its first bundle goes to.\n",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "pickup_end_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Where a split pickup or in-store order (or one from a pickup-only marketplace) is packed. Null is Automatic: the top-level location holding the most of what is left. A location deleted since it was chosen reads as null.\n"
          },
          "ship_end_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Where a split shipped order is packed and shipped. Null is Automatic, as for `pickup_end_location_uuid`.\n"
          },
          "ship_from_location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "deprecated": true,
            "description": "Deprecated and always null: a split order ships from the location its bundles go to. Removed in a later release.\n"
          },
          "substitute": {
            "type": "string",
            "enum": [
              "prefer_exact_elsewhere",
              "substitute_here"
            ],
            "deprecated": true,
            "description": "Deprecated and always `prefer_exact_elsewhere`: the sourcing order is fixed. A run at a location takes the exact condition there, then leaves what another location holds exactly for that location, then offers a substitute from this location, then leaves what another location holds in any condition; only the rest is flagged missing. Removed in a later release.\n"
          },
          "available": {
            "type": "boolean",
            "description": "True when the store has at least two top-level locations, the minimum to turn this on."
          },
          "locations": {
            "type": "array",
            "description": "The store's top-level locations.",
            "items": {
              "type": "object",
              "required": [
                "location_uuid",
                "name"
              ],
              "properties": {
                "location_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "HoldingSortKey": {
        "type": "object",
        "required": [
          "field",
          "direction"
        ],
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "game",
              "set_name",
              "release_date",
              "collector_number",
              "condition",
              "price",
              "item_name"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          }
        }
      },
      "CardTraderZeroInvoicePickRunRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "How to pull the invoice. Every field is optional; an empty body walks as before.",
        "properties": {
          "pull_order": {
            "type": "string",
            "enum": [
              "bin_route",
              "invoice_order"
            ]
          },
          "sort_keys": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4,
            "description": "Invoice order for this run. Omitted means the store's default.",
            "items": {
              "$ref": "#/components/schemas/HoldingSortKey"
            }
          },
          "save_as_default": {
            "type": "boolean",
            "default": false,
            "description": "Also store `sort_keys` as the store's default invoice order."
          }
        }
      },
      "CardTraderInvoiceOrderSettings": {
        "type": "object",
        "required": [
          "sort_keys"
        ],
        "description": "The store's default CardTrader Zero invoice pull order, whether or not holding is on. Pick runs started in invoice order use it unless they send their own `sort_keys`.\n",
        "properties": {
          "sort_keys": {
            "type": [
              "array",
              "null"
            ],
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/HoldingSortKey"
            }
          }
        }
      },
      "DirectInvoiceOrderSettings": {
        "type": "object",
        "required": [
          "pull_order",
          "ask_each_run"
        ],
        "description": "The store's default TCGplayer Direct reimbursement-invoice pull order. Pick runs that do not send their own `pull_order` use it; null reads as `bin_route`. A store with Direct holding on always walks invoice order. `ask_each_run` is whether the pick-run dialog still asks which order to pull in; false means it goes straight to the default.\n",
        "properties": {
          "pull_order": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bin_route",
              "invoice_order",
              null
            ]
          },
          "ask_each_run": {
            "type": "boolean"
          }
        }
      },
      "HoldingProgramSettings": {
        "type": "object",
        "required": [
          "enabled",
          "container_uuid"
        ],
        "description": "One program's holding box. `container_uuid` is kept when the program is turned off.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "container_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "sort_keys": {
            "type": [
              "array",
              "null"
            ],
            "deprecated": true,
            "description": "Deprecated alias of `cardtrader_invoice_order.sort_keys`; removed once the frontend no longer reads it.\n",
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/HoldingSortKey"
            }
          }
        }
      },
      "HoldingSettings": {
        "type": "object",
        "required": [
          "direct",
          "ct_zero"
        ],
        "description": "Holding-box pre-pull settings, one box per program (TCGplayer Direct and CardTrader Zero).\n",
        "properties": {
          "direct": {
            "$ref": "#/components/schemas/HoldingProgramSettings"
          },
          "ct_zero": {
            "$ref": "#/components/schemas/HoldingProgramSettings"
          }
        }
      },
      "PickListSettings": {
        "type": "object",
        "description": "The store's pick-list layout and the catalog of fields it can use (#3090).",
        "required": [
          "config",
          "is_default",
          "default_config",
          "fields"
        ],
        "properties": {
          "config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PickListConfig"
              }
            ],
            "description": "The layout every real pick list prints with: the store's saved layout, or the default one when it has never saved one.\n"
          },
          "is_default": {
            "type": "boolean",
            "description": "True when the store has no saved layout and `config` is the default."
          },
          "default_config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PickListConfig"
              }
            ],
            "description": "The default layout, whatever the store has saved, so the designer can reset a draft to it without saving and without a copy of its own. Saving `null` stores it as the default.\n"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PickListField"
            },
            "description": "Every field a layout can place, so the designer carries no copy of the catalog. Labels, games and widths come from the server.\n"
          }
        }
      },
      "PickListField": {
        "type": "object",
        "required": [
          "id",
          "label",
          "description",
          "games",
          "stackable",
          "modes",
          "styles",
          "widths"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "description": "The column heading."
          },
          "description": {
            "type": "string",
            "description": "One line on what the field prints, for the designer's \"Add a column\" menu."
          },
          "games": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The games with data for this field; `null` means every game."
          },
          "stackable": {
            "type": "boolean",
            "description": "Whether it may go under (`below`) or beside (`inline`) another column."
          },
          "modes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The field's `mode` values (empty when it has none)."
          },
          "styles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The field's `style` values (empty when it has none)."
          },
          "widths": {
            "type": "object",
            "description": "Keyed by mode or style (`default` when the field has neither): the heading for that variant, our suggested width, and the narrowest and widest a store may fix it, in inches.\n",
            "additionalProperties": {
              "type": "object",
              "required": [
                "label",
                "default_in",
                "min_in",
                "max_in"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "default_in": {
                  "type": "number"
                },
                "min_in": {
                  "type": "number"
                },
                "max_in": {
                  "type": "number"
                }
              }
            }
          }
        }
      },
      "OrderSettingsUpdate": {
        "type": "object",
        "description": "Partial update — every property is optional, and only the keys present are written. A body with none of them is a 400. An explicit null is a real value, not an omission, but only `unfulfilled_alert_hours` and `pick_list` accept it.\n",
        "properties": {
          "unfulfilled_alert_hours": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 8760,
            "description": "See `unfulfilled_alert_hours` on `OrderSettings`. Setting it to null turns the reminder off and clears any banner already raised.\n"
          },
          "document_layout": {
            "$ref": "#/components/schemas/OrderDocumentLayout"
          },
          "pick_list": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PickListConfig"
              },
              {
                "type": "null"
              }
            ],
            "description": "The store's pick-list layout; `null` resets it to the default. Validated whole: an invalid layout is a 422 listing every problem, and nothing is saved.\n"
          },
          "order_slots": {
            "type": "object",
            "description": "Order slots (#3218): when enabled, each order of a new pick run gets a tray slot A, B, ...; a run keeps the setting it was created with. Partial: an omitted field keeps its stored value. An out-of-range `slot_count` or an unknown key is a 422.\n",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "slot_count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 52
              }
            }
          },
          "card_stacking": {
            "type": "object",
            "description": "Card stacking. Partial: an omitted field keeps its stored value. An unknown key or value is a 422 on `card_stacking.<field>`. A change applies to runs that finish picking afterwards.\n",
            "additionalProperties": false,
            "minProperties": 1,
            "properties": {
              "picking": {
                "type": "string",
                "enum": [
                  "face_down",
                  "face_up"
                ]
              },
              "placing": {
                "type": "string",
                "enum": [
                  "face_up",
                  "face_down"
                ]
              }
            }
          },
          "visual_pick": {
            "type": "object",
            "description": "Visual picker swipe direction. Which swipe in the Visual picker marks a card picked; not found is the other side. Applies the next time the picker loads. An unknown key or value is a 422 on `visual_pick.<field>`.\n",
            "additionalProperties": false,
            "minProperties": 1,
            "properties": {
              "picked_swipe": {
                "type": "string",
                "enum": [
                  "right",
                  "left"
                ]
              }
            }
          },
          "customer_emails": {
            "type": "object",
            "description": "The store-wide customer email switch (#4529). An unknown key or a non-boolean is a 422 on `customer_emails.<field>`.\n",
            "additionalProperties": false,
            "required": [
              "enabled"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              }
            }
          },
          "holding": {
            "type": "object",
            "description": "Per-program holding boxes (`direct`, `ct_zero`). Partial: an omitted program or key keeps its stored value. Enabling needs a box: `container_uuid` of an empty top-level container the store owns (it, and everything under it, becomes a holding location), or `create: true` for a new one at the store root (the program's stored box is reused if it still exists). Switching to another box releases the old one, and is a 409 `holding_not_empty` while the old box has commitments or stock. An explicit null `container_uuid` is a 422. A bad or missing container, or unknown key, is a 422 `validation_error`; enabling `ct_zero` with no `cardtrader_invoice_order.sort_keys` stored or sent is a 422 `holding_sort_keys_required`. 409s: `holding_cardchaos_picking` (CardChaos picking is on), `holding_container_shared` (both programs name one box), `holding_container_not_empty` (the chosen container holds stock), `holding_not_empty` (turning a program off, or moving it to another box, while its box has open commitments).\n",
            "properties": {
              "direct": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "container_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "create": {
                    "type": "boolean"
                  }
                }
              },
              "ct_zero": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "container_uuid": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "create": {
                    "type": "boolean"
                  },
                  "sort_keys": {
                    "type": "array",
                    "deprecated": true,
                    "minItems": 1,
                    "maxItems": 4,
                    "items": {
                      "$ref": "#/components/schemas/HoldingSortKey"
                    }
                  }
                }
              }
            }
          },
          "cardtrader_invoice_order": {
            "type": "object",
            "required": [
              "sort_keys"
            ],
            "additionalProperties": false,
            "description": "The default CardTrader Zero invoice pull order. `sort_keys: null` clears it, refused with 422 `holding_sort_keys_required` while CardTrader Zero holding is on.\n",
            "properties": {
              "sort_keys": {
                "type": [
                  "array",
                  "null"
                ],
                "minItems": 1,
                "maxItems": 4,
                "items": {
                  "$ref": "#/components/schemas/HoldingSortKey"
                }
              }
            }
          },
          "location_picking": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "description": "Partial update. Turning `enabled` on needs two top-level locations; turning it off is refused with 409 `location_picking_in_flight` while orders are split across locations or a cancelled order still holds a staging slot. `ship_from_location_uuid` and `substitute` are deprecated and ignored. `pickup_end_location_uuid` / `ship_end_location_uuid` fix where split orders of that type are packed (null is Automatic).\n",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "pickup_end_location_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "A top-level location of the store, or null for Automatic. Otherwise 422."
              },
              "ship_end_location_uuid": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "A top-level location of the store, or null for Automatic. Otherwise 422."
              },
              "ship_from_location_uuid": {
                "type": "string",
                "format": "uuid",
                "deprecated": true,
                "description": "Deprecated and ignored."
              },
              "substitute": {
                "type": "string",
                "enum": [
                  "prefer_exact_elsewhere",
                  "substitute_here"
                ],
                "deprecated": true,
                "description": "Deprecated and ignored (still a 422 when not one of the two values): the sourcing order is fixed -- exact condition at this location, exact at another location, a substitute at this location, any condition elsewhere, then flagged missing.\n"
              }
            }
          },
          "direct_invoice_order": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "description": "The default TCGplayer Direct reimbursement-invoice pull order and whether pick runs still ask for one. Send either field or both. `pull_order: null` clears the default (the bin route) and sets `ask_each_run` back to true. `ask_each_run: false` needs a default, stored or sent in the same body (422 `direct_invoice_order_default_required`). A value other than `bin_route` or `invoice_order` is a 422 on `direct_invoice_order.pull_order`; a non-boolean `ask_each_run` is a 422 on `direct_invoice_order.ask_each_run`.\n",
            "properties": {
              "pull_order": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "bin_route",
                  "invoice_order",
                  null
                ]
              },
              "ask_each_run": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "ShopifyLocation": {
        "description": "A Shopify location available as an inventory sync target.",
        "type": "object",
        "required": [
          "id",
          "name",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Shopify location id."
          },
          "name": {
            "type": "string",
            "description": "Location name."
          },
          "status": {
            "type": "string",
            "description": "ACTIVE or INACTIVE (derived from the location's active flag)."
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "One-line formatted address, or null when Shopify has none."
          }
        }
      },
      "ShopifyLocationsResult": {
        "description": "The store's Shopify locations plus the currently-selected target.",
        "type": "object",
        "required": [
          "locations",
          "selected_location_id"
        ],
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShopifyLocation"
            }
          },
          "selected_location_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The location currently receiving inventory pushes (shopify_location_id), or null when the store hasn't picked one yet.\n"
          }
        }
      },
      "SkuRepriceChange": {
        "type": "object",
        "required": [
          "source",
          "changed_at",
          "price_before",
          "price_after"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "reprice",
              "manual",
              "import"
            ],
            "description": "Origin of this price change: reprice engine, a manual edit, or an inventory import (CSV/API)."
          },
          "changed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change occurred. For reprice rows this is the reprice job time; for manual rows it is the edit time; for import rows it is the import time. Use this for sorting and display."
          },
          "job_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The reprice job that produced this change. Null for manual or import changes."
          },
          "job_created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the reprice job was created. Null for manual or import changes."
          },
          "price_before": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Price before this change. Null when there was no prior price (first price)."
          },
          "price_after": {
            "type": "number",
            "format": "double",
            "description": "Price after this change."
          },
          "matched_rule_index": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Zero-based index of the rule that matched this SKU. Null for manual or import changes."
          },
          "rule_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The rule that produced this change. Null for manual or import changes."
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-readable name of the matched rule. Null for manual or import changes."
          },
          "rule_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "DSL source of the matched rule at execution time. Null for manual or import changes."
          },
          "actor_display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full name of the user who made a manual change. Null for reprice-engine or import changes, or when the user record is not found."
          },
          "source_job_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The import job that produced this change. Null for reprice or manual changes."
          }
        }
      },
      "SkuSalesRollupRow": {
        "description": "Per-SKU sales aggregate. A row exists only for a SKU with at least one qualifying sale inside the trailing `days` window, so units_sold, revenue, and avg_sale_price always reflect real in-window activity. last_sale_price and last_sold_at are computed all-time (no window), matching the windowless LAST_SALE_PRICE variable.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "condition",
          "language",
          "finish",
          "game",
          "units_sold",
          "revenue",
          "avg_sale_price",
          "last_sale_price",
          "last_sold_at",
          "current_quantity"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The SKU this row aggregates."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "The parent product this SKU belongs to."
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card/product display name. Null when the SKU has not yet resolved to a catalog product (uncatalogued SKU)."
          },
          "product_set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name of the set. Null when the SKU has not yet resolved to a catalog product (uncatalogued SKU)."
          },
          "condition": {
            "type": "string",
            "description": "Card condition (e.g. Near Mint, Lightly Played)."
          },
          "language": {
            "type": "string",
            "description": "Card language (e.g. English)."
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. Normal, Foil)."
          },
          "game": {
            "type": "string",
            "description": "Game family (e.g. magic)."
          },
          "units_sold": {
            "type": "integer",
            "description": "Total quantity sold within the trailing days window, excluding canceled and refunded orders. Always at least 1: a row only exists for a SKU with qualifying in-window sales.\n"
          },
          "revenue": {
            "type": "number",
            "format": "double",
            "description": "Sum of (unit price * quantity) across qualifying order lines within the trailing days window, scoped to the requested currency. Always present and never negative, since a row only exists for a SKU with qualifying in-window sales.\n"
          },
          "avg_sale_price": {
            "type": "number",
            "format": "double",
            "description": "Quantity-weighted average unit price within the trailing days window: revenue / units_sold. Always present, since a row only exists for a SKU with qualifying in-window sales.\n"
          },
          "last_sale_price": {
            "type": "number",
            "format": "double",
            "description": "Unit price of this SKU's most recent qualifying sale, all-time (no window), matching the windowless LAST_SALE_PRICE repricing variable.\n"
          },
          "last_sold_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of this SKU's most recent qualifying sale, all-time (no window).\n"
          },
          "current_quantity": {
            "type": "integer",
            "description": "Current on-hand physical stock for this SKU across all locations."
          }
        }
      },
      "SkuVariant": {
        "description": "A single TCGPlayer SKU variant (one condition/language/finish combination) belonging to a TCGPlayer product. Returned in catalog product->sku lookups.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "condition",
          "language",
          "finish",
          "game"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "TCGPlayer SKU ID (the universal product variant identifier)."
          },
          "condition": {
            "$ref": "#/components/schemas/CardCondition"
          },
          "language": {
            "type": "string",
            "description": "Card language."
          },
          "finish": {
            "type": "string",
            "description": "Card finish (e.g. normal, foil, etched)."
          },
          "finish_label": {
            "type": "string",
            "description": "Display-only finish label, refined to the specific foil treatment when known (e.g. \"Surge Foil\" instead of the generic \"Foil\"). Derived from the printing's promo types; `finish` remains the canonical machine value.\n"
          },
          "game": {
            "type": "string",
            "description": "Game family (e.g. magic)."
          }
        }
      },
      "CatalogSkuLookupPage": {
        "description": "One page of `lookupCatalogSkus`.",
        "type": "object",
        "required": [
          "items",
          "pagination"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogSkuLookupItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "CatalogSkuLookupItem": {
        "description": "One catalog SKU: a condition, language and finish of one printing. Its `tcgplayer_sku_id` is what `createInventory` and `bulkUpsertInventory` take.\n",
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "product_name",
          "game",
          "set_code",
          "set_name",
          "collector_number",
          "finish",
          "variant_label",
          "condition",
          "language"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64",
            "description": "The TCGplayer SKU id."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64",
            "description": "The TCGplayer product id of the printing."
          },
          "product_name": {
            "type": "string",
            "description": "The product's name as TCGplayer lists it. Outside Magic it often carries the printing too (`Mew ex - 151/165`).\n"
          },
          "game": {
            "type": "string",
            "description": "The game (e.g. magic)."
          },
          "set_code": {
            "type": "string",
            "description": "The set code (e.g. MKM). Empty when the catalog has none."
          },
          "set_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The set name."
          },
          "collector_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The collector number as printed (e.g. \"123\", \"074/198\"). Null when the catalog has none."
          },
          "finish": {
            "type": "string",
            "description": "The SKU's finish (normal, foil, etched, ...). This is what TCGplayer calls the SKU's \"printing\".\n"
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which printing this is when the name and set alone don't say (e.g. \"Borderless\", \"Retro Frame\", \"Surge Foil\", or for a game other than Magic the qualifier TCGplayer puts in the product name, such as \"Starlight Rare\"). The same value catalog search returns. Null for a plain printing.\n"
          },
          "condition": {
            "type": "string",
            "description": "The condition, in TCGplayer's names (Near Mint, Lightly Played, ...)."
          },
          "language": {
            "type": "string",
            "description": "The card language."
          }
        }
      },
      "SlowMoverRow": {
        "type": "object",
        "required": [
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "card_name",
          "set_name",
          "condition",
          "language",
          "finish",
          "quantity",
          "days_in_stock",
          "listed_price_usd"
        ],
        "properties": {
          "tcgplayer_sku_id": {
            "type": "string",
            "description": "TCGPlayer SKU identifier."
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "description": "The SKU's product, which keys the inventory detail page."
          },
          "card_name": {
            "type": "string"
          },
          "set_name": {
            "type": "string"
          },
          "condition": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for a SKU with no language, such as sealed product."
          },
          "finish": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for a SKU with no finish, such as sealed product."
          },
          "quantity": {
            "type": "integer",
            "description": "On-hand stock (sum of `inventory_locations_storage.total_quantity`) across all locations for this SKU."
          },
          "days_in_stock": {
            "type": "integer",
            "description": "Number of whole days since the item was first inventoried (earliest `inventory_locations_storage.created_at` for this SKU).\n"
          },
          "listed_price_usd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Current retail listing price, in the store's currency (the `_usd` suffix is historical). Null when the SKU is stocked but has no pricing row yet (e.g. never repriced).\n"
          },
          "estimated_market_value_usd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Estimated market value (null when unavailable)."
          }
        }
      },
      "RemovalReason": {
        "type": "string",
        "description": "Why stock was removed outside a sale. The shrinkage_* values are loss categories surfaced in the shrinkage report; manual_correction is the explicit non-loss option (a data-entry fix or discontinued line) and is excluded from shrinkage totals. Required on any manual decrease or delete.\n",
        "enum": [
          "shrinkage_theft",
          "shrinkage_damage",
          "shrinkage_lost",
          "shrinkage_miscount",
          "shrinkage_giveaway",
          "shrinkage_other",
          "manual_correction"
        ]
      },
      "ShrinkageReportRow": {
        "type": "object",
        "required": [
          "period",
          "reason_code",
          "units",
          "loss_value"
        ],
        "properties": {
          "period": {
            "type": "string",
            "format": "date",
            "description": "Start of the time bucket (day/week/month per the period parameter)."
          },
          "reason_code": {
            "type": "string",
            "description": "One of the shrinkage_* reason codes."
          },
          "units": {
            "type": "integer",
            "description": "Units removed in this bucket under this reason. Signed: a reversal (a written-off transfer shortfall whose box later turned up) is a compensating entry under the same reason code, so a bucket can be negative when a loss booked in an earlier period is undone.\n"
          },
          "loss_value": {
            "type": "number",
            "format": "double",
            "description": "Cost-basis loss (unit cost x units) for this bucket and reason. Negative in the same reversal case as `units`.\n"
          }
        }
      },
      "ShrinkageReasonTotal": {
        "type": "object",
        "required": [
          "reason_code",
          "units",
          "loss_value"
        ],
        "properties": {
          "reason_code": {
            "type": "string",
            "description": "One of the shrinkage_* reason codes."
          },
          "units": {
            "type": "integer",
            "description": "Total units removed under this reason across the window, net of any reversals in it (see `ShrinkageReportRow.units`).\n"
          },
          "loss_value": {
            "type": "number",
            "format": "double",
            "description": "Total cost-basis loss for this reason across the window, net of any reversals in it (see `ShrinkageReportRow.units`).\n"
          }
        }
      },
      "ShrinkageReportResponse": {
        "type": "object",
        "required": [
          "rows",
          "totals"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShrinkageReportRow"
            }
          },
          "totals": {
            "type": "object",
            "required": [
              "units",
              "loss_value",
              "by_reason"
            ],
            "properties": {
              "units": {
                "type": "integer",
                "description": "Total units lost to shrinkage in the window, net of any reversals in it (see `ShrinkageReportRow.units`).\n"
              },
              "loss_value": {
                "type": "number",
                "format": "double",
                "description": "Total cost-basis loss in the window, net of any reversals in it (see `ShrinkageReportRow.units`).\n"
              },
              "by_reason": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ShrinkageReasonTotal"
                }
              }
            }
          }
        }
      },
      "ProductDeltaReportRow": {
        "type": "object",
        "required": [
          "transaction_uuid",
          "created_at",
          "direction",
          "category",
          "reason_code",
          "tcgplayer_sku_id",
          "tcgplayer_product_id",
          "product_name",
          "quantity",
          "location_uuid",
          "note"
        ],
        "properties": {
          "transaction_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "direction": {
            "type": "string",
            "enum": [
              "added",
              "removed"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "manual",
              "import",
              "buylist",
              "sold",
              "breakage",
              "other"
            ]
          },
          "reason_code": {
            "$ref": "#/components/schemas/InventoryTransactionReasonCode",
            "description": "The raw inventory_transactions reason code behind this row's category."
          },
          "tcgplayer_sku_id": {
            "type": "integer",
            "format": "int64"
          },
          "tcgplayer_product_id": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null if the product could not be resolved from the catalog."
          },
          "quantity": {
            "type": "integer",
            "description": "Copies that moved (always positive; see `direction` for the sign)."
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for a movement not tied to one bin (e.g. a physical pull with no bin recorded)."
          },
          "location_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bin's full path when the movement was recorded. It does not follow a later rename, move or delete of the bin. Null whenever location_uuid was null when the row was written.\n"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Operator free-text, when one was given for the movement."
          }
        }
      },
      "ProductDeltaReportResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          {
            "type": "object",
            "required": [
              "rows",
              "totals",
              "from",
              "to"
            ],
            "properties": {
              "rows": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProductDeltaReportRow"
                }
              },
              "totals": {
                "type": "object",
                "required": [
                  "added",
                  "removed",
                  "by_category"
                ],
                "description": "Unit counts (copies moved, not row counts) over the whole matched window, independent of `limit`/`offset`.\n",
                "properties": {
                  "added": {
                    "type": "integer"
                  },
                  "removed": {
                    "type": "integer"
                  },
                  "by_category": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "category",
                        "added",
                        "removed"
                      ],
                      "properties": {
                        "category": {
                          "type": "string",
                          "enum": [
                            "manual",
                            "import",
                            "buylist",
                            "sold",
                            "breakage",
                            "other"
                          ]
                        },
                        "added": {
                          "type": "integer"
                        },
                        "removed": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              },
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              }
            }
          }
        ]
      },
      "SlowMoversReportResponse": {
        "type": "object",
        "required": [
          "rows"
        ],
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SlowMoverRow"
            }
          }
        }
      },
      "SquareLocation": {
        "description": "A Square business location available as an inventory sync target.",
        "type": "object",
        "required": [
          "id",
          "name",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Square location id."
          },
          "name": {
            "type": "string",
            "description": "Location name (the seller's nickname for the location)."
          },
          "status": {
            "type": "string",
            "description": "Square location status (e.g. ACTIVE, INACTIVE)."
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "One-line formatted address, or null when Square has none."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 currency Square reports for the location, or null when Square omits it. Pushes to a location whose currency differs from the store's are skipped (#3242).\n"
          }
        }
      },
      "SquareLocationsResult": {
        "description": "The store's Square locations plus the currently-selected push target.",
        "type": "object",
        "required": [
          "locations",
          "selected_location_id"
        ],
        "properties": {
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SquareLocation"
            }
          },
          "selected_location_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The location currently receiving inventory pushes (square_primary_location_id), or null when the store hasn't picked one yet.\n"
          }
        }
      },
      "StaffRole": {
        "type": "string",
        "enum": [
          "store_owner",
          "store_manager",
          "store_employee"
        ]
      },
      "StoreAlert": {
        "description": "A store-facing alert banner shown to all users of a store in the dashboard. Distinct from the operational Discord/CloudWatch alerting — this notifies the store, not us.\n",
        "type": "object",
        "required": [
          "alert_uuid",
          "alert_type",
          "severity",
          "title",
          "body",
          "context",
          "first_detected_at",
          "last_detected_at"
        ],
        "properties": {
          "alert_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "alert_type": {
            "type": "string",
            "enum": [
              "TCG_COOKIE_EXPIRING",
              "TCG_SYNC_REDIRECT",
              "TCG_DIRECT_RI",
              "SHOPIFY_DISCONNECTED",
              "CARD_TRADER_DISCONNECTED",
              "MANA_POOL_DISCONNECTED",
              "SQUARE_DISCONNECTED",
              "TCGPLAYER_DISCONNECTED",
              "CARDMARKET_DISCONNECTED",
              "EBAY_DISCONNECTED",
              "BUYLIST_MARGIN_THIN",
              "SHOPIFY_VARIANT_CAP",
              "TCG_SELLER_MISMATCH",
              "SQUARE_REFUND_DRIFT",
              "BUYLIST_RULE_ACTION_INVALID",
              "TCG_CLOCK_DRIFT",
              "SHIPPING_RULE_UNMATCHABLE",
              "EASYPOST_DISCONNECTED",
              "SHIPSTATION_DISCONNECTED",
              "PITNEYBOWES_DISCONNECTED",
              "SHIPPO_DISCONNECTED",
              "CLICKSHIP_DISCONNECTED",
              "RULES_CURRENCY_STALE",
              "TCGPLAYER_LISTING_DRIFT",
              "MANA_POOL_LISTING_DRIFT",
              "CARD_TRADER_LISTING_DRIFT",
              "SHOPIFY_LISTING_DRIFT",
              "SQUARE_LISTING_DRIFT",
              "CARDMARKET_LISTING_DRIFT",
              "EBAY_LISTING_DRIFT",
              "CARD_NEXUS_LISTING_DRIFT",
              "MISPRINT_LISTING_DRIFT",
              "EBAY_SELLING_LIMIT_REACHED",
              "EBAY_SETUP_INCOMPLETE",
              "ORDERS_UNFULFILLED_AGING",
              "TCGPLAYER_LISTINGS_OFF",
              "MANA_POOL_LISTINGS_OFF",
              "INVENTORY_IMPORT_FAILED",
              "INVENTORY_EXPORT_FAILED",
              "REPRICE_RUN_FAILED",
              "EBAY_REFUND_DRIFT",
              "EBAY_FREE_LISTINGS_USED_UP",
              "EBAY_LISTING_ISSUE",
              "EBAY_ORDERS_NOT_IMPORTED",
              "TCGPLAYER_ORDERS_NOT_IMPORTED",
              "SHOPIFY_PERMISSIONS_MISSING",
              "CARD_NEXUS_DISCONNECTED",
              "MISPRINT_DISCONNECTED",
              "MISPRINT_LISTING_LIMIT",
              "CARD_NEXUS_CURRENCY_MISMATCH",
              "SNAPCASTER_DISCONNECTED",
              "SNAPCASTER_LISTING_DRIFT",
              "SNAPCASTER_NOT_BROWSABLE",
              "SNAPCASTER_DISPATCH_OVERDUE",
              "ORDERS_LABEL_VOIDED",
              "ORDERS_LABEL_REFUND_REJECTED",
              "ORDERS_CANCELED_LABEL_NOT_VOIDED",
              "LABEL_PURCHASED_NOT_NOTIFIED",
              "MANA_POOL_QUANTITY_DRIFT",
              "TCGPLAYER_QUANTITY_DRIFT",
              "CARD_TRADER_QUANTITY_DRIFT",
              "SHOPIFY_QUANTITY_DRIFT",
              "SQUARE_QUANTITY_DRIFT",
              "CARDMARKET_QUANTITY_DRIFT",
              "EBAY_QUANTITY_DRIFT",
              "CARD_NEXUS_QUANTITY_DRIFT",
              "MISPRINT_QUANTITY_DRIFT",
              "SNAPCASTER_QUANTITY_DRIFT",
              "LIGHTSPEED_DISCONNECTED",
              "LIGHTSPEED_LISTING_DRIFT",
              "LIGHTSPEED_QUANTITY_DRIFT",
              "LIGHTSPEED_REFUND_DRIFT",
              "WHATNOT_DISCONNECTED",
              "WHATNOT_LISTING_DRIFT",
              "SICK_DEALS_DISCONNECTED",
              "SICK_DEALS_LISTING_DRIFT",
              "SICK_DEALS_QUANTITY_DRIFT",
              "BIN_RECOUNT_FLAGS_AGING",
              "TCGPLAYER_TRACKING_OVERRIDE",
              "TCG_SHIP_CANCELED_ORDER",
              "TCGPLAYER_ORDER_DRIFT",
              "TCGPLAYER_REFUNDED_AFTER_SHIP"
            ],
            "description": "The kind of alert; drives the banner copy/icon on the frontend."
          },
          "severity": {
            "type": "string",
            "enum": [
              "warning",
              "error"
            ]
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "context": {
            "type": "object",
            "additionalProperties": true,
            "description": "Display/diagnostic detail (e.g. platform, cookie_age_days, http_status, order_number). Never contains credential values.\n"
          },
          "first_detected_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this alert was first raised."
          },
          "last_detected_at": {
            "type": "string",
            "format": "date-time",
            "description": "Most recent time the underlying condition was re-detected."
          }
        }
      },
      "StoreDetail": {
        "type": "object",
        "required": [
          "store_uuid",
          "name",
          "location",
          "inventory_count",
          "games",
          "rule_count",
          "last_repriced_at",
          "created_at",
          "updated_at",
          "vacation_start_at",
          "vacation_end_at",
          "vacation_active",
          "status",
          "subscription_level",
          "region",
          "currency",
          "order_count",
          "pending_order_count",
          "easypost_configured",
          "theme",
          "timezone"
        ],
        "properties": {
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "IANA timezone, such as `America/Chicago`. Used to date store-local things, currently the YYMMDD in fulfillment run names. Default `America/New_York`. An unknown IANA name is rejected with 422 `validation_error` on `timezone`.\n"
          },
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/Address"
          },
          "region": {
            "$ref": "#/components/schemas/Region"
          },
          "inventory_count": {
            "type": "integer"
          },
          "games": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameId"
            },
            "description": "Games with at least one inventory row in the store's live locations, sold-out rows included, in GameId enum order. Lets pickers lead with the store's own games. Computed per read like inventory_count; the store's ETag does not change when it does.\n"
          },
          "rule_count": {
            "type": "integer"
          },
          "last_repriced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "grace_period_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the subscription grace period ends, or null if the store is not in a past-due grace window."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "vacation_start_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of vacation period (inclusive), or null if not on vacation.\n"
          },
          "vacation_end_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of vacation period (inclusive), or null if not on vacation. When set, must be after vacation_start_at. Store-scoped endpoints return 404 while the current timestamp falls within the vacation range.\n"
          },
          "vacation_active": {
            "type": "boolean",
            "description": "Whether the store is currently in vacation mode. Set to true by the vacation worker when the vacation period starts and listings are paused. Reset to false when vacation dates are cleared.\n",
            "default": false
          },
          "status": {
            "type": "string",
            "enum": [
              "idle",
              "repricing",
              "importing",
              "exporting",
              "rolling_back",
              "deleting"
            ]
          },
          "contact_details": {
            "$ref": "#/components/schemas/ContactDetails"
          },
          "subscription_level": {
            "$ref": "#/components/schemas/SubscriptionLevel"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "order_count": {
            "type": "integer",
            "description": "Total number of orders across all marketplaces"
          },
          "pending_order_count": {
            "type": "integer",
            "description": "Number of orders in unfulfilled or processing status"
          },
          "easypost_configured": {
            "type": "boolean",
            "description": "Whether the store has an active EasyPost API key configured for shipping label generation."
          },
          "require_mfa": {
            "type": "boolean",
            "description": "Whether the store requires all team members to have two-factor authentication enabled. When true, users without MFA are blocked from accessing store features until they set it up.\n",
            "default": false
          },
          "require_api_key_ip_allowlist": {
            "type": "boolean",
            "description": "Whether every public API key that reaches this store must be limited to a list of IP addresses. While on, a key with no list is refused on this store with 403 `api_key_ip_restriction_required`. Set by the store owner.\n",
            "default": false
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Pre-signed S3 GET URL for the private (invoice/receipt) store logo, valid for 1 hour. Null when no logo has been uploaded. Regenerated on every response so the URL is always fresh at load time.\n"
          },
          "public_logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Stable, world-readable URL for the store's public brand logo (shown on the buylist + card-link storefronts). Served directly from the public assets bucket — non-expiring, safe to cache. Null when no public logo has been uploaded. Distinct from logo_url.\n"
          },
          "public_logo_dark_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Stable, world-readable URL for the store's dark-mode public logo (uploadStorePublicLogo with mode dark), shown on the buylist and kiosk storefronts in dark mode. Null when none has been uploaded; the storefronts then show public_logo_url in both modes.\n"
          },
          "primary_color": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public brand primary color as a hex string (e.g. \"#5b2c90\"), or null, used against a LIGHT background. Overrides --color-primary on the store's public storefronts.\n"
          },
          "primary_color_dark": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public brand primary color as a hex string (e.g. \"#8b5cf6\"), or null, used against a DARK background. Pairs with primary_color so the accent always contrasts correctly in both modes.\n"
          },
          "theme": {
            "type": "string",
            "enum": [
              "light",
              "dark"
            ],
            "description": "The store's default rendering mode for its public storefronts.\n",
            "default": "light"
          },
          "public_slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public storefront address (slug) — the store's public identifier, unique across stores. Resolves the buylist storefront + custom-domain routing. Auto-assigned from the store name at creation; owner-editable.\n"
          },
          "public_listings_enabled": {
            "type": "boolean",
            "description": "Whether the store exposes public per-card listing pages (link.hippolink.app/{public_slug}/{sku}). Independent of the buylist storefront's published state. Defaults false.\n",
            "default": false
          },
          "push_barcodes": {
            "type": "boolean",
            "description": "Whether sealed products' manufacturer barcodes are written onto the store's Square and Shopify listings. Defaults false.\n",
            "default": false
          },
          "available_marketplaces": {
            "type": "array",
            "description": "The selling marketplaces the caller may see and connect for this store, in display order (#4479). Returned by getStore and updateStore only. A marketplace not listed is hidden: restricted to an allowlist the store is not on, or not offered in the store's currency. A store always sees a marketplace it is connected to, and an admin sees every one. Connect routes enforce the same rule with 403 marketplace_not_available.\n",
            "items": {
              "$ref": "#/components/schemas/AvailableMarketplace"
            }
          }
        }
      },
      "AvailableMarketplace": {
        "type": "object",
        "required": [
          "platform",
          "visible_reason",
          "currency_state"
        ],
        "properties": {
          "platform": {
            "$ref": "#/components/schemas/Marketplace"
          },
          "visible_reason": {
            "type": "string",
            "enum": [
              "connected",
              "public",
              "allowlisted",
              "admin_only"
            ],
            "description": "Why it is visible. `admin_only` means only because the caller is an admin: the store itself would not see it.\n"
          },
          "currency_state": {
            "type": "string",
            "enum": [
              "ok",
              "converted",
              "blocked"
            ],
            "description": "What connecting means in the store's currency. `converted`: it lists in one other currency and prices are converted at push time. `blocked`: connect answers 409 currency_mismatch, so show the card disabled.\n"
          }
        }
      },
      "StoreSummary": {
        "type": "object",
        "required": [
          "store_uuid",
          "name",
          "location",
          "vacation_start_at",
          "vacation_end_at",
          "vacation_active",
          "status"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "location": {
            "$ref": "#/components/schemas/Address"
          },
          "vacation_start_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vacation_end_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vacation_active": {
            "type": "boolean",
            "description": "Whether the store is currently in active vacation mode.",
            "default": false
          },
          "status": {
            "type": "string",
            "enum": [
              "idle",
              "repricing",
              "importing",
              "exporting",
              "rolling_back",
              "deleting"
            ]
          },
          "require_mfa": {
            "type": "boolean",
            "description": "Whether the store requires MFA for all team members.",
            "default": false
          },
          "require_api_key_ip_allowlist": {
            "type": "boolean",
            "description": "Whether every public API key that reaches this store must be limited to a list of IP addresses, so a key editor can mark the store.\n",
            "default": false
          }
        }
      },
      "SubscriptionLevel": {
        "type": "string",
        "enum": [
          "free",
          "pro",
          "scale",
          "enterprise"
        ]
      },
      "FoundRequest": {
        "type": "object",
        "required": [
          "found_qty"
        ],
        "properties": {
          "found_qty": {
            "type": "integer",
            "minimum": 0,
            "description": "How many copies the picker actually found at this stop (0 = none). May exceed the stop's planned quantity — a surplus (an uncounted extra in the bin) is spent against the same order line's other same-SKU stops.\n"
          }
        }
      },
      "SplitPickItemRequest": {
        "type": "object",
        "required": [
          "quantity"
        ],
        "properties": {
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Copies to move onto the new pick item. Must leave the original at least one copy.\n"
          },
          "expected_quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Optional idempotency guard: the quantity the client believes the item holds. If the item holds a different quantity the split is refused with 409 `pick_item_changed` and nothing is written, so a retry of a split that already applied is a no-op.\n"
          }
        }
      },
      "PickPickItemsRequest": {
        "type": "object",
        "required": [
          "pick_item_uuids"
        ],
        "properties": {
          "pick_item_uuids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 250,
            "description": "Items to mark picked. Duplicates and case are normalized.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "PickPickItemsResult": {
        "type": "object",
        "required": [
          "picked",
          "skipped"
        ],
        "properties": {
          "picked": {
            "type": "array",
            "description": "Items this call moved to picked, in request order.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped": {
            "type": "array",
            "description": "Items left as they were (already picked, or missing), in request order.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "RelocatePickItemRequest": {
        "type": "object",
        "required": [
          "location_uuid"
        ],
        "properties": {
          "location_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The bin to take the card from, a `same_sku` candidate's location_uuid."
          },
          "slot": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "The candidate's slot (which of the SKU's positions in that bin)."
          }
        }
      },
      "SubstituteRequest": {
        "type": "object",
        "required": [
          "substitute_sku_id"
        ],
        "properties": {
          "substitute_sku_id": {
            "type": "integer",
            "description": "The tcgplayer_sku_id of the substitute card to pick instead"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional notes about the substitution"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The bin the picker was shown (the candidate's location_uuid). With slot, the row the substitute is pulled from; it must still have enough unreserved copies, else 409 substitute_row_unavailable. Omit to let the server choose.\n"
          },
          "slot": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The candidate's slot within that bin. Defaults to 0 when location_uuid is set; 400 when given without location_uuid.\n"
          }
        }
      },
      "FulfillmentCandidate": {
        "description": "A way to fulfill a short pick line, tagged by `kind`. `kind=\"substitute\"` is a *different* SKU (same product/language/finish/game, any condition; Unopened matches only Unopened) the seller can send instead — selecting it via `POST .../substitute` moves stock and COGS between the two SKUs. `kind=\"same_sku\"` is another row holding the *same* ordered SKU (excluding the assigned row) — a bin can hold a SKU at more than one storage row, so the same bin can appear here twice — informational only; pick-complete decrements physical stock across all bins, so pulling from one records no substitution and moves no COGS.\n\nQuantities read differently per kind. For `substitute`, `quantity_visible` / `total_quantity` are store-wide sums across the SKU's bins and `location_*` / `bin_*` point at its single best-stocked bin. For `same_sku`, the row *is* one storage row, so those quantities are per-row and `condition` / `language` / `finish` restate the ordered SKU's own (identical) attributes.\n",
        "type": "object",
        "required": [
          "kind",
          "tcgplayer_sku_id",
          "condition",
          "language",
          "finish",
          "quantity_visible",
          "total_quantity",
          "on_route"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "substitute",
              "same_sku"
            ],
            "description": "`substitute` = a different SKU the seller can send instead (a real substitution). `same_sku` = another row holding the same ordered SKU (informational, not a substitution).\n"
          },
          "tcgplayer_sku_id": {
            "type": "integer"
          },
          "condition": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "finish": {
            "type": "string"
          },
          "quantity_visible": {
            "type": "integer",
            "description": "Sellable/listable copies. Store-wide sum across the SKU's bins for `substitute`; per-row for `same_sku`.\n"
          },
          "total_quantity": {
            "type": "integer",
            "description": "Physical copies. Store-wide sum across the SKU's bins for `substitute`; per-row for `same_sku`.\n"
          },
          "free_quantity": {
            "type": "integer",
            "description": "`same_sku` only: copies in this row no active run holds. A relocate needs at least the pick item's quantity.\n"
          },
          "on_route": {
            "type": "boolean",
            "description": "True when this row's bin (a `substitute`'s best-stocked bin) is one where the run still has another pending, non-missing stop, so the picker is walking there anyway. For `same_sku`, taking the copy costs no detour and a relocate into it joins that stop instead of adding a second pass; on-route rows are listed before the rest. False when the bin is off the route.\n"
          },
          "location_uuid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Best-stocked bin for a `substitute` (null when the SKU has no located stock); the bin itself for a `same_sku` (always present).\n"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "location_full_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Materialized breadcrumb to the bin (`inventory_locations.full_path`), e.g. \"Back Room > Bulk Storage > Bulk Bin 2\". Same field the run's own pick items carry, so a detour stop reads the way every other stop does instead of showing a bare bin name.\n"
          },
          "sequence_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "slot": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Which of the SKU's positions in the bin this candidate's row is from (storage slots). Null when the SKU has no located stock (`substitute` with no bin).\n"
          },
          "bin_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based place of the SKU among the copies physically in its bin, counted from the front (1 + copies stored ahead of its row). Null when no location."
          },
          "bin_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Copies physically in the bin (sum of every stocked row's quantity). Null when no location."
          },
          "bin_position": {
            "type": [
              "number",
              "null"
            ],
            "format": "float",
            "minimum": 0,
            "maximum": 1,
            "description": "Copy-depth of the SKU within its bin, 0.0 (front) to ~1.0 (back) = copies stored ahead of it / total copies in the bin. Null when no counted copies."
          }
        }
      },
      "SyncTaskStatus": {
        "type": "string",
        "enum": [
          "pending",
          "dispatched",
          "running",
          "succeeded",
          "skipped",
          "retryable",
          "failed_terminal"
        ]
      },
      "SyncTaskSummary": {
        "description": "Summary of a sync task attempt with timing and result.",
        "type": "object",
        "required": [
          "sync_task_id",
          "source_platform",
          "target_platform",
          "sku",
          "product_name",
          "status"
        ],
        "properties": {
          "sync_task_id": {
            "type": "string"
          },
          "source_platform": {
            "type": "string",
            "enum": [
              "manapool",
              "shopify",
              "square",
              "tcgplayer"
            ]
          },
          "target_platform": {
            "type": "string",
            "enum": [
              "manapool",
              "shopify",
              "square",
              "tcgplayer"
            ]
          },
          "sku": {
            "type": "integer",
            "format": "int64"
          },
          "product_name": {
            "type": "string"
          },
          "sold_qty": {
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/SyncTaskStatus"
          },
          "previous_qty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "new_qty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "skip_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TrackingEvent": {
        "type": "object",
        "required": [
          "status",
          "message",
          "occurred_at"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/TrackingStatus"
          },
          "message": {
            "type": "string",
            "description": "Human-readable tracking update message"
          },
          "location": {
            "type": "string",
            "description": "Location of the tracking event (city, state)"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TrackingStatus": {
        "type": "string",
        "enum": [
          "unknown",
          "pre_transit",
          "in_transit",
          "out_for_delivery",
          "delivered",
          "return_to_sender",
          "failure",
          "canceled"
        ]
      },
      "User": {
        "type": "object",
        "required": [
          "user_uuid",
          "first_name",
          "last_name",
          "email",
          "stores",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "user_uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Supabase auth user UUID"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "terms_accepted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the user accepted the Terms of Use and Privacy Policy. Null for accounts provisioned before this was captured."
          },
          "stores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserStoreAssociation"
            }
          },
          "pending_invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingInvitation"
            },
            "description": "Store invitations the user hasn't accepted yet"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserRole": {
        "type": "string",
        "enum": [
          "store_owner",
          "store_manager",
          "store_employee",
          "registered_user"
        ]
      },
      "UserStoreAssociation": {
        "type": "object",
        "required": [
          "store_uuid",
          "name",
          "role",
          "subscription_level"
        ],
        "properties": {
          "store_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "subscription_level": {
            "$ref": "#/components/schemas/SubscriptionLevel"
          }
        }
      },
      "LightspeedLine": {
        "type": "string",
        "enum": [
          "x_series",
          "r_series"
        ],
        "description": "Which Lightspeed Retail product line: `x_series` (ex-Vend, `*.retail.lightspeed.app`) or `r_series` (ex-Lightspeed Retail, `cloud.lightspeedapp.com`).\n"
      },
      "LightspeedLocationsResult": {
        "type": "object",
        "required": [
          "line",
          "locations",
          "push_location_ids",
          "primary_only_presence"
        ],
        "properties": {
          "line": {
            "$ref": "#/components/schemas/LightspeedLine"
          },
          "locations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "currency": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "selected_location_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The main location (`lightspeed_primary_location_id`), null until chosen."
          },
          "push_location_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary_only_presence": {
            "type": "boolean",
            "description": "Whether new products are created at the main location only."
          }
        }
      },
      "LightspeedCategoriesResult": {
        "type": "object",
        "required": [
          "categories",
          "category_layout"
        ],
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "path"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "parent_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "path": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Names from the top-level category down to this one."
                }
              }
            }
          },
          "category_layout": {
            "type": "string",
            "enum": [
              "nested",
              "flat",
              "off"
            ]
          },
          "category_parent_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EbayListingCapSource": {
        "type": "string",
        "enum": [
          "auto",
          "manual"
        ],
        "description": "auto follows eBay's own monthly selling limit on every refresh; manual is a cap the seller set and a refresh never overwrites.\n"
      },
      "EbayLimitStrategy": {
        "type": "string",
        "enum": [
          "value_first",
          "most_cards"
        ],
        "description": "How cards are chosen when eBay's selling limit binds (its dollars or units cannot cover every qualifying card). value_first (the default) takes the most valuable cards first; most_cards takes the cheapest first, listing more distinct cards for the same limit. Cards tagged sell-on-ebay lead either way, and a card that does not fit is skipped for one that does. No effect until the remaining limit has been read from eBay.\n"
      },
      "EbayListingFeePolicy": {
        "type": "string",
        "enum": [
          "free_only",
          "allow_paid"
        ],
        "description": "free_only (the default) asks eBay what publishing costs before each batch of new listings and holds back any that would incur an insertion fee until the free-listing allowance resets; the most valuable cards are published first. Held-back listings stay created but unpublished and are retried automatically. allow_paid publishes new listings whatever they cost.\n"
      },
      "EbayFeeEstimate": {
        "type": "object",
        "description": "An estimate of the store's monthly insertion fees from eBay's published Store-tier allowances (the \"select categories\" figures, which include trading cards), not a quote. Every numeric field is null until the subscription has been read once, or when the tier is one this table does not know. Whether eBay counts HippoLink's card category as a select category is unconfirmed, so the all-categories allowance is returned too.\n",
        "required": [
          "tier",
          "free_listings_per_month",
          "free_listings_all_categories",
          "insertion_fee_cents",
          "estimated_monthly_insertion_fees_cents",
          "renewals_consume_allowance",
          "estimate"
        ],
        "properties": {
          "tier": {
            "type": [
              "string",
              "null"
            ],
            "description": "Normalized Store tier (STARTER, BASIC, PREMIUM, ANCHOR, ENTERPRISE, or another value eBay reported). Null with numbers present means no Store subscription; null with null numbers means the subscription has not been read yet.\n"
          },
          "free_listings_per_month": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Zero-insertion-fee listings per month in select categories (incl. trading cards)."
          },
          "free_listings_all_categories": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Zero-insertion-fee listings per month in all categories."
          },
          "insertion_fee_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Insertion fee per listing beyond the allowance, in cents."
          },
          "estimated_monthly_insertion_fees_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "included_count beyond free_listings_per_month times insertion_fee_cents. Listings made outside HippoLink also spend the allowance and are not counted.\n"
          },
          "renewals_consume_allowance": {
            "type": "boolean",
            "description": "Always true; good-'til-cancelled renewals spend the monthly allowance."
          },
          "estimate": {
            "type": "boolean",
            "description": "Always true; this is a published-table estimate, never eBay's own quote."
          }
        }
      },
      "MisprintAccount": {
        "type": "object",
        "description": "Live Misprint seller status. Values are USD dollars as Misprint sends them; a field Misprint omitted is null.\n",
        "required": [
          "seller_level",
          "vacation_mode",
          "active_listings_count",
          "listing_limits",
          "fetched_at"
        ],
        "properties": {
          "seller_level": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Misprint seller tier, 1 (newest) to 5. It drives the listing limits."
          },
          "vacation_mode": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "active_listings_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Listings live and buyable. Zero while vacation mode is on."
          },
          "listing_limits": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "listing_count_current",
              "listing_count_limit",
              "listing_count_pending",
              "listing_value_current",
              "listing_value_limit",
              "listing_value_pending",
              "individual_listing_limit"
            ],
            "properties": {
              "listing_count_current": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Listings consuming the allowance, vacation-suspended ones included."
              },
              "listing_count_limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "listing_count_pending": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Accepted creates not yet applied; they count against the cap."
              },
              "listing_value_current": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "USD value of the listings in listing_count_current."
              },
              "listing_value_limit": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "listing_value_pending": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "USD value of accepted creates not yet applied."
              },
              "individual_listing_limit": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Maximum USD value of one listing (price x quantity)."
              }
            }
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EbaySettings": {
        "type": "object",
        "required": [
          "rule_enabled",
          "price_threshold_cents",
          "listing_cap",
          "listing_cap_source",
          "selling_limit_quantity",
          "selling_limit_amount_cents",
          "selling_limit_currency",
          "selling_limit_checked_at",
          "selling_limit_remaining_quantity",
          "selling_limit_remaining_amount_cents",
          "selling_limit_outside_quantity",
          "selling_limit_outside_amount_cents",
          "selling_limit_remaining_checked_at",
          "subscription_level",
          "subscription_term",
          "subscription_checked_at",
          "listing_fee_policy",
          "max_quantity_per_listing",
          "limit_strategy",
          "fee_estimate",
          "free_listings_exhausted_on",
          "included_count",
          "listing_description_template",
          "listing_description_default",
          "listing_description_variables"
        ],
        "properties": {
          "rule_enabled": {
            "type": "boolean",
            "description": "Whether the price-threshold rule is on. Stored and returned here; the rule itself takes effect once the eBay provider ships.\n"
          },
          "price_threshold_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minimum listing price in cents for the price-threshold rule, or null. Minimum 99 cents, eBay's own fixed-price minimum.\n"
          },
          "listing_cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Maximum number of SKUs the store will opt in to eBay, or null for no cap. A soft fee guard enforced by inventory-service's eBay inclusion writes; eBay's own selling limit is the hard cap. Note eBay's selling limit is a monthly cap on item units sold, while this cap counts distinct SKUs -- an auto cap copies the unit quantity as a SKU count, so it is an approximation.\n"
          },
          "listing_cap_source": {
            "$ref": "#/components/schemas/EbayListingCapSource"
          },
          "selling_limit_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The store's eBay account's monthly selling limit (item units sold, not a SKU count), as of the last refresh. Null means eBay reported no limit, or the store has never refreshed.\n"
          },
          "selling_limit_amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The store's eBay account's monthly selling limit (dollar amount, in cents), as of the last refresh. Null means eBay reported no limit, or the store has never refreshed.\n"
          },
          "selling_limit_currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 4217 currency code eBay reported the selling-limit amount in (the seller's account currency, not necessarily USD). Null until the limit has been refreshed.\n"
          },
          "selling_limit_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the selling limit was last refreshed from eBay, or null."
          },
          "selling_limit_remaining_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many more units eBay will let the account list, as of selling_limit_remaining_checked_at. eBay counts every available unit across all active listings, the seller's own included; sold units and unpublished offers do not count. Null means unknown or no limit.\n"
          },
          "selling_limit_remaining_amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How much more listed value (available quantity x price, in cents of selling_limit_currency) eBay will accept. Null means unknown or no limit.\n"
          },
          "selling_limit_outside_quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units of the limit used by listings HippoLink did not make (the limit minus remaining minus HippoLink's live units at the time of the check). Null when unknown.\n"
          },
          "selling_limit_outside_amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Listed value, in cents, used by listings HippoLink did not make. Null when unknown."
          },
          "selling_limit_remaining_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the remaining figures were last read from eBay, or null."
          },
          "subscription_level": {
            "type": [
              "string",
              "null"
            ],
            "description": "The eBay Store subscription level as eBay reported it, or null for no Store (or never checked; see subscription_checked_at).\n"
          },
          "subscription_term": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Store subscription term as eBay reported it (e.g. \"1 MONTH\"), or null."
          },
          "subscription_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the Store subscription was last read from eBay, or null if never."
          },
          "listing_fee_policy": {
            "$ref": "#/components/schemas/EbayListingFeePolicy"
          },
          "max_quantity_per_listing": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The most copies of a card each eBay listing offers, or null to list all the stock. eBay's selling limit counts every available unit at its price, so a lower number lists more distinct cards under the same limit. A sale lowers stock and the next push tops the listing back up to this number.\n"
          },
          "limit_strategy": {
            "$ref": "#/components/schemas/EbayLimitStrategy"
          },
          "fee_estimate": {
            "$ref": "#/components/schemas/EbayFeeEstimate"
          },
          "free_listings_exhausted_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The UTC date this month on which the push last found the store's free-listing allowance used up, while it may still be; new listings wait until the allowance resets (free_only). Null once eBay reports free listings again, and for any earlier month.\n"
          },
          "included_count": {
            "type": "integer",
            "description": "Current count of this store's SKUs opted in to eBay (decision=include)."
          },
          "listing_description_template": {
            "type": [
              "string",
              "null"
            ],
            "description": "The store's template for the description on every eBay listing HippoLink creates, or null for the default (listing_description_default). Plain text with $VARIABLE merge variables, the same syntax as the store email templates. Every character is HTML-escaped; lines become line breaks and blank lines separate paragraphs; a line whose variables are all empty for a card is left out. Applies to listings created after it is saved.\n"
          },
          "listing_description_default": {
            "type": "string",
            "description": "The default template, used while listing_description_template is null."
          },
          "listing_description_variables": {
            "type": "array",
            "description": "The merge variables a description template may use.",
            "items": {
              "$ref": "#/components/schemas/EmailTemplateVariable"
            }
          }
        }
      },
      "EbayRulePreview": {
        "type": "object",
        "required": [
          "would_list",
          "already_listed",
          "over_cap",
          "over_budget",
          "cap",
          "threshold_cents",
          "capped"
        ],
        "properties": {
          "would_list": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cards the rule would newly list. When capped, an upper bound (the cap's free slots), or null without a cap.\n"
          },
          "already_listed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Selected listings that stay under the rule. Null when capped."
          },
          "over_cap": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Qualifying cards the listing cap leaves out. Null when capped."
          },
          "over_budget": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Qualifying cards (and selected cards not yet live) that do not fit in what is left of the eBay selling limit after the seller's own listings. 0 when the limit or the seller's own usage is unknown. Null when capped.\n"
          },
          "cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The store's listing cap, null for none."
          },
          "threshold_cents": {
            "type": "integer",
            "minimum": 99,
            "description": "The threshold the preview used."
          },
          "capped": {
            "type": "boolean",
            "description": "True when the scan was cut by the statement timeout and the counts are partial."
          }
        }
      },
      "WhatnotSettings": {
        "type": "object",
        "required": [
          "rule_enabled",
          "price_threshold_cents",
          "listing_cap",
          "included_count"
        ],
        "properties": {
          "rule_enabled": {
            "type": "boolean",
            "description": "Whether the price rule selects cards at or above the threshold."
          },
          "price_threshold_cents": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "description": "The rule's threshold in cents; null lists every priced card while the rule is on."
          },
          "listing_cap": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Most SKUs selected for Whatnot; null for no cap."
          },
          "included_count": {
            "type": "integer",
            "minimum": 0,
            "description": "SKUs currently selected for Whatnot."
          }
        }
      },
      "WhatnotRulePreview": {
        "type": "object",
        "required": [
          "would_list",
          "already_listed",
          "over_cap",
          "cap",
          "threshold_cents",
          "capped"
        ],
        "properties": {
          "would_list": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Cards the rule would newly list. When capped, an upper bound (the cap's free slots), or null without a cap.\n"
          },
          "already_listed": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Selected listings that stay under the rule. Null when capped."
          },
          "over_cap": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Qualifying cards the listing cap leaves out. Null when capped."
          },
          "over_budget": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Always 0 (Whatnot has no selling limit); null when capped."
          },
          "cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The store's listing cap, null for none."
          },
          "threshold_cents": {
            "type": "integer",
            "minimum": 1,
            "description": "The threshold the preview used."
          },
          "capped": {
            "type": "boolean",
            "description": "True when the scan was cut by the statement timeout and the counts are partial."
          }
        }
      },
      "EbayDescriptionPreviewRequest": {
        "type": "object",
        "required": [
          "template"
        ],
        "properties": {
          "template": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000,
            "description": "The template to render; null renders the default."
          }
        }
      },
      "EbayDescriptionPreview": {
        "type": "object",
        "required": [
          "html",
          "text"
        ],
        "description": "A template rendered for a sample card.",
        "properties": {
          "html": {
            "type": "string",
            "description": "What eBay shows as the listing description (escaped, safe to display)."
          },
          "text": {
            "type": "string",
            "description": "The same description as plain text."
          }
        }
      },
      "EbayPolicyOption": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "description": "A business policy already on the seller's eBay account.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EbayOnboardingPolicies": {
        "type": "object",
        "required": [
          "fulfillment",
          "payment",
          "return"
        ],
        "description": "The policies of each type currently on the seller's eBay account.",
        "properties": {
          "fulfillment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EbayPolicyOption"
            }
          },
          "payment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EbayPolicyOption"
            }
          },
          "return": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EbayPolicyOption"
            }
          }
        }
      },
      "EbaySelectedPolicies": {
        "type": "object",
        "required": [
          "fulfillment_policy_id",
          "payment_policy_id",
          "return_policy_id"
        ],
        "description": "The policy ids HippoLink currently has on file for this store, or null.",
        "properties": {
          "fulfillment_policy_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_policy_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "return_policy_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EbaySetupState": {
        "type": "object",
        "required": [
          "complete",
          "missing"
        ],
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "True when the three policy ids and the item location are stored."
          },
          "missing": {
            "type": "array",
            "description": "The unfinished setup steps; empty when complete.",
            "items": {
              "type": "string",
              "enum": [
                "policies",
                "location"
              ]
            }
          }
        }
      },
      "EbayOnboardingStatus": {
        "type": "object",
        "required": [
          "opted_in",
          "policies",
          "selected",
          "suggested",
          "merchant_location_key",
          "location_exists",
          "complete"
        ],
        "properties": {
          "opted_in": {
            "type": "boolean",
            "description": "Whether the store has opted into eBay's Business Policy Management program."
          },
          "policies": {
            "$ref": "#/components/schemas/EbayOnboardingPolicies"
          },
          "selected": {
            "$ref": "#/components/schemas/EbaySelectedPolicies"
          },
          "suggested": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EbaySelectedPolicies"
              }
            ],
            "description": "Per type, the policy to preselect: the one on file, else the seller's only policy of that type, else null.\n"
          },
          "merchant_location_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The eBay inventory location key HippoLink created for this store, or null."
          },
          "location_exists": {
            "type": "boolean",
            "description": "Whether that location currently exists on the seller's eBay account."
          },
          "complete": {
            "type": "boolean",
            "description": "Whether every requirement publishOffer needs is satisfied: opted in, all three policies selected, and the location exists.\n"
          }
        }
      },
      "ApiTokenResponse": {
        "type": "object",
        "description": "An OAuth 2.0 client-credentials style token response.",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The JWT to send as `Authorization: Bearer <access_token>` on every other call."
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "expires_in": {
            "type": "integer",
            "description": "Seconds until the token expires (3600).",
            "examples": [
              3600
            ]
          }
        }
      }
    }
  }
}
