{
  "components": {
    "parameters": {
      "ActorID": {
        "description": "A superuser id. Rows written by a token or by the engine itself carry none and are never matched by this.",
        "in": "query",
        "name": "actor_id",
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "CartID": {
        "description": "The cart's opaque token.",
        "in": "path",
        "name": "cartId",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ChangeID": {
        "description": "An order change of the order named by id. One belonging to another order is reported as not found.",
        "in": "path",
        "name": "changeId",
        "required": true,
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "CustomerSessionHeader": {
        "description": "The signed-in shopper's session token (CustomerSession.token), sent by the storefront's server from its HttpOnly cookie.",
        "in": "header",
        "name": "X-Customer-Session",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "DryRun": {
        "description": "Validate the whole file and roll back.",
        "in": "query",
        "name": "dry_run",
        "schema": {
          "default": false,
          "type": "boolean"
        }
      },
      "EventID": {
        "description": "The event's uuid — the stable identity a handler dedupes on and a log line prints, not the table's row number.",
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "Format": {
        "description": "The CSV dialect: `nerocart` (the store's own, the default) or `shopify` — Shopify's own column names, so a file goes either way between the two stores without an edit.",
        "in": "query",
        "name": "format",
        "schema": {
          "default": "nerocart",
          "enum": [
            "nerocart",
            "shopify"
          ],
          "type": "string"
        }
      },
      "From": {
        "description": "Inclusive lower bound, YYYY-MM-DD or RFC 3339.",
        "in": "query",
        "name": "from",
        "schema": {
          "type": "string"
        }
      },
      "Lang": {
        "description": "Overrides Accept-Language. Falls back to the store's default language when unsupported.",
        "in": "query",
        "name": "lang",
        "schema": {
          "example": "en",
          "type": "string"
        }
      },
      "Limit": {
        "description": "How many records to return.",
        "in": "query",
        "name": "limit",
        "schema": {
          "default": 50,
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        }
      },
      "LineID": {
        "in": "path",
        "name": "lineId",
        "required": true,
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "ListingCategory": {
        "description": "Only products filed under this category or beneath it (its slug in any language). Unknown: 404.",
        "in": "query",
        "name": "category",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "ListingCollection": {
        "description": "Only this collection's products (its slug in any language), in its curated order unless `sort` is given. Unknown: 404.",
        "in": "query",
        "name": "collection",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "ListingColor": {
        "description": "Colour facet values (`value` from GET /products/facets), repeated or comma-separated; several widen (black OR navy). A product's colour is its option whose display is `color`, or, when display is automatic, its option named Renk/Color/Colour/Farbe; matched case-insensitively. At most 30. Matched per variant together with size, stock, sale and price (ADR-0063).",
        "explode": true,
        "in": "query",
        "name": "color",
        "required": false,
        "schema": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "style": "form"
      },
      "ListingPriceMax": {
        "description": "Highest variant price, minor units of the market's currency, inclusive. A reversed range is put in order.",
        "in": "query",
        "name": "price_max",
        "required": false,
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "ListingPriceMin": {
        "description": "Lowest variant price, minor units of the market's currency, inclusive.",
        "in": "query",
        "name": "price_min",
        "required": false,
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "ListingSale": {
        "description": "`true`: only variants whose compare-at price in the market's currency is above what they cost.",
        "in": "query",
        "name": "sale",
        "required": false,
        "schema": {
          "type": "boolean"
        }
      },
      "ListingSize": {
        "description": "Size facet values (option Beden/Size/Größe/Numara), as `color`.",
        "explode": true,
        "in": "query",
        "name": "size",
        "required": false,
        "schema": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "style": "form"
      },
      "ListingType": {
        "description": "Only products of this product type (exact).",
        "in": "query",
        "name": "type",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "Offset": {
        "description": "How many records to skip. Ignored when `page` is also given.",
        "in": "query",
        "name": "offset",
        "schema": {
          "default": 0,
          "minimum": 0,
          "type": "integer"
        }
      },
      "Overwrite": {
        "description": "Whether a product the store already has — by slug, or Handle in Shopify's dialect — is updated from the file. On by default, because a re-import of an edited export is the common case; send `false` to leave existing products alone and create only the new ones, which is what loading a second catalogue beside the first needs.",
        "in": "query",
        "name": "overwrite",
        "schema": {
          "default": true,
          "type": "boolean"
        }
      },
      "PageNumber": {
        "description": "The page to return, counting from 1. An alternative to `offset` — `?limit=20\u0026page=3` is the same window as `?limit=20\u0026offset=40`. When both are sent, `page` wins: it is the more specific intent.",
        "in": "query",
        "name": "page",
        "schema": {
          "default": 1,
          "minimum": 1,
          "type": "integer"
        }
      },
      "PathID": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "format": "int64",
          "minimum": 1,
          "type": "integer"
        }
      },
      "ReportFrom": {
        "description": "Inclusive lower bound, YYYY-MM-DD or RFC 3339. A bare date is midnight in `tz`, not in UTC. Defaults to 30 days before `to`, computed in `tz`.",
        "in": "query",
        "name": "from",
        "schema": {
          "type": "string"
        }
      },
      "ReportGroupBy": {
        "description": "The interval each bucket covers. Weeks are ISO, starting Monday. A window of more than 400 buckets at the requested grain is refused, naming a coarser one.",
        "in": "query",
        "name": "group_by",
        "schema": {
          "default": "day",
          "enum": [
            "day",
            "week",
            "month"
          ],
          "type": "string"
        }
      },
      "ReportTimeZone": {
        "description": "An IANA zone name whose midnights the buckets and the window bounds are both cut on. Matched case-insensitively against the database's own zone catalogue and echoed back canonicalised.",
        "in": "query",
        "name": "tz",
        "schema": {
          "default": "UTC",
          "example": "Asia/Kolkata",
          "type": "string"
        }
      },
      "ReportTo": {
        "description": "Exclusive upper bound, YYYY-MM-DD or RFC 3339, resolved in `tz`. Defaults to now. Exclusive is the rule GET /api/admin/orders uses, so a range ending on the 30th asks for to=the 1st.",
        "in": "query",
        "name": "to",
        "schema": {
          "type": "string"
        }
      },
      "ReturnID": {
        "description": "A return of the order named by id. One belonging to another order is reported as not found.",
        "in": "path",
        "name": "returnId",
        "required": true,
        "schema": {
          "format": "int64",
          "type": "integer"
        }
      },
      "SortOrder": {
        "description": "Which way to sort. Only meaningful beside `sort`: sending it alone is refused rather than guessed at, because the default orderings are fixed clauses with their own direction and there is nothing coherent to flip. `desc` is the exact reverse of `asc`, including among rows that tie on the sort field.",
        "in": "query",
        "name": "order",
        "schema": {
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        }
      },
      "To": {
        "description": "Exclusive upper bound.",
        "in": "query",
        "name": "to",
        "schema": {
          "type": "string"
        }
      },
      "TurnstileToken": {
        "description": "The Cloudflare Turnstile widget's token (its `cf-turnstile-response` field) for a guarded public form (ADR-0096). Needed only when keys apply to the host: the storefront's site answer (`turnstile_site_key`) and the admin's auth-state say which widget to render. At most 2048 characters; each token is good for one request.",
        "in": "header",
        "name": "X-Turnstile-Token",
        "required": false,
        "schema": {
          "maxLength": 2048,
          "type": "string"
        }
      }
    },
    "responses": {
      "AuthResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "properties": {
                    "expires_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "record": {
                      "$ref": "#/components/schemas/Superuser"
                    },
                    "token": {
                      "description": "Send as `Authorization: Bearer \u003ctoken\u003e`.",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "A session token and the operator it belongs to."
      },
      "CartResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Cart"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The cart."
      },
      "CollectionResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Collection"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The collection."
      },
      "Conflict": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The request conflicts with the current state."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "Authenticated, and the role does not carry the right this route needs. Distinct from 401: the credential is good, the answer is still no."
      },
      "ImportResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "What the import did."
      },
      "MediaResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Media"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The library item."
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "No such resource."
      },
      "OrderResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Order"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The order."
      },
      "PaymentResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Payment"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The payment."
      },
      "ProductResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Product"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The product."
      },
      "SuperuserResponse": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/Superuser"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "The operator."
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "A valid admin token is required."
      },
      "Validation": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The request was malformed."
      }
    },
    "schemas": {
      "AIProviderInfo": {
        "properties": {
          "default_model": {
            "type": "string"
          },
          "id": {
            "description": "anthropic, openai, gemini, xai, mistral, deepseek, qwen, cohere, perplexity, groq or openrouter.",
            "type": "string"
          },
          "keys_url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "default_model",
          "keys_url"
        ],
        "type": "object"
      },
      "AIStatus": {
        "description": "The store's AI assistant (ADR-0113): whether it can be used, through which provider and model, and whose key — the store's own (the ai-assistant plugin) or the platform's.",
        "properties": {
          "configured": {
            "description": "False: no key anywhere; every AI feature falls back to its rules.",
            "type": "boolean"
          },
          "model": {
            "type": "string"
          },
          "provider": {
            "description": "anthropic or openai.",
            "type": "string"
          },
          "source": {
            "description": "store (the store's own key) or platform (NeroCart's).",
            "type": "string"
          }
        },
        "required": [
          "configured"
        ],
        "type": "object"
      },
      "AITestResult": {
        "properties": {
          "error": {
            "enum": [
              "not_configured",
              "provider_error",
              "rate_limited",
              "timeout",
              "network",
              "refused",
              "invalid_answer"
            ],
            "type": "string"
          },
          "http_status": {
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "description": "What the provider said, when the panel can explain it: credit (no credit or quota left), workspace (an Anthropic key not scoped to a workspace), model (unknown model name), key (the key was refused).",
            "enum": [
              "credit",
              "workspace",
              "model",
              "key"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AIStatus"
          }
        },
        "required": [
          "ok",
          "status"
        ],
        "type": "object"
      },
      "AccountView": {
        "properties": {
          "announcements": {
            "items": {
              "$ref": "#/components/schemas/Announcement"
            },
            "type": "array"
          },
          "entitlements": {
            "$ref": "#/components/schemas/Entitlements"
          },
          "exports": {
            "items": {
              "$ref": "#/components/schemas/TenantRequest"
            },
            "type": "array"
          },
          "features": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "state": {
            "$ref": "#/components/schemas/TenantState"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "usage": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          }
        },
        "required": [
          "tenant_id",
          "state",
          "entitlements",
          "usage",
          "announcements",
          "features",
          "exports"
        ],
        "type": "object"
      },
      "Address": {
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "example": "US",
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "line1",
          "city",
          "postal_code",
          "country"
        ],
        "type": "object"
      },
      "AddressAssistState": {
        "description": "The checkout's address help (ADR-0048): both off unless the store's google-maps-address plugin is on and holds a key.",
        "properties": {
          "autocomplete": {
            "type": "boolean"
          },
          "regions": {
            "description": "The countries (ISO 3166-1 alpha-2) the help covers.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "validation": {
            "type": "boolean"
          }
        },
        "required": [
          "autocomplete",
          "validation",
          "regions"
        ],
        "type": "object"
      },
      "AddressAssistStatus": {
        "properties": {
          "limit": {
            "description": "The store's monthly lookups on NeroCart's key; 0 unless source is platform.",
            "type": "integer"
          },
          "month": {
            "description": "The count's month, 2026-10 (UTC).",
            "type": "string"
          },
          "platform_available": {
            "description": "NeroCart's key is set.",
            "type": "boolean"
          },
          "server_ip": {
            "description": "The IP address a key of the store's own is restricted to.",
            "type": "string"
          },
          "source": {
            "enum": [
              "store",
              "platform",
              "none"
            ],
            "type": "string"
          },
          "used": {
            "description": "This month's lookups on NeroCart's key; 0 unless source is platform.",
            "type": "integer"
          },
          "validation_uncovered": {
            "description": "The store's countries (the plugin's) whose addresses the Address Validation API does not cover, such as TR; there only the suggestions work.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "source",
          "platform_available",
          "month",
          "used",
          "limit",
          "server_ip",
          "validation_uncovered"
        ],
        "type": "object"
      },
      "AddressPlace": {
        "properties": {
          "address": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AssistAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "formatted": {
            "description": "Google's one-line form of the address.",
            "type": "string"
          }
        },
        "required": [
          "address",
          "formatted"
        ],
        "type": "object"
      },
      "AddressSuggestion": {
        "properties": {
          "place_id": {
            "type": "string"
          },
          "text": {
            "description": "The address as Google words it.",
            "type": "string"
          }
        },
        "required": [
          "place_id",
          "text"
        ],
        "type": "object"
      },
      "AddressSuggestions": {
        "properties": {
          "suggestions": {
            "description": "At most five.",
            "items": {
              "$ref": "#/components/schemas/AddressSuggestion"
            },
            "type": "array"
          }
        },
        "required": [
          "suggestions"
        ],
        "type": "object"
      },
      "AddressValidateInput": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/AssistAddressInput"
          },
          "cart": {
            "description": "The visitor's cart token.",
            "type": "string"
          },
          "session": {
            "description": "The autocomplete session token of this address entry, if any.",
            "type": "string"
          }
        },
        "required": [
          "cart",
          "address"
        ],
        "type": "object"
      },
      "AddressValidation": {
        "properties": {
          "complete": {
            "description": "Google found every part an address there needs.",
            "type": "boolean"
          },
          "formatted": {
            "description": "The suggestion in one line; empty without one.",
            "type": "string"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suggestion": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AssistAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "suspicious": {
            "description": "Component types Google thinks are wrong (route, street_number, postal_code, ...).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "unconfirmed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "verdict": {
            "enum": [
              "CONFIRMED",
              "UNCONFIRMED",
              "SUSPICIOUS",
              "UNKNOWN"
            ],
            "type": "string"
          }
        },
        "required": [
          "verdict",
          "complete",
          "suspicious",
          "unconfirmed",
          "missing",
          "suggestion",
          "formatted"
        ],
        "type": "object"
      },
      "AdminGlobal": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ContentPage"
          },
          {
            "properties": {
              "pages": {
                "description": "How many pages and popups place it (a working copy or the live version).",
                "type": "integer"
              }
            },
            "required": [
              "pages"
            ],
            "type": "object"
          }
        ]
      },
      "AdminPopup": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ContentPage"
          },
          {
            "properties": {
              "rules": {
                "$ref": "#/components/schemas/PopupRules"
              },
              "stats": {
                "$ref": "#/components/schemas/PopupStats"
              }
            },
            "required": [
              "stats"
            ],
            "type": "object"
          }
        ]
      },
      "AdminReview": {
        "properties": {
          "author": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "helpful_count": {
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "moderated_at": {
            "format": "date-time",
            "type": "string"
          },
          "moderated_by": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          },
          "photos": {
            "description": "Every photo, with its state.",
            "items": {
              "$ref": "#/components/schemas/AdminReviewPhoto"
            },
            "type": "array"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_slug": {
            "type": "string"
          },
          "product_title": {
            "type": "string"
          },
          "rating": {
            "type": "integer"
          },
          "reply": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminReviewReply"
              }
            ],
            "description": "Absent when the store has not replied."
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "rating",
          "title",
          "body",
          "author",
          "verified",
          "locale",
          "created_at",
          "product_id",
          "product_title",
          "product_slug",
          "email",
          "status",
          "updated_at",
          "helpful_count",
          "photos"
        ],
        "type": "object"
      },
      "AdminReviewPhoto": {
        "properties": {
          "height": {
            "type": "integer"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "pending until the review is approved (approving it approves its waiting photos); rejected is hidden by the store.",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "thumbnail_url": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "media_id",
          "url",
          "thumbnail_url",
          "status"
        ],
        "type": "object"
      },
      "AdminReviewReply": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "description": "The staff member who wrote it (panel only).",
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "at"
        ],
        "type": "object"
      },
      "Affiliate": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "approved": {
            "$ref": "#/components/schemas/Money"
          },
          "clicks": {
            "format": "int64",
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "commission_bp": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "paid": {
            "$ref": "#/components/schemas/Money"
          },
          "pending": {
            "$ref": "#/components/schemas/Money"
          },
          "revenue": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "code",
          "discount_code",
          "commission_bp",
          "active",
          "note",
          "clicks",
          "orders",
          "revenue",
          "pending",
          "approved",
          "paid",
          "created_at"
        ],
        "type": "object"
      },
      "AffiliateConversion": {
        "properties": {
          "base": {
            "$ref": "#/components/schemas/Money"
          },
          "commission": {
            "$ref": "#/components/schemas/Money"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "paid",
              "cancelled"
            ],
            "type": "string"
          },
          "via": {
            "enum": [
              "link",
              "code"
            ],
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "order_number",
          "via",
          "base",
          "commission",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "AffiliateInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "code": {
            "description": "3 to 32 letters, digits or dashes; stored upper case.",
            "type": "string"
          },
          "commission_bp": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "code",
          "commission_bp",
          "active"
        ],
        "type": "object"
      },
      "Announcement": {
        "properties": {
          "body": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "published": {
            "type": "boolean"
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "id",
          "severity",
          "title",
          "body",
          "published",
          "starts_at"
        ],
        "type": "object"
      },
      "AppliedDiscount": {
        "description": "What a basket was given by one promotion: the snapshot an order keeps forever, one per promotion (several can stack since M4).",
        "properties": {
          "amount_minor": {
            "description": "What came off the lines.",
            "format": "int64",
            "type": "integer"
          },
          "code": {
            "description": "Empty for an automatic promotion.",
            "type": "string"
          },
          "discount_id": {
            "description": "0 once the rule that produced it has been deleted.",
            "format": "int64",
            "type": "integer"
          },
          "free_shipping": {
            "description": "A free-shipping promotion, so a reader can say so before shipping is priced.",
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "shipping_minor": {
            "description": "What came off the shipping. A cart preview has no shipping price yet, so it is absent there.",
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AppliedGiftCard": {
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/Money"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "gift",
              "credit"
            ],
            "type": "string"
          },
          "last4": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "last4",
          "balance"
        ],
        "type": "object"
      },
      "AppsView": {
        "properties": {
          "catalog": {
            "items": {
              "$ref": "#/components/schemas/OAuthApp"
            },
            "type": "array"
          },
          "installed": {
            "items": {
              "$ref": "#/components/schemas/OAuthInstall"
            },
            "type": "array"
          }
        },
        "required": [
          "catalog",
          "installed"
        ],
        "type": "object"
      },
      "ArasTestResult": {
        "properties": {
          "error": {
            "description": "Aras Kargo's reason when the test failed.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "AssistAddress": {
        "properties": {
          "city": {
            "description": "City; for Türkiye the ilçe.",
            "type": "string"
          },
          "country": {
            "description": "ISO 3166-1 alpha-2.",
            "type": "string"
          },
          "line1": {
            "description": "Street line; for Türkiye the mahalle, street and `No:` building number.",
            "type": "string"
          },
          "line2": {
            "description": "Flat, floor, door.",
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "description": "Region; for Türkiye the il.",
            "type": "string"
          }
        },
        "required": [
          "line1",
          "line2",
          "city",
          "state",
          "postal_code",
          "country"
        ],
        "type": "object"
      },
      "AssistAddressInput": {
        "description": "The address as typed; each field at most 200 characters.",
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AssistantAnswer": {
        "properties": {
          "ask_order": {
            "description": "The answer asks for the order number and the e-mail address used at checkout: the chat shows its order form.",
            "type": "boolean"
          },
          "fallback": {
            "description": "Answered without the AI (its budget spent, the provider failing): the plain search results.",
            "type": "boolean"
          },
          "language": {
            "description": "The language the answer is written in: the one the visitor writes in (ISO 639-1), which may differ from the page's.",
            "type": "string"
          },
          "order": {
            "$ref": "#/components/schemas/AssistantOrder"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/AssistantProduct"
            },
            "maxItems": 4,
            "type": "array"
          },
          "reply": {
            "type": "string"
          },
          "suggestions": {
            "items": {
              "maxLength": 60,
              "type": "string"
            },
            "maxItems": 3,
            "type": "array"
          }
        },
        "required": [
          "reply",
          "products",
          "suggestions",
          "fallback"
        ],
        "type": "object"
      },
      "AssistantChatInput": {
        "properties": {
          "cart": {
            "description": "The visitor's open cart: what is in it is not suggested again.",
            "maxLength": 200,
            "type": "string"
          },
          "language": {
            "description": "The language of the conversation so far (the last answer's `language`): kept for a message too short to tell its own, and the language of the order lookup's answer.",
            "type": "string"
          },
          "locale": {
            "description": "The answer's language when the store serves it; else the request's.",
            "type": "string"
          },
          "messages": {
            "description": "The conversation, oldest first, the visitor's question last; only the last 10 are read.",
            "items": {
              "$ref": "#/components/schemas/AssistantMessage"
            },
            "type": "array"
          },
          "order": {
            "$ref": "#/components/schemas/AssistantOrderQuery"
          },
          "product": {
            "description": "The slug of the product page the visitor is on.",
            "maxLength": 300,
            "type": "string"
          },
          "visitor": {
            "description": "A random id the browser keeps for the session (the per-visitor budget).",
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "AssistantMessage": {
        "properties": {
          "content": {
            "maxLength": 1000,
            "type": "string"
          },
          "role": {
            "enum": [
              "user",
              "assistant"
            ],
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "type": "object"
      },
      "AssistantOrder": {
        "description": "An order found by its number and e-mail: nothing personal, no price.",
        "properties": {
          "items": {
            "description": "How many units the order holds.",
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "placed_at": {
            "format": "date-time",
            "type": "string"
          },
          "shipments": {
            "items": {
              "$ref": "#/components/schemas/AssistantShipment"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "awaiting_payment",
              "received",
              "preparing",
              "partially_shipped",
              "shipped",
              "partially_delivered",
              "delivered",
              "cancelled",
              "refunded"
            ],
            "type": "string"
          },
          "status_text": {
            "description": "The status in the answer's language.",
            "type": "string"
          },
          "url": {
            "description": "The full order page under the locale (/tr/order/X?token=...), the link the order's confirmation opens; the storefront writes it in its own words.",
            "type": "string"
          }
        },
        "required": [
          "number",
          "placed_at",
          "status",
          "status_text",
          "items",
          "shipments",
          "url"
        ],
        "type": "object"
      },
      "AssistantOrderQuery": {
        "description": "The chat's order form: never sent to the AI, never logged.",
        "properties": {
          "email": {
            "description": "The e-mail address used at checkout.",
            "maxLength": 254,
            "type": "string"
          },
          "number": {
            "description": "The order number, with or without its prefix, #, dashes or spaces.",
            "maxLength": 40,
            "type": "string"
          }
        },
        "required": [
          "number",
          "email"
        ],
        "type": "object"
      },
      "AssistantProduct": {
        "properties": {
          "compare_at_price": {
            "$ref": "#/components/schemas/Money"
          },
          "image": {
            "type": "string"
          },
          "in_stock": {
            "type": "boolean"
          },
          "price": {
            "description": "null when the store shows no price for it (sold to dealers only).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "description": "How many the card's \"Sepete ekle\" adds: the least the variant is sold in, else 1.",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "description": "The product's page under the locale (/tr/products/x); the storefront writes it in its own words.",
            "type": "string"
          },
          "variant_id": {
            "description": "Set when the product has one purchasable variant: the card may add it to the cart.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "slug",
          "title",
          "price",
          "image",
          "url",
          "in_stock"
        ],
        "type": "object"
      },
      "AssistantShipment": {
        "properties": {
          "carrier_name": {
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "shipped_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "shipped",
              "delivered"
            ],
            "type": "string"
          },
          "tracking": {
            "description": "The tracking number.",
            "type": "string"
          },
          "tracking_state": {
            "description": "The carrier's latest word: in_transit, out_for_delivery, delivered, failed_delivery, returned_to_sender, exception.",
            "type": "string"
          },
          "tracking_url": {
            "description": "The carrier's page for the parcel, when known.",
            "type": "string"
          }
        },
        "required": [
          "status",
          "shipped_at"
        ],
        "type": "object"
      },
      "AssistantTryInput": {
        "properties": {
          "locale": {
            "type": "string"
          },
          "message": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "AttributeFacet": {
        "properties": {
          "handle": {
            "type": "string"
          },
          "values": {
            "description": "By count, then text; a value is the attribute's own text (attr=handle:value).",
            "items": {
              "$ref": "#/components/schemas/FacetValue"
            },
            "type": "array"
          }
        },
        "required": [
          "handle",
          "values"
        ],
        "type": "object"
      },
      "AuditActor": {
        "description": "Somebody who appears in the trail. Built from the trail and never from the team table, so it does not hand the roster to a reader who holds store.operate but not team.read.",
        "properties": {
          "acts": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "operator",
              "token",
              "system"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "last_at": {
            "format": "date-time",
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuditEntry": {
        "description": "One recorded operator action.",
        "properties": {
          "action": {
            "description": "What was done, as \u003crecord\u003e.\u003cverb\u003e. These are not event names: order.edit_lines and order.update both publish order.edited, and order.refund publishes nothing at all.",
            "example": "order.refund",
            "type": "string"
          },
          "actor_email": {
            "description": "The email as it was at the time, snapshotted rather than joined.",
            "type": "string"
          },
          "actor_id": {
            "description": "Null for a token and for the system. It may point at a superuser who has since been deleted: who did it is a fact about the past and outlives the account.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "actor_kind": {
            "description": "A person, a script holding a static admin token, or the engine itself. The three are different facts: a trail that cannot tell a deploy script from the unpaid sweeper answers a different question from the one it was asked.",
            "enum": [
              "operator",
              "token",
              "system"
            ],
            "type": "string"
          },
          "actor_label": {
            "description": "A name for a caller that is not a person, such as the unpaid sweeper. Never the token.",
            "type": "string"
          },
          "actor_role": {
            "description": "The role as it was at the time. Somebody who is a manager today may have been staff when they did this.",
            "type": "string"
          },
          "changes": {
            "description": "A key present in after and absent from before means the previous value was not recorded, never that it was empty. Money is always an integer *_minor key plus a currency, never a formatted string.",
            "properties": {
              "after": {
                "additionalProperties": true,
                "type": "object"
              },
              "before": {
                "additionalProperties": true,
                "type": "object"
              },
              "event": {
                "description": "The outbox event the same transaction published, where there was one. It is what lets a timeline drawn from both tables render each fact once.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "created_at": {
            "description": "The transaction's start time. An audit row and the outbox event written by the same transaction therefore carry an identical instant, because now() is transaction_timestamp().",
            "format": "date-time",
            "type": "string"
          },
          "entity_id": {
            "description": "Text, because not everything an operator changes is numbered: a role is \"manager\".",
            "type": "string"
          },
          "entity_label": {
            "description": "What the record was called at the time, kept so the log stays readable after it is renamed and after it is deleted.",
            "type": "string"
          },
          "entity_type": {
            "enum": [
              "order",
              "product",
              "stock",
              "category",
              "collection",
              "discount",
              "campaign",
              "tax_rate",
              "location",
              "superuser",
              "invitation",
              "role",
              "taxonomy_attribute",
              "plugin",
              "notification_template",
              "media",
              "vendor",
              "api_key",
              "customer",
              "carrier_profile",
              "consent",
              "suppression",
              "messaging_profile",
              "invoice",
              "legal_document",
              "market",
              "store",
              "domain",
              "content_page",
              "content_version",
              "content_settings",
              "theme",
              "content_redirect",
              "store_menu",
              "tenant",
              "return_reason",
              "payment_method",
              "translation_glossary",
              "cookie_consent",
              "export_link",
              "job",
              "recurring_job",
              "audit",
              "saved_view",
              "import_job",
              "owner_request",
              "company_profile",
              "kyc_document",
              "chargeback",
              "cart_recovery",
              "customer_group",
              "stock_alerts",
              "product_label",
              "invoice_item",
              "listing_source",
              "tenant_capability",
              "licence_key",
              "dealer_application",
              "site_verification",
              "seo",
              "cross_border",
              "chat",
              "etgb",
              "selling_template"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "request_id": {
            "description": "X-Request-Id of the request that wrote the row; absent for work no request caused.",
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutoPrepSettings": {
        "description": "The store's automatic preparation (ADR-0142).",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "issue_invoice": {
            "description": "Issue the e-invoice through the store's integration once the parcel is booked.",
            "type": "boolean"
          },
          "provider": {
            "description": "The fulfillment provider that books the parcels: an installed carrier module, never manual.",
            "type": "string"
          },
          "regions": {
            "description": "The orders covered, by the delivery country against the store's. Paid orders only, always.",
            "enum": [
              "domestic",
              "international",
              "both"
            ],
            "type": "string"
          },
          "service": {
            "description": "The provider's service key, passed as the shipment's meta \"service\"; empty for its default.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          },
          "weight_grams": {
            "maximum": 70000,
            "minimum": 1,
            "type": "integer"
          },
          "weight_mode": {
            "description": "products: the products' weights, weight_grams when one has none; fixed: always weight_grams.",
            "enum": [
              "products",
              "fixed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutoPrepTake": {
        "properties": {
          "quantity": {
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AutoPreparation": {
        "description": "What the automatic preparation did with an order.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "description": "The SKUs that fell short, or the carrier's or integrator's refusal.",
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "invoice_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "description": "Why it is the operator's (or, on done, why there is no invoice): switched_off, not_paid, not_shippable, nothing_to_ship, already_shipped, marketplace, outside_regions, on_hold, supplier_goods, preorder, no_variant, hidden_stock_short, no_carrier, carrier_failed, invoice_not_set, invoice_failed, gift_no_invoice.",
            "type": "string"
          },
          "status": {
            "description": "queued: waiting for the job; taken / shipped: in progress; done: booked (and invoiced); waiting: nothing taken, the operator's; failed: the booking failed and the hidden stock went back.",
            "enum": [
              "queued",
              "taken",
              "shipped",
              "done",
              "waiting",
              "failed"
            ],
            "type": "string"
          },
          "taken": {
            "items": {
              "$ref": "#/components/schemas/AutoPrepTake"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutomationAction": {
        "properties": {
          "body": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "type": {
            "enum": [
              "add_tag",
              "assign",
              "email_customer"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "AutomationCondition": {
        "properties": {
          "field": {
            "enum": [
              "total_minor",
              "country",
              "payment_method",
              "first_order",
              "product_tag"
            ],
            "type": "string"
          },
          "op": {
            "enum": [
              "eq",
              "gt",
              "lt"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "op",
          "value"
        ],
        "type": "object"
      },
      "AutomationRule": {
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/AutomationAction"
            },
            "type": "array"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/AutomationCondition"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "runs": {
            "type": "integer"
          },
          "trigger": {
            "enum": [
              "order.created",
              "order.paid",
              "order.cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "enabled",
          "trigger",
          "conditions",
          "actions"
        ],
        "type": "object"
      },
      "BankTransferAccount": {
        "description": "One account a shopper may pay into by bank transfer (W24).",
        "properties": {
          "account_holder": {
            "description": "The recipient's name as the bank knows it (alıcı unvanı).",
            "maxLength": 140,
            "type": "string"
          },
          "bank_name": {
            "maxLength": 100,
            "type": "string"
          },
          "branch": {
            "maxLength": 100,
            "type": "string"
          },
          "currency": {
            "description": "ISO 4217 code; the account is offered only for baskets in this currency.",
            "pattern": "^[A-Za-z]{3}$",
            "type": "string"
          },
          "iban": {
            "description": "A Turkish IBAN: TR, 24 digits, reserve digit 0, valid mod-97 check digits. Served compact and upper case; spaces and dashes are accepted on input.",
            "examples": [
              "TR809999900000000000000001"
            ],
            "type": "string"
          },
          "note": {
            "maxLength": 300,
            "type": "string"
          }
        },
        "required": [
          "bank_name",
          "account_holder",
          "iban",
          "currency"
        ],
        "type": "object"
      },
      "BankTransferSettings": {
        "description": "A store's bank transfer (havale/EFT) set-up (W24).",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/BankTransferAccount"
            },
            "maxItems": 10,
            "type": "array"
          },
          "due_hours": {
            "default": 72,
            "maximum": 720,
            "minimum": 1,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "reference_format": {
            "default": "{order_number}",
            "description": "The payment description the shopper writes on the transfer; {order_number} is replaced by the order's number.",
            "maxLength": 60,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BaseCurrencyChange": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseCurrencyState"
          },
          {
            "properties": {
              "from": {
                "type": "string"
              },
              "rate": {
                "description": "Units of the new currency for one of the old the prices were converted by; null when kept.",
                "type": [
                  "number",
                  "null"
                ]
              },
              "variants": {
                "type": "integer"
              }
            },
            "required": [
              "from",
              "rate",
              "variants"
            ],
            "type": "object"
          }
        ]
      },
      "BaseCurrencyInput": {
        "properties": {
          "currency": {
            "description": "ISO 4217 code.",
            "type": "string"
          },
          "prices": {
            "enum": [
              "convert",
              "keep"
            ],
            "type": "string"
          }
        },
        "required": [
          "currency",
          "prices"
        ],
        "type": "object"
      },
      "BaseCurrencyState": {
        "properties": {
          "changeable": {
            "type": "boolean"
          },
          "currency": {
            "description": "ISO 4217 code.",
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "payments": {
            "type": "integer"
          },
          "rates": {
            "additionalProperties": {
              "type": "number"
            },
            "description": "Units of each extra currency for one unit of the base.",
            "type": "object"
          }
        },
        "required": [
          "currency",
          "changeable",
          "orders",
          "payments",
          "rates"
        ],
        "type": "object"
      },
      "BizimHesapTestResult": {
        "properties": {
          "error": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "warehouses": {
            "type": "integer"
          }
        },
        "required": [
          "ok",
          "warehouses"
        ],
        "type": "object"
      },
      "BlockEntry": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "card",
              "email",
              "ip",
              "bin",
              "country"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "label",
          "created_at"
        ],
        "type": "object"
      },
      "BlockInput": {
        "properties": {
          "from_event": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "card",
              "email",
              "ip",
              "bin",
              "country"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "BlogAuthor": {
        "properties": {
          "articles": {
            "type": "integer"
          },
          "avatar": {
            "type": "string"
          },
          "bio": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "bio",
          "avatar",
          "articles",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BlogAuthorInput": {
        "properties": {
          "avatar": {
            "type": "string"
          },
          "bio": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "BlogCategory": {
        "properties": {
          "articles": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "position": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "position",
          "articles",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BlogCategoryInput": {
        "properties": {
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language: {\"tr\": …, \"en\": …, \"de\": …}.",
            "type": "object"
          },
          "position": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "BlogComment": {
        "properties": {
          "author_name": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "moderated_at": {
            "format": "date-time",
            "type": "string"
          },
          "moderated_by": {
            "type": "string"
          },
          "page_id": {
            "type": "integer"
          },
          "page_name": {
            "type": "string"
          },
          "page_slug": {
            "type": "string"
          },
          "reply": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "spam"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "page_id",
          "page_slug",
          "page_name",
          "language",
          "author_name",
          "email",
          "body",
          "status",
          "reply",
          "created_at"
        ],
        "type": "object"
      },
      "BlogCommentCounts": {
        "properties": {
          "approved": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "spam": {
            "type": "integer"
          }
        },
        "required": [
          "pending",
          "approved",
          "rejected",
          "spam"
        ],
        "type": "object"
      },
      "BlogCommentInput": {
        "properties": {
          "body": {
            "maxLength": 3000,
            "minLength": 2,
            "type": "string"
          },
          "consent": {
            "type": "boolean"
          },
          "consent_text": {
            "maxLength": 1000,
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "language": {
            "enum": [
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 60,
            "type": "string"
          },
          "started_at": {
            "description": "When the form was shown, Unix milliseconds.",
            "type": "integer"
          },
          "website": {
            "description": "The honeypot: left empty by people.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "body",
          "consent",
          "consent_text",
          "started_at"
        ],
        "type": "object"
      },
      "BlogCommentPatch": {
        "properties": {
          "reply": {
            "maxLength": 3000,
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "spam"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "BlogCommentReceipt": {
        "properties": {
          "status": {
            "enum": [
              "pending",
              "approved"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "BlogRef": {
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "type": "object"
      },
      "BlogSettings": {
        "properties": {
          "comments": {
            "enum": [
              "off",
              "moderated",
              "auto"
            ],
            "type": "string"
          },
          "page_size": {
            "maximum": 48,
            "minimum": 3,
            "type": "integer"
          }
        },
        "required": [
          "comments",
          "page_size"
        ],
        "type": "object"
      },
      "Brand": {
        "properties": {
          "description": {
            "description": "The words as plain text (the document's reading when description_doc is set).",
            "type": "string"
          },
          "description_doc": {
            "description": "The words as rich text (a TipTap document, the product description profile).",
            "type": [
              "object",
              "null"
            ]
          },
          "language": {
            "description": "Storefront reads: the language of the words, empty when the brand has none in the request's language.",
            "type": "string"
          },
          "logo_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "product_image_url": {
            "description": "The first picture of the brand's first listed product; shown where the brand has no logo. Empty when none.",
            "type": "string"
          },
          "products": {
            "type": "integer"
          },
          "seo_description": {
            "description": "The page's search description; empty, the summary.",
            "type": "string"
          },
          "seo_title": {
            "description": "The page's search title; empty, the name.",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "summary": {
            "description": "The description's first words, at most 160 characters.",
            "type": "string"
          },
          "translations": {
            "additionalProperties": {
              "$ref": "#/components/schemas/BrandText"
            },
            "description": "Admin reads: the words per language.",
            "type": "object"
          }
        },
        "required": [
          "name",
          "slug",
          "logo_url",
          "description",
          "products"
        ],
        "type": "object"
      },
      "BrandInput": {
        "properties": {
          "description": {
            "description": "Plain words, at most 20 000 characters.",
            "type": "string"
          },
          "description_doc": {
            "description": "Rich words; when given, description becomes its plain reading.",
            "type": [
              "object",
              "null"
            ]
          },
          "logo_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "seo_description": {
            "maxLength": 400,
            "type": "string"
          },
          "seo_title": {
            "maxLength": 200,
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "BrandText": {
        "properties": {
          "description": {
            "type": "string"
          },
          "description_doc": {
            "type": [
              "object",
              "null"
            ]
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "source": {
            "description": "The translation service's (machine, ai) or manual.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BuilderElement": {
        "description": "One placed element of the header or footer builder (ADR-0071).",
        "properties": {
          "hidden": {
            "description": "Kept in place but not shown.",
            "type": "boolean"
          },
          "id": {
            "description": "A short name, unique in the builder.",
            "type": "string"
          },
          "settings": {
            "additionalProperties": true,
            "description": "The element's settings by its catalogue fields; a text may be per language, a rich text is per language.",
            "type": "object"
          },
          "type": {
            "description": "An element type of the builder's catalogue (ThemeEditor.builder.elements).",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type"
        ],
        "type": "object"
      },
      "BuilderElementDef": {
        "properties": {
          "fields": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "The element's settings, as section fields (type, values, max, required, default, label per language).",
            "type": "object"
          },
          "max": {
            "description": "How many one header canvas or footer may hold; 0 no limit.",
            "type": "integer"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "places": {
            "description": "desktop, mobile, drawer (header); column, bar (footer).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "BuilderIconLook": {
        "description": "The look of the builders' tool icons (ADR-0071 amendment 2026-10-09). Every value is optional; an element's look overrides the builder's value by value; nothing set renders as before.",
        "properties": {
          "background": {
            "description": "A theme colour (text, accent, button, button_text, background, surface, soft, white, black) or #rrggbb; empty inherits.",
            "type": "string"
          },
          "badge": {
            "description": "A theme colour (text, accent, button, button_text, background, surface, soft, white, black) or #rrggbb; empty inherits.",
            "type": "string"
          },
          "color": {
            "description": "A theme colour (text, accent, button, button_text, background, surface, soft, white, black) or #rrggbb; empty inherits.",
            "type": "string"
          },
          "hover": {
            "enum": [
              "",
              "none",
              "tint",
              "lift",
              "invert",
              "grow"
            ],
            "type": "string"
          },
          "label": {
            "enum": [
              "",
              "hidden",
              "beside",
              "below"
            ],
            "type": "string"
          },
          "set": {
            "enum": [
              "",
              "line",
              "bold",
              "solid",
              "duotone",
              "light"
            ],
            "type": "string"
          },
          "shape": {
            "enum": [
              "",
              "none",
              "circle",
              "rounded",
              "outline_circle",
              "outline_rounded"
            ],
            "type": "string"
          },
          "size": {
            "description": "s 32 px, m 40, l 48, xl 56.",
            "enum": [
              "",
              "s",
              "m",
              "l",
              "xl"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "BuilderKit": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "global_styles": {
            "$ref": "#/components/schemas/ThemeGlobalStyles"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "needs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "page": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "picture": {
            "type": "string"
          },
          "templates": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "templates",
          "page",
          "available"
        ],
        "type": "object"
      },
      "BuilderTemplate": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "category": {
            "enum": [
              "hero",
              "features",
              "testimonials",
              "pricing",
              "faq",
              "cta",
              "products",
              "about",
              "contact",
              "other"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "layout",
              "page"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "needs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "origin": {
            "description": "starter, own, import or kit:\u003cid\u003e.",
            "type": "string"
          },
          "picture": {
            "type": "string"
          },
          "ref": {
            "description": "starter:\u003cid\u003e or own:\u003cid\u003e.",
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          },
          "starter": {
            "type": "boolean"
          }
        },
        "required": [
          "ref",
          "name",
          "category",
          "kind",
          "starter",
          "origin",
          "sections",
          "available"
        ],
        "type": "object"
      },
      "BuilderTemplateInput": {
        "properties": {
          "category": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "layout",
              "page"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "kind",
          "sections"
        ],
        "type": "object"
      },
      "ButtonSetOptions": {
        "description": "Every value's choices.",
        "properties": {
          "borders": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "fills": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "focus": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "hovers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "links": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secondaries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shadows": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shapes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sizes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "transforms": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "weights": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ButtonSetPreset": {
        "properties": {
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "look": {
            "$ref": "#/components/schemas/ThemeButtons"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "look"
        ],
        "type": "object"
      },
      "BuyerTax": {
        "description": "A business buyer's tax identity, snapshotted on the order. A VKN needs tax_office and company_name.",
        "properties": {
          "company_name": {
            "description": "The unvan the invoice is made out to.",
            "type": "string"
          },
          "kind": {
            "description": "Derived from tax_id; ignored on input.",
            "enum": [
              "vkn",
              "tckn"
            ],
            "type": "string"
          },
          "tax_id": {
            "description": "A 10-digit VKN or an 11-digit TCKN, check digits verified.",
            "type": "string"
          },
          "tax_office": {
            "description": "Vergi dairesi.",
            "type": "string"
          }
        },
        "required": [
          "tax_id"
        ],
        "type": "object"
      },
      "CODRemittanceInput": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "reference": {
            "description": "The carrier's id for the remittance; a replay is a no-op.",
            "type": "string"
          },
          "remitted_at": {
            "format": "date-time",
            "type": "string"
          },
          "tracking": {
            "type": "string"
          }
        },
        "required": [
          "reference",
          "amount_minor",
          "currency"
        ],
        "type": "object"
      },
      "CODRemittanceResult": {
        "properties": {
          "detail": {
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "paid",
              "already_paid",
              "duplicate",
              "mismatch",
              "error"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CODSettings": {
        "description": "A store's cash on delivery switch.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "Campaign": {
        "description": "A schedule and a budget over several promotions (Medusa's campaign). A promotion joins one through `campaign_id`.",
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/CampaignBudget"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CampaignBudget": {
        "properties": {
          "attribute": {
            "enum": [
              "customer_email"
            ],
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "limit": {
            "description": "Absent is no limit.",
            "format": "int64",
            "type": "integer"
          },
          "type": {
            "description": "`spend` counts the discount given in minor units of `currency`; `usage` counts orders; `use_by_attribute` counts orders per `attribute` value.",
            "enum": [
              "spend",
              "usage",
              "use_by_attribute"
            ],
            "type": "string"
          },
          "used": {
            "description": "Read-only: registered at checkout under the campaign's lock, given back when an order is cancelled.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CampaignBudgetInput": {
        "description": "A budget. `used` cannot be written. On a patch the budget sent replaces the whole budget; an empty budget (`type: \"\"` and nothing else) removes it, a budget with a limit but no type changes the limit of the budget the campaign has (its type and `used` stay; refused when it has none), and a budget of another type starts from zero. On create, a limit without a type is refused.",
        "properties": {
          "attribute": {
            "description": "Required for use_by_attribute.",
            "enum": [
              "customer_email"
            ],
            "type": "string"
          },
          "currency": {
            "description": "Required for a spend budget, refused otherwise.",
            "type": "string"
          },
          "limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "enum": [
              "",
              "spend",
              "usage",
              "use_by_attribute"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CampaignInput": {
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/CampaignBudgetInput"
          },
          "description": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "description": "Unique in the store, case-insensitively.",
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CapabilitySummary": {
        "properties": {
          "network_buyer": {
            "enum": [
              "active",
              "suspended"
            ],
            "type": "string"
          },
          "platform_operator": {
            "type": "boolean"
          },
          "supplier": {
            "enum": [
              "none",
              "pending_approval",
              "active",
              "suspended",
              "terminated",
              "rejected"
            ],
            "type": "string"
          },
          "supplier_reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CarbonFactor": {
        "properties": {
          "kg_co2e_per_tonne_km": {
            "type": "number"
          },
          "mode": {
            "enum": [
              "road",
              "van",
              "air"
            ],
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CarbonSettings": {
        "properties": {
          "effective_origin": {
            "readOnly": true,
            "type": "string"
          },
          "enabled": {
            "description": "Show \"≈ 1,2 kg CO₂e\" under each delivery option.",
            "type": "boolean"
          },
          "factors": {
            "items": {
              "$ref": "#/components/schemas/CarbonFactor"
            },
            "readOnly": true,
            "type": "array"
          },
          "lowest_tag": {
            "description": "Tag the lowest option \"En düşük salım\".",
            "type": "boolean"
          },
          "modes": {
            "additionalProperties": {
              "enum": [
                "road",
                "van",
                "air"
              ],
              "type": "string"
            },
            "description": "Shipping rate id → transport mode; an option left out is guessed from its name (express / saver / air across a border: air; else road).",
            "type": "object"
          },
          "origin_lat": {
            "type": [
              "number",
              "null"
            ]
          },
          "origin_lon": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "CardBinImport": {
        "properties": {
          "csv": {
            "description": "prefix,bank,family,scheme,type,country",
            "type": "string"
          },
          "replace": {
            "description": "Drop the store's rows first.",
            "type": "boolean"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/CardBinRow"
            },
            "type": "array"
          },
          "source": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CardBinRow": {
        "properties": {
          "bank": {
            "type": "string"
          },
          "commercial": {
            "type": "boolean"
          },
          "country": {
            "type": "string"
          },
          "family": {
            "type": "string"
          },
          "prefix": {
            "pattern": "^[0-9]{6,8}$",
            "type": "string"
          },
          "scheme": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "prefix"
        ],
        "type": "object"
      },
      "CardBinsView": {
        "properties": {
          "builtin": {
            "type": "integer"
          },
          "families": {
            "items": {
              "$ref": "#/components/schemas/CardFamily"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/CardBinRow"
            },
            "type": "array"
          }
        },
        "required": [
          "rows",
          "builtin",
          "families"
        ],
        "type": "object"
      },
      "CardFamily": {
        "properties": {
          "bank": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "partners": {
            "description": "Banks issuing cards in the programme. TODO(verify).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "key",
          "name",
          "bank"
        ],
        "type": "object"
      },
      "CardInfo": {
        "description": "What a BIN says about a card (ADR-0140).",
        "properties": {
          "bank": {
            "description": "A bank key of the routing screen's banks.",
            "type": "string"
          },
          "bank_name": {
            "type": "string"
          },
          "commercial": {
            "type": "boolean"
          },
          "country": {
            "description": "ISO 3166-1 alpha-2.",
            "type": "string"
          },
          "family": {
            "description": "A card programme key.",
            "type": "string"
          },
          "family_name": {
            "type": "string"
          },
          "prefix": {
            "description": "The row that matched (6–8 digits).",
            "type": "string"
          },
          "scheme": {
            "description": "visa, mastercard, troy, amex, …",
            "type": "string"
          },
          "source": {
            "description": "store, builtin or provider",
            "type": "string"
          },
          "type": {
            "description": "credit, debit or prepaid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Carrier": {
        "properties": {
          "code": {
            "description": "The stable identifier, e.g. `delhivery`.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "track_url": {
            "description": "Where the customer follows the parcel, with the number already in it. Absent when the carrier has no URL that takes the number as a parameter — a client should then show the number without a link rather than a link that fails.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CarrierIdentity": {
        "properties": {
          "legal_name": {
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CarrierLookup": {
        "properties": {
          "carrier": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "legal_name": {
            "type": "string"
          },
          "source": {
            "enum": [
              "known",
              "einvoice"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "required": [
          "carrier",
          "found"
        ],
        "type": "object"
      },
      "CarrierProfile": {
        "properties": {
          "carrier": {
            "type": "string"
          },
          "carrier_name": {
            "type": "string"
          },
          "legal_name": {
            "description": "The carrier's unvan, as printed on an invoice.",
            "type": "string"
          },
          "tax_id": {
            "description": "VKN (10 digits, check digit verified) or TCKN (11).",
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CarrierProfileInput": {
        "properties": {
          "legal_name": {
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "required": [
          "legal_name"
        ],
        "type": "object"
      },
      "Cart": {
        "properties": {
          "below_minimum": {
            "description": "The subtotal is under the store's order minimum in this currency; the checkout refuses it (ADR-0074).",
            "type": "boolean"
          },
          "channel": {
            "description": "The storefront channel the basket was opened on; absent on a store with no channels.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_pricing": {
            "description": "Whether the basket is priced for a signed-in customer with a verified email (their group's price lists apply) rather than for a guest. Only PUT /carts/{cartId}/customer with the customer's session sets it (ADR-0074).",
            "type": "boolean"
          },
          "discount_code": {
            "description": "The code the shopper applied.",
            "type": "string"
          },
          "discount_error": {
            "description": "Why the code on the cart would be refused at checkout, when it would. The automatic promotions are still previewed.",
            "type": "string"
          },
          "discount_not_combined": {
            "description": "The code on the cart and another promotion cannot both apply (one of them does not combine), so the basket gets whichever is worth more to the shopper (ADR-0156).",
            "type": "boolean"
          },
          "discount_total": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What comes off the lines, summed."
          },
          "discounts": {
            "description": "What the promotions give this basket now: the code on it and every automatic promotion that applies. A preview — shipping is not priced until checkout, and checkout decides again under its own lock.",
            "items": {
              "$ref": "#/components/schemas/AppliedDiscount"
            },
            "type": "array"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The cart's opaque token, and the only credential involved.",
            "type": "string"
          },
          "item_count": {
            "type": "integer"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/CartLine"
            },
            "type": "array"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "minimum_order": {
            "$ref": "#/components/schemas/Money"
          },
          "promotion_goal": {
            "$ref": "#/components/schemas/PromotionGoal"
          },
          "requires_shipping": {
            "description": "Whether anything in the basket is sent. False for a basket of nothing but software, downloads and services: it checks out with no delivery address (billing_address instead), no shipping rate and no cash on delivery (ADR-0045).",
            "type": "boolean"
          },
          "status": {
            "description": "An expired cart that holds something is now marked `abandoned` rather than deleted, so GET on it answers 200 with this status where it used to 404 - and the next mutation revives it to `open` with a fresh TTL. An expired cart holding nothing is still deleted outright.",
            "enum": [
              "open",
              "converted",
              "abandoned"
            ],
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          },
          "tax_preview": {
            "$ref": "#/components/schemas/CartTaxPreview"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "withdrawal": {
            "$ref": "#/components/schemas/CartWithdrawal"
          }
        },
        "type": "object"
      },
      "CartContactInput": {
        "properties": {
          "email": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "marketing_consents": {
            "items": {
              "$ref": "#/components/schemas/MarketingConsentInput"
            },
            "type": "array"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CartDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CartSummary"
          },
          {
            "properties": {
              "line_items": {
                "items": {
                  "$ref": "#/components/schemas/CartLine"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ]
      },
      "CartLine": {
        "properties": {
          "available": {
            "description": "-1 when the variant does not track inventory.",
            "type": "integer"
          },
          "current_price": {
            "$ref": "#/components/schemas/Money"
          },
          "discount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What the promotions take off this line (preview)."
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CartLineImage"
              }
            ],
            "description": "The picture shown beside the line: the variant's own first picture when it has one, else its product's lead picture; null when the product has none."
          },
          "in_stock": {
            "type": "boolean"
          },
          "personalisation": {
            "description": "What the shopper asked for on this line, with what each value adds to one unit (already in unit_price; ADR-0089). Absent for a plain line.",
            "items": {
              "$ref": "#/components/schemas/LinePersonalisation"
            },
            "type": "array"
          },
          "personalisation_invalid": {
            "description": "The product's fields changed since the line was added and its values no longer fit; checkout refuses the line (personalisation_changed) until it is added again.",
            "type": "boolean"
          },
          "preorder": {
            "$ref": "#/components/schemas/LinePreorder"
          },
          "price_changed": {
            "description": "The live price differs from the snapshot, so checkout will refuse until the shopper confirms.",
            "type": "boolean"
          },
          "price_hidden": {
            "description": "Sold to dealers only and the basket's buyer is not one (any more): no price, nothing in the subtotal, refused at checkout (dealer_only).",
            "type": "boolean"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_slug": {
            "description": "The product's address in the request's language (its translated slug, else its own), for a link to its page.",
            "type": "string"
          },
          "production_days": {
            "description": "How long the product takes to make before it is sent; absent when nothing.",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "quantity_invalid": {
            "description": "The variant's units in the basket are not a quantity its rule allows (the rule changed after the line was added); checkout refuses the line (quantity_rule).",
            "type": "boolean"
          },
          "quantity_rule": {
            "$ref": "#/components/schemas/QuantityRule"
          },
          "requires_shipping": {
            "description": "The variant's flag: false for a thing never sent.",
            "type": "boolean"
          },
          "sku": {
            "type": "string"
          },
          "subscription_days": {
            "description": "The line repeats every so many days once the order is confirmed (the product page's subscribe choice); absent for a one-off.",
            "maximum": 365,
            "minimum": 7,
            "type": "integer"
          },
          "term": {
            "description": "The quantity counts years, not pieces (a domain: the title is then the name itself).",
            "enum": [
              "year"
            ],
            "type": "string"
          },
          "title": {
            "description": "The product's title in the request language where a published translation has one, else the default language's (read live from the catalogue, never a snapshot).",
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money"
          },
          "unit_pricing": {
            "$ref": "#/components/schemas/UnitPricing"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "variant_label": {
            "description": "The variant's option values (or its own title) in the request language where translated, else the default language's.",
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "The exception to the right of withdrawal the line would be sold under; absent for an ordinary line (ADR-0088 §1).",
            "enum": [
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CartLineImage": {
        "description": "A cart line's thumbnail: the media library file's address (the same URL the product API returns), its alt text in the request language, and its size when known.",
        "properties": {
          "alt": {
            "type": "string"
          },
          "height": {
            "description": "The file's height in pixels, when the media library knows it.",
            "type": [
              "integer",
              "null"
            ]
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "description": "The file's width in pixels, when the media library knows it.",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "media_id",
          "url",
          "alt"
        ],
        "type": "object"
      },
      "CartRecoveryChannels": {
        "properties": {
          "commercial": {
            "description": "The store's legal name and MERSİS number are filled in (needed for any commercial message).",
            "type": "boolean"
          },
          "email": {
            "type": "boolean"
          },
          "sms": {
            "type": "boolean"
          },
          "whatsapp": {
            "type": "boolean"
          }
        },
        "required": [
          "email",
          "sms",
          "whatsapp",
          "commercial"
        ],
        "type": "object"
      },
      "CartRecoveryItem": {
        "properties": {
          "clicked_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "ended_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "item_count": {
            "type": "integer"
          },
          "messages_sent": {
            "type": "integer"
          },
          "next_at": {
            "format": "date-time",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_total": {
            "$ref": "#/components/schemas/Money"
          },
          "phone": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "recovered",
              "stopped",
              "expired"
            ],
            "type": "string"
          },
          "stop_reason": {
            "description": "ordered, shopper, unsubscribed, iys_refused, completed, abandoned, cart_gone, empty.",
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "status",
          "subtotal",
          "item_count",
          "messages_sent",
          "created_at"
        ],
        "type": "object"
      },
      "CartRecoveryOverview": {
        "properties": {
          "report": {
            "$ref": "#/components/schemas/CartRecoveryReport"
          },
          "settings": {
            "$ref": "#/components/schemas/CartRecoverySettings"
          }
        },
        "required": [
          "settings",
          "report"
        ],
        "type": "object"
      },
      "CartRecoveryPreview": {
        "properties": {
          "body": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "channel",
          "body"
        ],
        "type": "object"
      },
      "CartRecoveryPreviewInput": {
        "properties": {
          "language": {
            "type": "string"
          },
          "step": {
            "$ref": "#/components/schemas/CartRecoveryStep"
          },
          "to": {
            "description": "The test's address or phone (test only).",
            "type": "string"
          }
        },
        "required": [
          "step"
        ],
        "type": "object"
      },
      "CartRecoveryReport": {
        "properties": {
          "clicked": {
            "type": "integer"
          },
          "days": {
            "type": "integer"
          },
          "messages": {
            "type": "integer"
          },
          "reached": {
            "type": "integer"
          },
          "recovered": {
            "type": "integer"
          },
          "revenue": {
            "items": {
              "$ref": "#/components/schemas/Money"
            },
            "type": "array"
          },
          "started": {
            "type": "integer"
          }
        },
        "required": [
          "days",
          "started",
          "reached",
          "clicked",
          "recovered",
          "messages",
          "revenue"
        ],
        "type": "object"
      },
      "CartRecoveryRestore": {
        "properties": {
          "cart_id": {
            "description": "The cart's token (a credential).",
            "type": "string"
          },
          "discount_code": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "market": {
            "type": "string"
          }
        },
        "required": [
          "cart_id"
        ],
        "type": "object"
      },
      "CartRecoverySettings": {
        "properties": {
          "channels": {
            "$ref": "#/components/schemas/CartRecoveryChannels"
          },
          "discount_days": {
            "maximum": 60,
            "minimum": 1,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/CartRecoveryStep"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "steps",
          "discount_days"
        ],
        "type": "object"
      },
      "CartRecoveryStep": {
        "properties": {
          "channel": {
            "enum": [
              "email",
              "sms",
              "whatsapp"
            ],
            "type": "string"
          },
          "delay_minutes": {
            "description": "After the shopper's last change to the basket.",
            "maximum": 20160,
            "minimum": 30,
            "type": "integer"
          },
          "discount_percent": {
            "description": "0: no code. Above 0: one single-use code for the basket.",
            "maximum": 50,
            "minimum": 0,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "channel",
          "delay_minutes",
          "discount_percent",
          "enabled"
        ],
        "type": "object"
      },
      "CartSummary": {
        "properties": {
          "abandoned_at": {
            "description": "When the sweeper marked it. Also the retention clock.",
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The cart's row id. The cart token is deliberately absent: it is the shopper's credential, and possessing it authorises every mutation on the basket.",
            "format": "int64",
            "type": "integer"
          },
          "item_count": {
            "type": "integer"
          },
          "line_count": {
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "state": {
            "description": "What the cart is, derived from status AND expires_at. An `open` cart past its TTL reports `abandoned` before the sweeper reaches it.",
            "enum": [
              "live",
              "abandoned",
              "converted"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "converted",
              "abandoned"
            ],
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          },
          "updated_at": {
            "description": "When the shopper last changed the cart. The abandonment sweep deliberately does not touch it.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CartTaxLine": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "name": {
            "example": "KDV",
            "type": "string"
          },
          "rate_bp": {
            "description": "The rate in basis points: 2000 is 20 %.",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "rate_bp",
          "amount"
        ],
        "type": "object"
      },
      "CartTaxPreview": {
        "description": "The tax a basket's lines carry for one destination, before checkout: the rates and arithmetic checkout charges with, on each line's current price less the previewed promotions. Checkout decides again with the promotions it claims and the shipping chosen.",
        "properties": {
          "country": {
            "type": "string"
          },
          "inclusive": {
            "description": "The prices already hold the tax (reported, not added); otherwise checkout adds it to the total.",
            "type": "boolean"
          },
          "lines": {
            "description": "The tax by name and rate, in the order the basket first meets them.",
            "items": {
              "$ref": "#/components/schemas/CartTaxLine"
            },
            "type": "array"
          },
          "shipping_rate_bp": {
            "description": "The rate shipping would be taxed at under the store's rule, in basis points; 0 when shipping is not taxed.",
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "country",
          "inclusive",
          "total",
          "lines",
          "shipping_rate_bp"
        ],
        "type": "object"
      },
      "CartWithdrawal": {
        "description": "Which basket lines are sold without the right of withdrawal and the acknowledgement checkout needs (ADR-0088 §1).",
        "properties": {
          "acknowledgement": {
            "description": "The sentence to show beside the checkbox, in the read's language — the one kept with the order.",
            "type": "string"
          },
          "acknowledgement_required": {
            "description": "Checkout refuses the basket unless withdrawal_acknowledged is true.",
            "type": "boolean"
          },
          "exceptions": {
            "description": "The exceptions the acknowledgement covers.",
            "items": {
              "enum": [
                "instant_digital",
                "instant_service"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/CartWithdrawalLine"
            },
            "type": "array"
          }
        },
        "required": [
          "lines",
          "acknowledgement_required",
          "exceptions"
        ],
        "type": "object"
      },
      "CartWithdrawalLine": {
        "properties": {
          "exception": {
            "enum": [
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service"
            ],
            "type": "string"
          },
          "line_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "description": "The exception explained, with the regulation's reference, in the read's language.",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "line_id",
          "variant_id",
          "title",
          "exception",
          "reason"
        ],
        "type": "object"
      },
      "CatalogImage": {
        "description": "A collection's or a category's picture from the media library: its current file.",
        "properties": {
          "alt": {
            "description": "In the request's language when the file has one, else the store's default.",
            "type": "string"
          },
          "focal_point": {
            "$ref": "#/components/schemas/FocalPoint"
          },
          "height": {
            "type": "integer"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Category": {
        "description": "A node in the product taxonomy. Not a collection: a collection is a curated list a product can be on six of, while a category answers \"what kind of thing is this\", which has exactly one answer — which is what a feed, a tax rule and a shipping profile all need to key off.",
        "properties": {
          "attributes": {
            "description": "The fields this category asks of a product: its own declarations out of metadata, with the choices the shared dictionary holds for each handle. Populated by the ancestors route only.",
            "items": {
              "$ref": "#/components/schemas/CategoryAttribute"
            },
            "type": "array"
          },
          "child_count": {
            "description": "How many categories sit directly under this one. Every listing computes it, so 0 means a leaf rather than a listing that did not count — which is what lets a picker draw an expander on a branch and nothing on a leaf.",
            "type": "integer"
          },
          "children": {
            "description": "Populated by the nested listing only. A flat listing omits it, so the same rows never appear twice in one response.",
            "items": {
              "$ref": "#/components/schemas/Category"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "depth": {
            "description": "0 for a root. Present so a flat listing can be indented without the client rebuilding the tree.",
            "type": "integer"
          },
          "description": {
            "description": "The category page's introduction.",
            "type": "string"
          },
          "full_name": {
            "description": "The ancestry joined for display. Computed on read, never stored: a stored path would need rewriting across a whole subtree on every rename, and the first missed rewrite is a lie nothing ever finds.",
            "example": "Apparel / Clothing / Shirts",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "$ref": "#/components/schemas/CatalogImage"
          },
          "image_media_id": {
            "description": "The picture from the media library (ADR-0065).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "localization": {
            "$ref": "#/components/schemas/Localization",
            "description": "Store reads only: the language the text is in and the slug per published language."
          },
          "metadata": {
            "additionalProperties": true,
            "description": "The `attributes` key is the list of fields this category asks of a product, as `{key, label}`. A choice list written here is ignored on read — the dictionary at /api/admin/taxonomy-attributes is where a field's values live.",
            "type": "object"
          },
          "parent_id": {
            "description": "Null for a root.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "description": "Orders a category against its siblings.",
            "type": "integer"
          },
          "seo_description": {
            "description": "Overrides the description in search results.",
            "type": "string"
          },
          "seo_title": {
            "description": "Overrides the title in search results; empty falls back to it.",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CategoryAttribute": {
        "description": "One field a category asks of a product. `key` and `label` are the category's own, out of its metadata; `choices` comes from the shared dictionary and is empty for a handle nobody has defined, which is a free-text field rather than a broken one.",
        "properties": {
          "choices": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "key": {
            "example": "sleeve-length",
            "type": "string"
          },
          "label": {
            "example": "Sleeve length",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CategoryInput": {
        "properties": {
          "description": {
            "type": "string"
          },
          "image_media_id": {
            "description": "A picture from the media library; null removes it (on a patch).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "description": "The `attributes` key is the list of fields this category asks of a product, as `{key, label}`, inherited by everything beneath it. A `choices` list written here is ignored on read — the dictionary at /api/admin/taxonomy-attributes is where a field's values live, keyed by the same handle.",
            "type": "object"
          },
          "parent_id": {
            "description": "Null files the category at the root. The tree is capped at 8 deep.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "description": "Order among siblings.",
            "type": "integer"
          },
          "seo_description": {
            "description": "Overrides the description in search results.",
            "type": "string"
          },
          "seo_title": {
            "description": "Overrides the title in search results; empty falls back to it.",
            "type": "string"
          },
          "slug": {
            "description": "Derived from the title when absent.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CategoryPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Category"
          }
        ],
        "description": "A category with the active products filed under it or under anything beneath it. Descendants are included because that is what the operator means: someone who picks \"Apparel\" wants the shirts too.",
        "properties": {
          "products": {
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CategoryPatch": {
        "description": "Only the keys present are written. Moving a category re-parents its whole subtree, so the depth cap and the cycle check apply to the move.",
        "properties": {
          "description": {
            "type": "string"
          },
          "image_media_id": {
            "description": "A picture from the media library; null removes it (on a patch).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "description": "The `attributes` key is the list of fields this category asks of a product, as `{key, label, choices}`, inherited by everything beneath it. A `choices` list written here is ignored on read; the dictionary holds a field's values.",
            "type": "object"
          },
          "parent_id": {
            "description": "Null files the category at the root. The tree is capped at 8 deep.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "description": "Order among siblings.",
            "type": "integer"
          },
          "seo_description": {
            "description": "Overrides the description in search results.",
            "type": "string"
          },
          "seo_title": {
            "description": "Overrides the title in search results; empty falls back to it.",
            "type": "string"
          },
          "slug": {
            "description": "Derived from the title when absent.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Channel": {
        "properties": {
          "active": {
            "description": "An inactive channel refuses requests rather than answering with an empty catalogue, which would read as a broken import.",
            "type": "boolean"
          },
          "code": {
            "description": "What a storefront names itself as, in `?channel=` or the `X-Channel` header.",
            "example": "wholesale",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "default": {
            "description": "The channel a request naming none is served from. Exactly one carries it, enforced by a partial unique index — two defaults is a state with no meaning.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "products": {
            "description": "How many products have been narrowed to it. Not how many it sells: a product narrowed to no channel at all sells on every one.",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChannelInput": {
        "properties": {
          "active": {
            "default": true,
            "type": "boolean"
          },
          "code": {
            "example": "wholesale",
            "type": "string"
          },
          "default": {
            "default": false,
            "description": "Setting this moves the default rather than adding a second one.",
            "type": "boolean"
          },
          "name": {
            "example": "Wholesale",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "type": "object"
      },
      "Chargeback": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "days_left": {
            "type": "integer"
          },
          "deadline": {
            "format": "date",
            "type": "string"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/ChargebackDocument"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "opened_on": {
            "format": "date",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "payment_id": {
            "format": "int64",
            "type": "integer"
          },
          "provider": {
            "type": "string"
          },
          "provider_reference": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "responded",
              "won",
              "lost",
              "accepted"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "amount",
          "status",
          "opened_on",
          "deadline",
          "days_left",
          "documents",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ChargebackDocument": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "filename",
          "mime",
          "size_bytes",
          "created_at"
        ],
        "type": "object"
      },
      "ChargebackInput": {
        "properties": {
          "amount_minor": {
            "description": "Omitted: the order's total.",
            "format": "int64",
            "type": "integer"
          },
          "deadline": {
            "format": "date",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "opened_on": {
            "format": "date",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "payment_id": {
            "format": "int64",
            "type": "integer"
          },
          "provider_reference": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          }
        },
        "required": [
          "order_id"
        ],
        "type": "object"
      },
      "ChargebackPatch": {
        "properties": {
          "deadline": {
            "format": "date",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "responded",
              "won",
              "lost",
              "accepted"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChatAttachment": {
        "description": "A file a chat message carries (0214): a JPEG, PNG or WebP picture (metadata stripped), a PDF without active content, or an MP4, MOV or WebM video.",
        "properties": {
          "content_type": {
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "application/pdf",
              "video/mp4",
              "video/quicktime",
              "video/webm"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "image",
              "video",
              "document"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "content_type",
          "size",
          "kind"
        ],
        "type": "object"
      },
      "ChatConversation": {
        "properties": {
          "closed_by": {
            "description": "Who closed it last.",
            "enum": [
              "visitor",
              "staff"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "description": "The store's customer with the chat's e-mail, when there is one (on one chat read).",
            "format": "int64",
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_message": {
            "type": "string"
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array"
          },
          "mode": {
            "description": "bot while the store's assistant answers the chat, human once it is the staff's (0215).",
            "enum": [
              "bot",
              "human"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "order_id": {
            "description": "The order the customer chose as the chat's subject (0216).",
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "description": "That order's number.",
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "staff_seen_at": {
            "description": "When the staff last read the chat.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          },
          "topic": {
            "description": "What an application chat is about (0217); absent for a plain chat.",
            "enum": [
              "supplier",
              "seller",
              "store"
            ],
            "type": "string"
          },
          "unread": {
            "type": "integer"
          },
          "visitor_seen_at": {
            "description": "When the visitor last read the chat.",
            "format": "date-time",
            "type": "string"
          },
          "visitor_unread": {
            "description": "What the store wrote that the visitor has not read.",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "page",
          "status",
          "unread",
          "last_message",
          "last_message_at",
          "created_at"
        ],
        "type": "object"
      },
      "ChatMessage": {
        "properties": {
          "attachment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ChatAttachment"
              }
            ],
            "description": "The file the message carries; body is then its name."
          },
          "body": {
            "type": "string"
          },
          "cards": {
            "description": "The products the store's assistant showed with its answer (sender bot).",
            "items": {
              "$ref": "#/components/schemas/AssistantProduct"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "sender": {
            "enum": [
              "visitor",
              "staff",
              "bot"
            ],
            "type": "string"
          },
          "staff_name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sender",
          "body",
          "created_at"
        ],
        "type": "object"
      },
      "ChatStartInput": {
        "properties": {
          "body": {
            "maxLength": 2000,
            "type": "string"
          },
          "email": {
            "description": "The visitor's e-mail address. Since 2026-10-31 a chat without a valid one is refused (400, field email): the inbox matches it to the store's customer.",
            "type": "string"
          },
          "name": {
            "description": "The visitor's first and last name; at least two characters. Since 2026-10-31 a chat without it is refused (400, field name).",
            "type": "string"
          },
          "order_number": {
            "description": "A signed-in customer's own order as the chat's subject; ignored for a guest.",
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "topic": {
            "description": "An application on the platform's own store, from a signed-in customer's account.",
            "enum": [
              "supplier",
              "seller",
              "store"
            ],
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "ChatStarted": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array"
          },
          "mode": {
            "description": "bot while the store's assistant answers the chat (0215).",
            "enum": [
              "bot",
              "human"
            ],
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "messages"
        ],
        "type": "object"
      },
      "ChatVisitorView": {
        "description": "The visitor's chat: whose it is now and its messages after one.",
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "type": "array"
          },
          "mode": {
            "enum": [
              "bot",
              "human"
            ],
            "type": "string"
          },
          "staff_seen_at": {
            "description": "When the store last read the chat.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "mode",
          "messages"
        ],
        "type": "object"
      },
      "CheckoutInput": {
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "The delivery address. Required when the basket has anything to send; for a basket with nothing to send (cart.requires_shipping false) it may be left out and billing_address given instead, which the order keeps as its address (ADR-0045)."
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "Where the order is invoiced to, when it is not the delivery `address`. Validated like it (line1, city, postal_code and country; a missing field is a 400 naming the billing address). Kept on the order; the e-invoice's buyer is this address when it is given. Omitted: none, and the delivery address is the invoice address."
          },
          "buyer_tax": {
            "$ref": "#/components/schemas/BuyerTax"
          },
          "card_bin": {
            "description": "The card's first 6–8 digits, for the one card choice (card_router) of a store that routes card payments: it picks the POS. Never stored.",
            "pattern": "^[0-9]{6,8}$",
            "type": "string"
          },
          "card_last4": {
            "description": "The card's last four digits, for the store's fraud rules (ADR-0140): with the BIN it is kept only as a hash. Omitted checks the BIN alone.",
            "pattern": "^[0-9]{4}$",
            "type": "string"
          },
          "cart_id": {
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "expected_total": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The total the shopper confirmed. The checkout prices the basket again under its own lock (lines, delivery rate, promotions, tax); when that total differs from this one — amount or currency — nothing is placed, no stock stays reserved and the answer is 409 with `details` a `TotalChanged` carrying the new `total`. Omitted: no such check."
          },
          "installments": {
            "description": "The installment count (taksit) the shopper asked for, for a payment method that takes installments; omitted, 0 or 1 is a single payment. A method that does not take installments refuses a count above 1 with 400 before any order is created. A card's options come from GET /api/checkout/{code}/installments.",
            "maximum": 36,
            "minimum": 0,
            "type": "integer"
          },
          "legal_acceptances": {
            "description": "Required once the store has published a mesafeli satış sözleşmesi or ön bilgilendirme formu: each live document the shopper accepted. Missing → 422; superseded → 409.",
            "items": {
              "$ref": "#/components/schemas/LegalAcceptanceInput"
            },
            "type": "array"
          },
          "marketing_consents": {
            "description": "The commercial-message consent block: unticked by default, never a condition of the sale.",
            "items": {
              "$ref": "#/components/schemas/MarketingConsentInput"
            },
            "type": "array"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "A `notes` key is refused with a 400: it is reserved for the shop's own note on the order, which is set through PATCH /api/admin/orders/{id}.",
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "payment_data": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Passed through to the payment provider, so a gateway can receive what it needs without this body growing a field per integration. Keys a gateway reads are listed with the gateway; `identity_number` (the buyer's Turkish national id, TCKN) is passed to gateways that ask for it and never stored.",
            "type": "object"
          },
          "phone": {
            "type": "string"
          },
          "return_url": {
            "description": "Where a redirect-flow gateway sends the shopper back to.",
            "type": "string"
          },
          "shipping_rate_id": {
            "description": "The delivery option the shopper picked: a `rate_id` from GET /api/checkout/rates for this cart and destination. Omitted takes the first option the store lists (the cheapest with untouched positions). A rate that no longer covers the basket is a 409 with `details.reason` = `shipping_rate_unavailable`.",
            "format": "int64",
            "type": "integer"
          },
          "withdrawal_acknowledged": {
            "description": "The shopper ticked the sentence the cart's withdrawal.acknowledgement carries: the right of withdrawal ends for the lines it names (MSY m.15/1-ğ, h). Required when the cart's withdrawal.acknowledgement_required is true, else the checkout is refused (422, details.reason withdrawal_acknowledgement_required). The sentence is kept with the order (Order.withdrawal_acknowledgement).",
            "type": "boolean"
          }
        },
        "required": [
          "cart_id",
          "email"
        ],
        "type": "object"
      },
      "CheckoutLink": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/CheckoutLinkLine"
            },
            "type": "array"
          },
          "note": {
            "type": "string"
          },
          "opened": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "token",
          "url",
          "title",
          "lines",
          "discount_code",
          "email",
          "note",
          "active",
          "opened",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "CheckoutLinkInput": {
        "properties": {
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/CheckoutLinkLine"
            },
            "type": "array"
          },
          "note": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "lines"
        ],
        "type": "object"
      },
      "CheckoutLinkLine": {
        "properties": {
          "quantity": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "unit_price_minor": {
            "description": "A quoted unit price, at or below today's (BB5). The difference becomes the link's own one-time discount code, which needs a basket at least as large as the quoted one.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "quantity"
        ],
        "type": "object"
      },
      "CohortRow": {
        "properties": {
          "customers": {
            "type": "integer"
          },
          "month": {
            "type": "string"
          },
          "returning": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "value": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "month",
          "customers",
          "returning",
          "value"
        ],
        "type": "object"
      },
      "Collection": {
        "description": "A named, hand-curated grouping of products. Rule-based (\"smart\") collections are deliberately absent: they need a query language, and what a catalog this size uses is a list somebody picked.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "$ref": "#/components/schemas/CatalogImage"
          },
          "image_media_id": {
            "description": "The picture from the media library (ADR-0065).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "localization": {
            "$ref": "#/components/schemas/Localization",
            "description": "Store reads only: the language the text is in and the slug per published language."
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "position": {
            "description": "Orders collections against each other — a navigation menu, not the order of products inside one.",
            "type": "integer"
          },
          "product_count": {
            "description": "How many products the collection holds, drafts included; on the admin list only.",
            "type": "integer"
          },
          "seo_description": {
            "description": "Overrides the description in search results.",
            "type": "string"
          },
          "seo_title": {
            "description": "Overrides the title in search results; empty falls back to it.",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CollectionInput": {
        "properties": {
          "description": {
            "type": "string"
          },
          "image_media_id": {
            "description": "A picture from the media library; null removes it (on a patch).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "position": {
            "description": "Where the collection stands in lists; smaller first. Omitted on create: one after the store's last collection.",
            "type": "integer"
          },
          "seo_description": {
            "description": "Overrides the description in search results.",
            "type": "string"
          },
          "seo_title": {
            "description": "Overrides the title in search results; empty falls back to it.",
            "type": "string"
          },
          "slug": {
            "description": "Derived from the title when omitted, exactly as a product's is.",
            "type": "string"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "CollectionPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Collection"
          }
        ],
        "description": "A collection with the active products in it. One request rather than two, because there is no useful moment at which a storefront has the collection but not its contents.",
        "properties": {
          "products": {
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CollectionRule": {
        "properties": {
          "field": {
            "enum": [
              "tag",
              "vendor",
              "product_type",
              "title",
              "category_id",
              "price"
            ],
            "type": "string"
          },
          "op": {
            "enum": [
              "eq",
              "contains",
              "gt",
              "lt"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "op",
          "value"
        ],
        "type": "object"
      },
      "CollectionRules": {
        "properties": {
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/CollectionRule"
            },
            "type": "array"
          },
          "match": {
            "enum": [
              "all",
              "any"
            ],
            "type": "string"
          }
        },
        "required": [
          "match",
          "conditions"
        ],
        "type": [
          "object",
          "null"
        ]
      },
      "CollectionRulesView": {
        "properties": {
          "members": {
            "type": "integer"
          },
          "rules": {
            "$ref": "#/components/schemas/CollectionRules"
          }
        },
        "required": [
          "members"
        ],
        "type": "object"
      },
      "Company": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "credit_limit": {
            "$ref": "#/components/schemas/Money"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/CompanyMember"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "open_balance": {
            "$ref": "#/components/schemas/Money"
          },
          "payment_terms_days": {
            "description": "Its buyers may pay on account within these days; 0: they pay at checkout.",
            "type": "integer"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "tax_id",
          "tax_office",
          "note",
          "members",
          "created_at",
          "payment_terms_days",
          "credit_limit",
          "open_balance"
        ],
        "type": "object"
      },
      "CompanyAddress": {
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "district": {
            "type": "string"
          },
          "line": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CompanyDetails": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/CompanyAddress"
          },
          "authorised": {
            "items": {
              "$ref": "#/components/schemas/CompanyPerson"
            },
            "type": "array"
          },
          "iban_eur": {
            "type": "string"
          },
          "iban_holder": {
            "description": "The account holder's name as the bank writes it.",
            "type": "string"
          },
          "iban_try": {
            "description": "The Turkish lira account (required).",
            "type": "string"
          },
          "iban_usd": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "mersis_no": {
            "type": "string"
          },
          "other_ibans": {
            "description": "Accounts in further currencies (GBP, CHF …), each with its currency; TRY, EUR and USD keep their own fields. At most 10.",
            "items": {
              "$ref": "#/components/schemas/CompanyIBAN"
            },
            "type": "array"
          },
          "partners": {
            "items": {
              "$ref": "#/components/schemas/CompanyPerson"
            },
            "type": "array"
          },
          "sells_foreign_currency": {
            "description": "\"Döviz satışı yapacak mısın?\" — when true a foreign-currency account is needed.",
            "type": "boolean"
          },
          "tax_office": {
            "type": "string"
          },
          "tckn": {
            "type": "string"
          },
          "trade_registry_no": {
            "type": "string"
          },
          "vkn": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CompanyDocumentSpec": {
        "properties": {
          "expires": {
            "description": "The document has a validity date the owner can enter; a reminder goes out before it passes.",
            "type": "boolean"
          },
          "kind": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "required",
          "expires"
        ],
        "type": "object"
      },
      "CompanyField": {
        "properties": {
          "key": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "text",
              "tckn",
              "vkn",
              "mersis",
              "address",
              "people"
            ],
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "kind",
          "required"
        ],
        "type": "object"
      },
      "CompanyIBAN": {
        "properties": {
          "currency": {
            "description": "ISO 4217 code.",
            "type": "string"
          },
          "iban": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "iban"
        ],
        "type": "object"
      },
      "CompanyInput": {
        "properties": {
          "credit_limit_minor": {
            "description": "In the store's currency; 0: no limit.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/CompanyMember"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "payment_terms_days": {
            "maximum": 180,
            "minimum": 0,
            "type": "integer"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CompanyMember": {
        "properties": {
          "email": {
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "buyer"
            ],
            "type": "string"
          }
        },
        "required": [
          "email",
          "role"
        ],
        "type": "object"
      },
      "CompanyMissing": {
        "properties": {
          "key": {
            "description": "The field or the document kind.",
            "type": "string"
          },
          "reason": {
            "enum": [
              "required",
              "invalid",
              "rejected",
              "expired"
            ],
            "type": "string"
          },
          "step": {
            "enum": [
              "type",
              "details",
              "bank",
              "documents"
            ],
            "type": "string"
          }
        },
        "required": [
          "step",
          "key",
          "reason"
        ],
        "type": "object"
      },
      "CompanyOrder": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "number",
          "email",
          "status",
          "total",
          "created_at"
        ],
        "type": "object"
      },
      "CompanyPerson": {
        "properties": {
          "id_number": {
            "description": "A person's TCKN, or a corporate partner's VKN.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "share": {
            "description": "A partner's share in percent.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "CompanyProfileInput": {
        "properties": {
          "details": {
            "$ref": "#/components/schemas/CompanyDetails"
          },
          "type": {
            "enum": [
              "sahis",
              "limited",
              "anonim",
              "kooperatif",
              "dernek_vakif",
              "other"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "details"
        ],
        "type": "object"
      },
      "CompanyProfileView": {
        "properties": {
          "access": {
            "items": {
              "$ref": "#/components/schemas/DocumentAccess"
            },
            "type": "array"
          },
          "approved_at": {
            "format": "date-time",
            "type": "string"
          },
          "can_submit": {
            "type": "boolean"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "details": {
            "$ref": "#/components/schemas/CompanyDetails"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/KYCDocument"
            },
            "type": "array"
          },
          "exempt": {
            "type": "boolean"
          },
          "missing": {
            "items": {
              "$ref": "#/components/schemas/CompanyMissing"
            },
            "type": "array"
          },
          "progress": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "reject_reason": {
            "type": "string"
          },
          "state": {
            "enum": [
              "none",
              "incomplete",
              "submitted",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "submitted_at": {
            "format": "date-time",
            "type": "string"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/CompanyTemplate"
            },
            "type": "array"
          },
          "type": {
            "description": "Empty until a type is chosen.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/CompanyWarning"
            },
            "type": "array"
          }
        },
        "required": [
          "state",
          "exempt",
          "type",
          "details",
          "missing",
          "warnings",
          "progress",
          "can_submit",
          "documents",
          "templates",
          "access"
        ],
        "type": "object"
      },
      "CompanyTemplate": {
        "properties": {
          "documents": {
            "items": {
              "$ref": "#/components/schemas/CompanyDocumentSpec"
            },
            "type": "array"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/CompanyField"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "sahis",
              "limited",
              "anonim",
              "kooperatif",
              "dernek_vakif",
              "other"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "fields",
          "documents"
        ],
        "type": "object"
      },
      "CompanyWarning": {
        "properties": {
          "code": {
            "enum": [
              "iban_holder_mismatch",
              "tax_number_mismatch",
              "title_mismatch",
              "iban_mismatch",
              "document_expiring",
              "document_expired"
            ],
            "type": "string"
          },
          "document_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "Consent": {
        "properties": {
          "channel": {
            "enum": [
              "sms",
              "email",
              "call"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "format": "int64",
            "type": "integer"
          },
          "granted_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "iys_due_at": {
            "description": "Three business days after the change: when İYS must have it.",
            "format": "date-time",
            "type": "string"
          },
          "iys_error": {
            "type": "string"
          },
          "iys_status": {
            "enum": [
              "pending",
              "synced",
              "failed",
              "not_required"
            ],
            "type": "string"
          },
          "iys_synced_at": {
            "format": "date-time",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "proof": {
            "additionalProperties": true,
            "type": "object"
          },
          "recipient": {
            "type": "string"
          },
          "recipient_type": {
            "enum": [
              "BIREYSEL",
              "TACIR"
            ],
            "type": "string"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "enum": [
              "granted",
              "revoked"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConsentEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConsentInput": {
        "properties": {
          "channel": {
            "enum": [
              "sms",
              "email",
              "call"
            ],
            "type": "string"
          },
          "customer_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "proof": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "recipient": {
            "type": "string"
          },
          "recipient_type": {
            "enum": [
              "BIREYSEL",
              "TACIR"
            ],
            "type": "string"
          },
          "source": {
            "description": "Defaults to admin.",
            "type": "string"
          }
        },
        "required": [
          "channel",
          "recipient"
        ],
        "type": "object"
      },
      "ContactCounts": {
        "properties": {
          "archived": {
            "type": "integer"
          },
          "new": {
            "type": "integer"
          },
          "read": {
            "type": "integer"
          }
        },
        "required": [
          "new",
          "read",
          "archived"
        ],
        "type": "object"
      },
      "ContactMessage": {
        "properties": {
          "company": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "fields": {
            "items": {
              "properties": {
                "label": {
                  "maxLength": 80,
                  "type": "string"
                },
                "value": {
                  "maxLength": 2000,
                  "type": "string"
                }
              },
              "required": [
                "label",
                "value"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "form": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "A quote request is a message of kind quote (ADR-0091 §4).",
            "enum": [
              "contact",
              "quote"
            ],
            "type": "string"
          },
          "lines": {
            "description": "A quote's products and quantities — never a price.",
            "items": {
              "$ref": "#/components/schemas/QuoteLine"
            },
            "type": "array"
          },
          "locale": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "page_path": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "read_at": {
            "format": "date-time",
            "type": "string"
          },
          "replies": {
            "description": "The answers the store sent from the panel, oldest first.",
            "items": {
              "properties": {
                "at": {
                  "format": "date-time",
                  "type": "string"
                },
                "body": {
                  "maxLength": 4000,
                  "type": "string"
                },
                "by": {
                  "description": "Who answered: the operator's address, or \"API\" for a key.",
                  "type": "string"
                }
              },
              "required": [
                "body",
                "by",
                "at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "new",
              "read",
              "archived"
            ],
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "topic",
          "message",
          "locale",
          "page_path",
          "status",
          "created_at",
          "updated_at",
          "kind"
        ],
        "type": "object"
      },
      "ContactReceipt": {
        "properties": {
          "received": {
            "type": "boolean"
          }
        },
        "required": [
          "received"
        ],
        "type": "object"
      },
      "ContactSubmission": {
        "properties": {
          "consent": {
            "description": "The visitor acknowledged the privacy (KVKK) notice.",
            "type": "boolean"
          },
          "consent_text": {
            "description": "The line shown beside the box.",
            "maxLength": 1000,
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "fields": {
            "description": "The answers to the form widget's own questions; with answers the message is optional.",
            "items": {
              "properties": {
                "label": {
                  "maxLength": 80,
                  "type": "string"
                },
                "value": {
                  "maxLength": 2000,
                  "type": "string"
                }
              },
              "required": [
                "label",
                "value"
              ],
              "type": "object"
            },
            "maxItems": 12,
            "type": "array"
          },
          "form": {
            "description": "A page's form widget by name (ADR-0073).",
            "maxLength": 80,
            "type": "string"
          },
          "form_ref": {
            "description": "A free layout's form widget (ADR-0085 §12, VB-5): its page or popup and node. Its automatic reply and permission boxes are read from that page's live version in the form's language.",
            "properties": {
              "node": {
                "maxLength": 40,
                "type": "string"
              },
              "page_id": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "page_id",
              "node"
            ],
            "type": "object"
          },
          "locale": {
            "description": "tr, en or de; absent takes the request's language.",
            "type": "string"
          },
          "marketing": {
            "description": "The channels whose marketing permission box (İYS) the visitor ticked. Email starts the newsletter's double opt-in; sms and call are recorded for the phone given (source site_form). A channel the form does not ask for is ignored.",
            "items": {
              "enum": [
                "email",
                "sms",
                "call"
              ],
              "type": "string"
            },
            "maxItems": 3,
            "type": "array"
          },
          "message": {
            "maxLength": 5000,
            "minLength": 10,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "page_path": {
            "description": "The store path the form was on.",
            "type": "string"
          },
          "phone": {
            "maxLength": 30,
            "type": "string"
          },
          "started_at": {
            "description": "When the form was rendered, Unix milliseconds.",
            "format": "int64",
            "type": "integer"
          },
          "topic": {
            "maxLength": 80,
            "type": "string"
          },
          "website": {
            "description": "Honeypot: must be empty.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "message",
          "consent",
          "consent_text",
          "started_at"
        ],
        "type": "object"
      },
      "ContentArticleFields": {
        "description": "An article's own fields.",
        "properties": {
          "author": {
            "type": "string"
          },
          "cover_alt": {
            "type": "string"
          },
          "cover_image": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentDiff": {
        "properties": {
          "against": {
            "description": "The version compared with; absent when the page was never published in this language.",
            "properties": {
              "status": {
                "type": "string"
              },
              "version": {
                "type": "integer"
              },
              "version_id": {
                "format": "int64",
                "type": "integer"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "fields": {
            "items": {
              "properties": {
                "after": {},
                "before": {},
                "field": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "language": {
            "type": "string"
          },
          "sections": {
            "items": {
              "properties": {
                "after": {
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "props": {
                      "additionalProperties": true,
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "before": {
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "props": {
                      "additionalProperties": true,
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "changed_fields": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "key": {
                  "description": "The section's id, or #\u003cindex\u003e for one without.",
                  "type": "string"
                },
                "nodes": {
                  "description": "A free layout's items that were added, removed, moved or changed (ADR-0085 §2); unchanged ones are left out.",
                  "items": {
                    "properties": {
                      "changed_fields": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "id": {
                        "type": "string"
                      },
                      "parent_after": {
                        "type": "string"
                      },
                      "parent_before": {
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "added",
                          "removed",
                          "changed",
                          "moved"
                        ],
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "status": {
                  "enum": [
                    "added",
                    "removed",
                    "changed",
                    "moved",
                    "unchanged"
                  ],
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "summary": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "version": {
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ContentDocument": {
        "description": "A page document. The section model (ADR-0069): {version: 2, root, sections} — see PageDocument; what the page editor saves. The older Puck form, still accepted and read: root props and a flat list of sections, each {type, props}. Validated against the section schema set on save.",
        "properties": {
          "content": {
            "items": {
              "properties": {
                "props": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "props"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "free_design": {
            "$ref": "#/components/schemas/FreeDesign"
          },
          "root": {
            "properties": {
              "props": {
                "additionalProperties": true,
                "type": "object"
              }
            },
            "type": "object"
          },
          "sections": {
            "description": "The section model's sections.",
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          },
          "version": {
            "description": "2: the section model.",
            "enum": [
              2
            ],
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ContentDraftInput": {
        "description": "seo and article are optional: left out, a draft keeps what it had (a new draft starts from the latest version's). A section's own CSS (section model) may only be changed with theme.publish.",
        "properties": {
          "article": {
            "$ref": "#/components/schemas/ContentArticleFields"
          },
          "description": {
            "type": "string"
          },
          "document": {
            "$ref": "#/components/schemas/ContentDocument"
          },
          "revision": {
            "description": "The working copy's revision the change was made on (0: there was none). A different one is refused with 409 (details.reason stale_revision, details.current_revision). Left out, the save is not checked.",
            "type": "integer"
          },
          "seo": {
            "$ref": "#/components/schemas/ContentSEO"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentPage": {
        "properties": {
          "blog": {
            "$ref": "#/components/schemas/ContentPageBlog"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "home",
              "page",
              "article",
              "popup",
              "global"
            ],
            "type": "string"
          },
          "languages": {
            "items": {
              "$ref": "#/components/schemas/ContentPageLanguage"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "slugs": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "A custom page's address per language (language → slug, migration 0129). A language not in it is served under `slug`, which every language keeps reading; the storefront redirects it to the language's own address.",
            "type": "object"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentPageBlog": {
        "description": "An article's place in the blog (ADR-0073), the same in every language.",
        "properties": {
          "author_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "category_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "comments": {
            "description": "Readers may comment (when the store's comments are on).",
            "type": "boolean"
          },
          "sticky": {
            "description": "Pinned to the top of the blog.",
            "type": "boolean"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "required": [
          "category_id",
          "author_id",
          "tags",
          "sticky",
          "comments"
        ],
        "type": "object"
      },
      "ContentPageBlogPatch": {
        "description": "Changes an article's place in the blog; a category or author id of 0 clears it. Only for an article.",
        "properties": {
          "author_id": {
            "minimum": 0,
            "type": "integer"
          },
          "category_id": {
            "minimum": 0,
            "type": "integer"
          },
          "comments": {
            "type": "boolean"
          },
          "sticky": {
            "type": "boolean"
          },
          "tags": {
            "description": "Lower-cased, letters and digits with single spaces or hyphens; repeats dropped.",
            "items": {
              "maxLength": 40,
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "type": "object"
      },
      "ContentPageInput": {
        "properties": {
          "kind": {
            "enum": [
              "home",
              "page",
              "article",
              "popup",
              "global"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentPageLanguage": {
        "properties": {
          "language": {
            "enum": [
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "published": {
            "$ref": "#/components/schemas/ContentVersion"
          },
          "working": {
            "$ref": "#/components/schemas/ContentVersion"
          }
        },
        "type": "object"
      },
      "ContentPagePatch": {
        "properties": {
          "blog": {
            "$ref": "#/components/schemas/ContentPageBlogPatch"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "slugs": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "A custom page's address in the languages named (language → slug, normalized like `slug`); \"\" or the page's own slug removes that language's, languages left out keep theirs. Every slug of a store — a page's and each language's — names one page: one another page has is refused with 409 (details.reason slug_taken). Only a page (kind page) has addresses per language.",
            "type": "object"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentPreviewToken": {
        "properties": {
          "demo": {
            "description": "A gallery preview of the theme's own demo store (ADR-0072): the storefront opens it with ?demo=\u003ctoken\u003e.",
            "type": "boolean"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "token": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentPublishInput": {
        "properties": {
          "at": {
            "description": "Publish at this time (a job); absent or past means now.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentRedirect": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "enum": [
              301,
              302,
              308
            ],
            "type": "integer"
          },
          "to": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentRedirectInput": {
        "properties": {
          "from": {
            "type": "string"
          },
          "language": {
            "description": "'' (default) for every language.",
            "enum": [
              "",
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "description": "Defaults to 301.",
            "enum": [
              301,
              302,
              308
            ],
            "type": "integer"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "ContentReviewInput": {
        "properties": {
          "comment": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentSEO": {
        "description": "Search and sharing metadata beyond title and description (constitution §14).",
        "properties": {
          "noindex": {
            "description": "Keep the page out of search engines and the sitemap.",
            "type": "boolean"
          },
          "og_image": {
            "description": "https URL or a store path.",
            "type": "string"
          },
          "title": {
            "description": "Replaces the page title in \u003ctitle\u003e when set.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentSettings": {
        "properties": {
          "self_approval": {
            "description": "Whether the submitter may approve their own version.",
            "type": "boolean"
          },
          "storefront_url": {
            "description": "The storefront origin Tema Stüdyosu previews in its iframe.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContentVersion": {
        "properties": {
          "article": {
            "$ref": "#/components/schemas/ContentArticleFields"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "document": {
            "$ref": "#/components/schemas/ContentDocument"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "enum": [
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "page_name": {
            "type": "string"
          },
          "page_slug": {
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by_label": {
            "type": "string"
          },
          "restored_from": {
            "type": "integer"
          },
          "review_comment": {
            "type": "string"
          },
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "reviewed_by_label": {
            "type": "string"
          },
          "revision": {
            "description": "Moves with every change of the version's content (ADR-0069); a save names the one it was made on.",
            "type": "integer"
          },
          "scheduled_at": {
            "format": "date-time",
            "type": "string"
          },
          "seo": {
            "$ref": "#/components/schemas/ContentSEO"
          },
          "size": {
            "$ref": "#/components/schemas/PageSize"
          },
          "status": {
            "enum": [
              "draft",
              "in_review",
              "approved",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "submitted_at": {
            "format": "date-time",
            "type": "string"
          },
          "submitted_by_label": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ContractDelivery": {
        "properties": {
          "buyer": {
            "description": "True for the shopper's copy, false for the store's.",
            "type": "boolean"
          },
          "sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "queued, sent, failed or cancelled.",
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContractIdentity": {
        "description": "Whose details the contracts name as the seller: the company details (use company, the default) or details written for the contracts alone (use custom; an empty one falls back as the company's would). Invoices, the ETGB and the selling rules always use the company details.",
        "properties": {
          "address": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "use": {
            "enum": [
              "company",
              "custom"
            ],
            "type": "string"
          }
        },
        "required": [
          "use",
          "legal_name",
          "tax_id",
          "address"
        ],
        "type": "object"
      },
      "CookieConsentCategory": {
        "properties": {
          "key": {
            "enum": [
              "necessary",
              "preferences",
              "analytics",
              "marketing"
            ],
            "type": "string"
          },
          "required": {
            "description": "Necessary only: always on, cannot be refused.",
            "type": "boolean"
          },
          "tools": {
            "description": "Titles of the enabled plugins whose tags are in this category.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CookieConsentChoice": {
        "properties": {
          "action": {
            "enum": [
              "accept_all",
              "reject_all",
              "custom",
              "withdraw"
            ],
            "type": "string"
          },
          "analytics": {
            "type": "boolean"
          },
          "consent_id": {
            "description": "The id an earlier choice of this browser was given; omitted or malformed gets a new one.",
            "pattern": "^[A-Za-z0-9_-]{22}$",
            "type": "string"
          },
          "marketing": {
            "type": "boolean"
          },
          "preferences": {
            "type": "boolean"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "version",
          "action"
        ],
        "type": "object"
      },
      "CookieConsentConfig": {
        "properties": {
          "active": {
            "description": "The banner must be shown: on, with at least one non-essential tag to ask about.",
            "type": "boolean"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/CookieConsentCategory"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "tags": {
            "items": {
              "$ref": "#/components/schemas/CookieConsentTag"
            },
            "type": "array"
          },
          "texts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CookieConsentTexts"
            },
            "type": "object"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CookieConsentReceipt": {
        "properties": {
          "action": {
            "enum": [
              "accept_all",
              "reject_all",
              "custom",
              "withdraw"
            ],
            "type": "string"
          },
          "categories": {
            "items": {
              "enum": [
                "necessary",
                "preferences",
                "analytics",
                "marketing"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "consent_id": {
            "type": "string"
          },
          "recorded_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CookieConsentSettings": {
        "properties": {
          "enabled": {
            "description": "Off: no banner and no non-essential tag.",
            "type": "boolean"
          },
          "texts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CookieConsentTexts"
            },
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "The consent version a stored choice must name.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CookieConsentSettingsInput": {
        "properties": {
          "bump_version": {
            "description": "Raise the consent version by one (ask every visitor again).",
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "texts": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CookieConsentTexts"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "CookieConsentStats": {
        "properties": {
          "actions": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "current_version": {
            "description": "Choices that answered the current version.",
            "type": "integer"
          },
          "days": {
            "type": "integer"
          },
          "distinct_consent_ids": {
            "type": "integer"
          },
          "granted": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "retention_days": {
            "type": "integer"
          },
          "since": {
            "format": "date-time",
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "version": {
            "description": "The current consent version.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CookieConsentTag": {
        "description": "One third-party tag the storefront may load once its category is consented to.",
        "properties": {
          "category": {
            "enum": [
              "preferences",
              "analytics",
              "marketing"
            ],
            "type": "string"
          },
          "plugin": {
            "example": "google-analytics",
            "type": "string"
          },
          "settings": {
            "additionalProperties": true,
            "description": "The public settings of the plugin's fields that configure this tag.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "CookieConsentTexts": {
        "description": "A store's own banner wording in one language; an absent field keeps the storefront's.",
        "properties": {
          "body": {
            "maxLength": 1000,
            "type": "string"
          },
          "title": {
            "maxLength": 120,
            "type": "string"
          }
        },
        "type": "object"
      },
      "CouponUse": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "page_id",
          "kind",
          "slug",
          "name",
          "language",
          "status"
        ],
        "type": "object"
      },
      "CredentialsInput": {
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "password": {
            "format": "password",
            "minLength": 8,
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "type": "object"
      },
      "CrossBorderSettings": {
        "properties": {
          "dap_notice": {
            "description": "Tell a DAP market's cross-border shopper that duties may be charged on delivery.",
            "type": "boolean"
          },
          "default_duty_bp": {
            "description": "The duty for a line no rule names (0: none).",
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "duty_rules": {
            "items": {
              "$ref": "#/components/schemas/DutyRule"
            },
            "maxItems": 500,
            "type": "array"
          },
          "effective_origin": {
            "description": "The origin the estimate uses.",
            "readOnly": true,
            "type": "string"
          },
          "eu_vat_rates": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "The embedded EU standard VAT rates in basis points (Your Europe, last checked 13/07/2026).",
            "readOnly": true,
            "type": "object"
          },
          "market_modes": {
            "additionalProperties": {
              "enum": [
                "off",
                "dap",
                "ddp"
              ],
              "type": "string"
            },
            "description": "Market code → mode. A market not listed is off.",
            "type": "object"
          },
          "origin_country": {
            "description": "Where parcels leave from; \"\" takes the first stock location's country, else TR.",
            "type": "string"
          },
          "preferential_origin": {
            "description": "The goods travel with a proof of preferential origin (A.TR / EUR.1): the EU's temporary €3 flat duty does not apply and the duty rules decide.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CurrencyPayouts": {
        "description": "One currency's methods and their sum. Nothing is added across two currencies.",
        "properties": {
          "currency": {
            "type": "string"
          },
          "methods": {
            "items": {
              "$ref": "#/components/schemas/MethodPayout"
            },
            "type": "array"
          },
          "totals": {
            "$ref": "#/components/schemas/MethodPayout"
          }
        },
        "type": "object"
      },
      "CurrencySale": {
        "properties": {
          "currency": {
            "description": "An ISO 4217 code other than the store's base currency.",
            "type": "string"
          },
          "regular_minor": {
            "description": "The regular price in that currency's minor units.",
            "format": "int64",
            "type": "integer"
          },
          "sale_minor": {
            "description": "The sale price; null: no sale in that currency.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "currency",
          "regular_minor",
          "sale_minor"
        ],
        "type": "object"
      },
      "CurrencySales": {
        "description": "One currency's figures. Orders snapshot their currency (D14), so a store that changed it has more than one block — and minor units of two currencies are never added together.",
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/SalesBucket"
            },
            "type": "array"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/SalesTotals"
          }
        },
        "required": [
          "currency",
          "totals",
          "buckets"
        ],
        "type": "object"
      },
      "CurrencySettings": {
        "properties": {
          "base": {
            "description": "The base currency: fixed; the variants' own prices.",
            "type": "string"
          },
          "base_exponent": {
            "type": "integer"
          },
          "currencies": {
            "items": {
              "$ref": "#/components/schemas/StoreCurrency"
            },
            "type": "array"
          },
          "rate_source": {
            "description": "Where automatic rates come from: the European Central Bank's daily reference rates.",
            "enum": [
              "ecb"
            ],
            "type": "string"
          },
          "refresh_hours": {
            "description": "How often the rates refresh by themselves.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CustomReport": {
        "description": "One saved report. `created_by` and `updated_by` are absent for a report saved by a token with no operator behind it.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "sql": {
            "description": "A single SELECT, or a WITH whose body only reads.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "CustomReportInput": {
        "description": "A report to save: what it answers and the query that answers it.",
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "description": "What it answers. At most 120 characters.",
            "type": "string"
          },
          "sql": {
            "description": "A single SELECT, or a WITH whose body only reads.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "sql"
        ],
        "type": "object"
      },
      "CustomReportResult": {
        "description": "One run of a report's query.",
        "properties": {
          "columns": {
            "description": "The column names the query returned.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "rows": {
            "description": "Rows as strings, nulls preserved. Rendering is the database’s own cast, not a type switch that would have to know every type a store might add.",
            "items": {
              "items": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": "array"
            },
            "type": "array"
          },
          "took_ms": {
            "description": "How long the query ran.",
            "type": "integer"
          },
          "truncated": {
            "description": "The answer was cut at 1000 rows. Without this a prefix looks like an answer.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CustomerAccepted": {
        "description": "The same for every address: no answer here says whether an address has an account.",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "delivery": {
            "description": "Whether the store can send account email at all (an email provider and a storefront address): configuration, the same for every caller.",
            "enum": [
              "email",
              "none"
            ],
            "type": "string"
          }
        },
        "required": [
          "accepted",
          "delivery"
        ],
        "type": "object"
      },
      "CustomerAccount": {
        "description": "The signed-in shopper's own account (ADR-0049). Never carries a password or anything that leads to one. Until the address is verified the names are those typed at sign-up and nothing the store already knew about the address is shown.",
        "properties": {
          "accepts_marketing": {
            "type": "boolean"
          },
          "birth_date": {
            "description": "The shopper's own date of birth, for the birthday e-mail (0181); absent when not given or not verified.",
            "format": "date",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "email_verified_at": {
            "format": "date-time",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_name": {
            "type": "string"
          },
          "pending_email": {
            "description": "An address change waiting for its confirmation link.",
            "type": "string"
          },
          "phone": {
            "description": "The store record's phone; empty until the address is verified.",
            "type": "string"
          },
          "verified": {
            "description": "Whether the email address has been proved. Orders are attached to the account only then, and only then may the account change its details and addresses.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "email",
          "first_name",
          "last_name",
          "phone",
          "verified",
          "accepts_marketing",
          "created_at"
        ],
        "type": "object"
      },
      "CustomerAddress": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_default_billing": {
            "type": "boolean"
          },
          "is_default_shipping": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "address",
          "is_default_shipping",
          "is_default_billing",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "CustomerAddressInput": {
        "description": "On update an absent field is left alone. The first address an account saves is its default for both.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "is_default_billing": {
            "type": "boolean"
          },
          "is_default_shipping": {
            "type": "boolean"
          },
          "label": {
            "description": "A name for the address (\"Ev\", \"İş\"), at most 60 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerCompany": {
        "properties": {
          "credit_limit": {
            "$ref": "#/components/schemas/Money"
          },
          "name": {
            "type": "string"
          },
          "open_balance": {
            "$ref": "#/components/schemas/Money"
          },
          "orders": {
            "items": {
              "$ref": "#/components/schemas/CompanyOrder"
            },
            "type": "array"
          },
          "payment_terms_days": {
            "type": "integer"
          },
          "role": {
            "enum": [
              "admin",
              "buyer"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "role",
          "orders",
          "payment_terms_days",
          "open_balance",
          "credit_limit"
        ],
        "type": "object"
      },
      "CustomerDataExport": {
        "properties": {
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "email": {
            "type": "string"
          },
          "generated_at": {
            "format": "date-time",
            "type": "string"
          },
          "sections": {
            "additionalProperties": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            "description": "One JSON array per record type: customer_record, orders, consents, suppressions, notifications, carts, customer_groups.",
            "type": "object"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "generated_at",
          "store_id",
          "email",
          "sections",
          "counts"
        ],
        "type": "object"
      },
      "CustomerGroup": {
        "properties": {
          "automatic": {
            "description": "\"registered\": every signed-up customer of the store with a verified email is a member; nobody is listed by hand. Absent for a group with listed members.",
            "enum": [
              "registered"
            ],
            "type": "string"
          },
          "code": {
            "description": "The stable handle a script or an import names the group by, so a renamed group stays the same group.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dealer": {
            "description": "Its members are approved dealers: they see the prices the store hides from everybody else (ADR-0091 §2).",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "members": {
            "description": "How many addresses are in it.",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerGroupInput": {
        "properties": {
          "automatic": {
            "description": "\"registered\" makes the store's group of every verified customer account (one per store).",
            "enum": [
              "",
              "registered"
            ],
            "type": "string"
          },
          "code": {
            "description": "Optional: made from the name when absent.",
            "example": "trade",
            "type": "string"
          },
          "dealer": {
            "description": "Make it a dealer group (ADR-0091 §2).",
            "type": "boolean"
          },
          "name": {
            "example": "Trade accounts",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CustomerMarketing": {
        "properties": {
          "email": {
            "description": "The shopper ticked the box to receive campaigns by email.",
            "type": "boolean"
          },
          "form_version": {
            "type": "string"
          },
          "text": {
            "description": "The wording shown next to the box (proof, ETK); required with email.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerOAuthCallback": {
        "properties": {
          "binding": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "state",
          "binding",
          "code"
        ],
        "type": "object"
      },
      "CustomerOAuthProviders": {
        "properties": {
          "providers": {
            "items": {
              "enum": [
                "google",
                "apple"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "type": "object"
      },
      "CustomerOAuthSignIn": {
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerAccount"
          },
          "new": {
            "type": "boolean"
          },
          "return_to": {
            "type": "string"
          },
          "session": {
            "properties": {
              "expires_at": {
                "format": "date-time",
                "type": "string"
              },
              "token": {
                "type": "string"
              }
            },
            "required": [
              "token",
              "expires_at"
            ],
            "type": "object"
          }
        },
        "required": [
          "session",
          "customer",
          "return_to",
          "new"
        ],
        "type": "object"
      },
      "CustomerOAuthStart": {
        "properties": {
          "provider": {
            "enum": [
              "google",
              "apple"
            ],
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          },
          "return_to": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "redirect_uri"
        ],
        "type": "object"
      },
      "CustomerOAuthStarted": {
        "properties": {
          "binding": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "binding"
        ],
        "type": "object"
      },
      "CustomerOrder": {
        "properties": {
          "access_token": {
            "description": "Opens the order page (/order/{number}?token=); the account owns the order, so the shopper never types it.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "fulfillment_status": {
            "type": "string"
          },
          "item_count": {
            "type": "integer"
          },
          "number": {
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          },
          "state": {
            "description": "The order's lifecycle (Order.state).",
            "enum": [
              "pending",
              "open",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "number",
          "created_at",
          "status",
          "state",
          "payment_status",
          "fulfillment_status",
          "total",
          "item_count",
          "access_token"
        ],
        "type": "object"
      },
      "CustomerOrderNote": {
        "properties": {
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerProfileInput": {
        "description": "An absent field is left alone.",
        "properties": {
          "birth_date": {
            "description": "YYYY-MM-DD; empty clears it.",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerRecord": {
        "description": "A store's record of a shopper (M8). Separate from users, unique by email within one store, and never required: guest checkout creates none, and an order keeps its own snapshot of who bought it.",
        "properties": {
          "accepts_marketing": {
            "type": "boolean"
          },
          "account_created_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "email_verified_at": {
            "description": "When the account proved its email address; null while unverified.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": "string"
          },
          "has_account": {
            "description": "The shopper opened a storefront account on this record (ADR-0049).",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_name": {
            "type": "string"
          },
          "last_sign_in_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerRecordInput": {
        "description": "On update, an absent field is left alone.",
        "properties": {
          "accepts_marketing": {
            "type": "boolean"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerRegistration": {
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "kvkk_acknowledged": {
            "description": "The shopper was shown the KVKK notice (aydınlatma metni) and ticked that they read it. Required true.",
            "type": "boolean"
          },
          "kvkk_version": {
            "description": "The published KVKK notice version shown, recorded in the audit trail.",
            "type": "integer"
          },
          "last_name": {
            "type": "string"
          },
          "marketing": {
            "$ref": "#/components/schemas/CustomerMarketing"
          },
          "password": {
            "description": "At least 10 characters, and not the email address or its part before the @.",
            "type": "string"
          }
        },
        "required": [
          "first_name",
          "email",
          "password",
          "kvkk_acknowledged"
        ],
        "type": "object"
      },
      "CustomerReturnInput": {
        "additionalProperties": false,
        "properties": {
          "defective": {
            "description": "The goods are faulty — a code that does not work, a damaged item (6502 m.11) — rather than unwanted. A line sold without the right of withdrawal can be returned only this way (otherwise 422, details.reason no_right_of_withdrawal), and the reason must then say what is wrong.",
            "type": "boolean"
          },
          "lines": {
            "items": {
              "properties": {
                "line_id": {
                  "description": "An order line's id (`line_items[].id`).",
                  "format": "int64",
                  "type": "integer"
                },
                "quantity": {
                  "minimum": 1,
                  "type": "integer"
                },
                "reason_id": {
                  "description": "One of the store's return reasons (`/api/admin/return-reasons`); not a reason that has sub-reasons. The line keeps its label.",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "line_id",
                "quantity"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "reason": {
            "description": "Why, in the shopper's words; shown to the operator.",
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "lines"
        ],
        "type": "object"
      },
      "CustomerSession": {
        "properties": {
          "expires_at": {
            "description": "Thirty days from now; every use slides it.",
            "format": "date-time",
            "type": "string"
          },
          "token": {
            "description": "Opaque session token. The storefront keeps it in its own HttpOnly, Secure, SameSite=Lax cookie and sends it back in X-Customer-Session; no browser script ever holds it.",
            "type": "string"
          }
        },
        "required": [
          "token",
          "expires_at"
        ],
        "type": "object"
      },
      "CustomerSignIn": {
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerAccount"
          },
          "session": {
            "$ref": "#/components/schemas/CustomerSession"
          }
        },
        "required": [
          "session",
          "customer"
        ],
        "type": "object"
      },
      "CustomerStoreRef": {
        "description": "A store a NeroCart customer runs.",
        "properties": {
          "admin_url": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "status"
        ],
        "type": "object"
      },
      "CustomerValueReport": {
        "properties": {
          "cohorts": {
            "items": {
              "$ref": "#/components/schemas/CohortRow"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "customers": {
            "type": "integer"
          },
          "generated_at": {
            "format": "date-time",
            "type": "string"
          },
          "lifetime_value": {
            "$ref": "#/components/schemas/Money"
          },
          "orders_per_customer": {
            "type": "number"
          },
          "repeat": {
            "type": "integer"
          },
          "repeat_rate": {
            "type": "number"
          },
          "rfm": {
            "items": {
              "$ref": "#/components/schemas/RFMGroup"
            },
            "type": "array"
          }
        },
        "required": [
          "currency",
          "customers",
          "repeat",
          "repeat_rate",
          "orders_per_customer",
          "lifetime_value",
          "cohorts",
          "rfm",
          "generated_at"
        ],
        "type": "object"
      },
      "DNSRecord": {
        "properties": {
          "name": {
            "type": "string"
          },
          "purpose": {
            "enum": [
              "verify",
              "route"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "TXT",
              "CNAME"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "value",
          "purpose"
        ],
        "type": "object"
      },
      "Dashboard": {
        "description": "The home screen's counts; each is the total of a listing the panel links to.",
        "properties": {
          "chats_unread": {
            "description": "Live chats with a visitor's message unread; absent without contact.read.",
            "type": "integer"
          },
          "deliveries_failed": {
            "description": "Shipments whose delivery failed.",
            "type": "integer"
          },
          "invoices_failed": {
            "description": "Invoices the integrator failed or rejected.",
            "type": "integer"
          },
          "leaked_keys": {
            "description": "API keys GitHub found in public and NeroCart revoked, not yet deleted (apikeys.read); absent without that right.",
            "type": [
              "integer",
              "null"
            ]
          },
          "low_stock": {
            "description": "Variants at or below the threshold; null without inventory.read.",
            "type": [
              "integer",
              "null"
            ]
          },
          "low_stock_threshold": {
            "type": "integer"
          },
          "orders_awaiting_payment": {
            "description": "Unpaid orders still holding stock.",
            "type": "integer"
          },
          "orders_to_ship": {
            "description": "Orders accepted and not fully shipped (status confirmed or partial).",
            "type": "integer"
          },
          "orders_today": {
            "description": "Orders placed since midnight on the store's clock.",
            "type": "integer"
          },
          "payments_failed": {
            "description": "Orders not cancelled whose payment failed.",
            "type": "integer"
          },
          "payments_to_capture": {
            "description": "Payments authorized and waiting to be captured or voided.",
            "type": "integer"
          },
          "refunds_pending": {
            "description": "Refunds recorded as pending.",
            "type": "integer"
          },
          "returns_open": {
            "description": "Returns requested, authorized, received or inspected.",
            "type": "integer"
          },
          "sales_today": {
            "description": "Totals of today's orders that are not cancelled, per currency.",
            "items": {
              "$ref": "#/components/schemas/Money"
            },
            "type": "array"
          }
        },
        "required": [
          "orders_to_ship",
          "payments_failed",
          "payments_to_capture",
          "orders_awaiting_payment",
          "refunds_pending",
          "returns_open",
          "invoices_failed",
          "deliveries_failed",
          "low_stock",
          "low_stock_threshold",
          "orders_today",
          "sales_today"
        ],
        "type": "object"
      },
      "DealerApplication": {
        "properties": {
          "company_name": {
            "type": "string"
          },
          "consent_text": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "format": "int64",
            "type": "integer"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_by": {
            "type": "string"
          },
          "decision_reason": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "group_name": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "revoked"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_id_kind": {
            "enum": [
              "vkn",
              "tckn"
            ],
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "email",
          "name",
          "company_name",
          "tax_id",
          "tax_id_kind",
          "tax_office",
          "phone",
          "note",
          "consent_text",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "DealerApplicationCounts": {
        "properties": {
          "approved": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "revoked": {
            "type": "integer"
          }
        },
        "required": [
          "pending",
          "approved",
          "rejected",
          "revoked"
        ],
        "type": "object"
      },
      "DealerApplicationInput": {
        "properties": {
          "company_name": {
            "maxLength": 200,
            "type": "string"
          },
          "consent": {
            "description": "The KVKK notice was acknowledged.",
            "type": "boolean"
          },
          "consent_text": {
            "description": "The notice line the applicant was shown.",
            "maxLength": 1000,
            "type": "string"
          },
          "note": {
            "maxLength": 1000,
            "type": "string"
          },
          "phone": {
            "maxLength": 30,
            "type": "string"
          },
          "started_at": {
            "description": "When the form was shown, Unix milliseconds.",
            "format": "int64",
            "type": "integer"
          },
          "tax_id": {
            "description": "A VKN (10 digits) or a TCKN (11), checked with its check digits.",
            "type": "string"
          },
          "tax_office": {
            "description": "Required with a VKN.",
            "maxLength": 200,
            "type": "string"
          },
          "website": {
            "description": "Honeypot: empty from a person.",
            "type": "string"
          }
        },
        "required": [
          "company_name",
          "tax_id",
          "phone",
          "consent",
          "consent_text"
        ],
        "type": "object"
      },
      "DealerApplicationView": {
        "properties": {
          "company_name": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "reason": {
            "description": "Why it was rejected or revoked.",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "revoked"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "company_name",
          "tax_id",
          "tax_office",
          "phone",
          "created_at"
        ],
        "type": "object"
      },
      "DealerDecision": {
        "properties": {
          "group_id": {
            "description": "Approve only: the dealer group; absent: the store's default dealer group (\"Bayiler\", made on first need).",
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "description": "Required to reject or revoke; the applicant reads it.",
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "DealerReceipt": {
        "properties": {
          "received": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "received",
          "status"
        ],
        "type": "object"
      },
      "DealerStatus": {
        "properties": {
          "application": {
            "$ref": "#/components/schemas/DealerApplicationView"
          },
          "applications_open": {
            "type": "boolean"
          },
          "dealer": {
            "description": "The account is one of the store's dealers now.",
            "type": "boolean"
          }
        },
        "required": [
          "applications_open",
          "dealer"
        ],
        "type": "object"
      },
      "DeclineDictionary": {
        "properties": {
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "default_language": {
            "type": "string"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/DeclineDictionaryEntry"
            },
            "type": "array"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "translate": {
            "description": "A machine translator is set up for suggestions.",
            "type": "boolean"
          },
          "unmapped": {
            "items": {
              "$ref": "#/components/schemas/UnmappedDecline"
            },
            "type": "array"
          }
        },
        "required": [
          "categories",
          "languages",
          "default_language",
          "entries",
          "unmapped",
          "translate"
        ],
        "type": "object"
      },
      "DeclineDictionaryEntry": {
        "properties": {
          "builtin": {
            "description": "The gateway's own category, when it knows the code.",
            "type": "string"
          },
          "category": {
            "enum": [
              "insufficient_funds",
              "limit_exceeded",
              "3ds_failed",
              "3ds_unavailable",
              "not_permitted",
              "expired_card",
              "invalid_card",
              "wrong_cvv",
              "do_not_honor",
              "call_bank",
              "lost_stolen",
              "restricted_card",
              "bank_unavailable",
              "other"
            ],
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "custom": {
            "description": "The store wrote its own words.",
            "type": "boolean"
          },
          "customer_text": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "merchant_note": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "provider_name",
          "code",
          "category",
          "customer_text",
          "custom"
        ],
        "type": "object"
      },
      "DeclineDictionaryInput": {
        "properties": {
          "category": {
            "enum": [
              "insufficient_funds",
              "limit_exceeded",
              "3ds_failed",
              "3ds_unavailable",
              "not_permitted",
              "expired_card",
              "invalid_card",
              "wrong_cvv",
              "do_not_honor",
              "call_bank",
              "lost_stolen",
              "restricted_card",
              "bank_unavailable",
              "other"
            ],
            "type": "string"
          },
          "customer_text": {
            "additionalProperties": {
              "maxLength": 500,
              "type": "string"
            },
            "type": "object"
          },
          "merchant_note": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "category"
        ],
        "type": "object"
      },
      "DeliveredLicenceKey": {
        "properties": {
          "code": {
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_line_id",
          "title",
          "sku",
          "code",
          "delivered_at"
        ],
        "type": "object"
      },
      "DemoImport": {
        "properties": {
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Records created by kind: product, collection, category, media, size_guide, page.",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "hidden_products": {
            "description": "Products of the import still hidden (drafts the merchant has not published); 0 once published or removed.",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "pack_hash": {
            "type": "string"
          },
          "removed_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "theme_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DeviceInts": {
        "description": "A value per device: computer (d), tablet (t), phone (m); absent is unset (the tablet takes the computer's, the phone the tablet's).",
        "properties": {
          "d": {
            "type": "integer"
          },
          "m": {
            "type": "integer"
          },
          "t": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Diagnostic": {
        "description": "One check's verdict. The underlying database error behind a check that could not run is deliberately absent: the engine records it separately and the API withholds it, so it is in the store's log rather than in this response.",
        "properties": {
          "detail": {
            "description": "What the check found, in a sentence.",
            "type": "string"
          },
          "hint": {
            "description": "What to do about it. Every failing check carries one; a passing check does not.",
            "type": "string"
          },
          "name": {
            "description": "Stable, and part of the contract: clients key behaviour to these names.",
            "example": "outbox",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "warn",
              "fail"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "DiagnosticReport": {
        "description": "One run of every check, in the engine's own order. `ok` is false when any check failed, which is the same condition `nerocart doctor` exits non-zero on — warnings do not flip it, because a busy healthy store routinely carries some.",
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/Diagnostic"
            },
            "type": "array"
          },
          "ok": {
            "description": "False when any check failed.",
            "type": "boolean"
          },
          "version": {
            "description": "The engine version that produced the report.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DimensionPatch": {
        "description": "A parcel's three sides as a patch, in `dimension_unit`. A side left out is kept; an explicit null clears it back to unmeasured; a number sets it. The three states are the point: emptying a box and never touching it are different intentions, and storing zero for the first would tell a carrier the parcel is flat.",
        "properties": {
          "height": {
            "type": [
              "number",
              "null"
            ]
          },
          "length": {
            "type": [
              "number",
              "null"
            ]
          },
          "width": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "DimensionValues": {
        "description": "The same three sides as a person typed them, in `dimension_unit`, converted server-side. Sent together with the unit this is a form's shape; sending `dimensions` is the API's. When both name a side this one wins — a caller that computed millimetres itself and then also sent a value contradicted itself, and the human-entered number is the one a person can check. The rule `weight` follows against `weight_grams`.",
        "properties": {
          "height": {
            "type": "number"
          },
          "length": {
            "type": "number"
          },
          "width": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "Dimensions": {
        "description": "A parcel's three sides in whole millimetres — the canonical stored value, exactly as `weight_grams` is for the mass beside it. An absent side is one nobody has measured, which is not a side of zero: a zero-height parcel is a carrier error, an unmeasured one is paperwork still to do.",
        "properties": {
          "height_mm": {
            "type": [
              "integer",
              "null"
            ]
          },
          "length_mm": {
            "type": [
              "integer",
              "null"
            ]
          },
          "width_mm": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Discount": {
        "description": "A rule an operator maintains. What an order was actually given is a separate snapshot — see AppliedDiscount — so a promotion that has ended may be deleted without rewriting history.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "allocation": {
            "description": "How the value meets the lines: `each` line up to `max_quantity` units, `across` split in proportion to what is left of each (the default), `once` on `max_quantity` units in total, cheapest first.",
            "enum": [
              "each",
              "across",
              "once"
            ],
            "type": "string"
          },
          "apply_to_quantity": {
            "description": "Target units one buy-get application discounts.",
            "format": "int64",
            "type": "integer"
          },
          "buy_rules": {
            "description": "Which lines unlock a buy-get.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "buy_rules_min_quantity": {
            "description": "Buy units one buy-get application needs.",
            "format": "int64",
            "type": "integer"
          },
          "campaign_id": {
            "description": "The campaign whose schedule and budget this promotion runs under.",
            "format": "int64",
            "type": "integer"
          },
          "code": {
            "description": "What a shopper types. Matched case-insensitively and unique that way. Absent means automatic: the promotion applies to every basket it matches without anybody typing it, beside the code a shopper applied.",
            "type": "string"
          },
          "combinable": {
            "description": "Whether the promotion may apply together with other promotions on one basket (default true). False: when it and others apply, the basket gets either this promotion alone or every combinable one together, whichever takes more off; a tie goes to the automatic one, then the lower id (ADR-0156).",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "description": "A fixed amount's currency (ISO 4217). Absent is the store's base currency. A basket in another currency is refused the code; an automatic promotion simply does not apply to it.",
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_tax_inclusive": {
            "description": "The promotion's amounts include tax: a fixed amount is measured against the tax-inclusive line total. On a store whose prices exclude tax, what comes off the line is the net part of it.",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed",
              "free_shipping"
            ],
            "type": "string"
          },
          "max_quantity": {
            "description": "Units an `each` or `once` promotion covers; the units a buy-get discounts in total. Refused with `across`.",
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "min_subtotal_minor": {
            "description": "The basket this needs before it applies, measured on the whole basket even for a scoped rule: it is the price of entry to a promotion, not the thing discounted. Absent is no minimum, which is not the same as zero.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "once_per_email": {
            "description": "Per email, not per customer, and named so. Guest checkout is permanent (D22), so there is no customer to count against — this is a deterrent, not a control.",
            "type": "boolean"
          },
          "rules": {
            "description": "Conditions on the basket, all of which must hold for the promotion to apply (`customer.groups.id`, `currency_code`, `item_subtotal`, `items.product.id`, …). `min_subtotal_minor` is a rule on `item_subtotal` that is kept as its own field.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "scope": {
            "description": "What the rule comes off. `order` is the whole basket. `products`, `collections` and `categories` mean the value comes off only the lines whose product is named by `target_ids` — directly, by collection membership read at checkout, or by category, which reaches the whole subtree beneath the categories named. A basket holding none of them is refused the code. `free_shipping` cannot be scoped: shipping is not part of any line.",
            "enum": [
              "order",
              "collections",
              "products",
              "categories"
            ],
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "target_ids": {
            "description": "What a scoped rule points at: product, collection or category ids according to `scope`. Absent for an order-wide rule. Returned by both the listing and the single read, so a client editing a rule holds the whole set without a second request.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "target_rules": {
            "description": "Which lines an `items` promotion comes off, or which shipping a `shipping_methods` one does (`items.product.id`, `items.product.collections.id`, `items.product.categories.id` — which reaches the category's whole subtree —, `items.product.tags.id`, `shipping_methods.shipping_option.id`). Refused on an `order` target.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "target_type": {
            "description": "Where the value goes. `order` spreads it over every discountable line; `items` over the lines `target_rules` (or the scope's targets) reach; `shipping_methods` comes off the shipping. A scoped rule is always `items` and `free_shipping` always `shipping_methods`, whatever this says. Default `order`.",
            "enum": [
              "order",
              "items",
              "shipping_methods"
            ],
            "type": "string"
          },
          "targets": {
            "description": "The same targets resolved for a reader. Returned by GET /api/admin/discounts/{id} only — a listing returns ids, because a rule aimed at two hundred products would otherwise put two hundred titles into a page of fifty rows.",
            "items": {
              "$ref": "#/components/schemas/DiscountTarget"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "description": "`buyget` discounts target items once enough buy items are in the basket (Medusa's buy X get Y). Default `standard`.",
            "enum": [
              "standard",
              "buyget"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "usage_limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used_count": {
            "description": "Read-only: a fact about what happened, not a setting.",
            "type": "integer"
          },
          "value_bp": {
            "description": "Basis points for a percentage: 1000 is 10.00%. An integer, because a percentage of money is money-adjacent and floats are forbidden near it.",
            "type": "integer"
          },
          "value_minor": {
            "description": "The amount for a fixed discount, in minor units.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "DiscountCode": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "used": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "code",
          "used",
          "active"
        ],
        "type": "object"
      },
      "DiscountCodesInput": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "prefix": {
            "type": "string"
          }
        },
        "required": [
          "count"
        ],
        "type": "object"
      },
      "DiscountDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Discount"
          },
          {
            "properties": {
              "redeemed_orders": {
                "description": "Live orders carrying a redemption of this rule in the store's currency.",
                "type": "integer"
              },
              "redeemed_other_currency_orders": {
                "description": "Live redemptions on orders in some other currency, which `redeemed_total` therefore leaves out. Zero in a store that has never changed currency.",
                "type": "integer"
              },
              "redeemed_total": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Money"
                  }
                ],
                "description": "What this promotion has given away, cancelled orders excluded, in the store's settlement currency. Not `used_count`: that is the claim made at checkout and is never given back, so the two are allowed to disagree."
              }
            },
            "type": "object"
          }
        ],
        "description": "The rule plus what it has cost. Returned by the detail route only."
      },
      "DiscountInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "allocation": {
            "description": "How the value meets the lines: `each` line up to `max_quantity` units, `across` split in proportion to what is left of each (the default), `once` on `max_quantity` units in total, cheapest first.",
            "enum": [
              "each",
              "across",
              "once"
            ],
            "type": "string"
          },
          "apply_to_quantity": {
            "description": "Target units one buy-get application discounts.",
            "format": "int64",
            "type": "integer"
          },
          "buy_rules": {
            "description": "Which lines unlock a buy-get.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "buy_rules_min_quantity": {
            "description": "Buy units one buy-get application needs.",
            "format": "int64",
            "type": "integer"
          },
          "campaign_id": {
            "description": "The campaign whose schedule and budget this promotion runs under.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "code": {
            "description": "What a shopper types. Matched case-insensitively and unique that way. Absent means automatic: the promotion applies to every basket it matches without anybody typing it, beside the code a shopper applied.",
            "type": "string"
          },
          "combinable": {
            "description": "Whether the promotion may apply together with other promotions on one basket (default true). False: when it and others apply, the basket gets either this promotion alone or every combinable one together, whichever takes more off; a tie goes to the automatic one, then the lower id (ADR-0156).",
            "type": "boolean"
          },
          "currency": {
            "description": "A fixed amount's currency (ISO 4217). Absent is the store's base currency. A basket in another currency is refused the code; an automatic promotion simply does not apply to it.",
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "is_tax_inclusive": {
            "description": "The promotion's amounts include tax: a fixed amount is measured against the tax-inclusive line total. On a store whose prices exclude tax, what comes off the line is the net part of it.",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed",
              "free_shipping"
            ],
            "type": "string"
          },
          "max_quantity": {
            "description": "Units an `each` or `once` promotion covers; the units a buy-get discounts in total. Refused with `across`.",
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "min_subtotal_minor": {
            "description": "The basket this needs before it applies, measured on the whole basket even for a scoped rule: it is the price of entry to a promotion, not the thing discounted. Absent is no minimum, which is not the same as zero.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "once_per_email": {
            "description": "Per email, not per customer, and named so. Guest checkout is permanent (D22), so there is no customer to count against — this is a deterrent, not a control.",
            "type": "boolean"
          },
          "rules": {
            "description": "Conditions on the basket, all of which must hold for the promotion to apply (`customer.groups.id`, `currency_code`, `item_subtotal`, `items.product.id`, …). `min_subtotal_minor` is a rule on `item_subtotal` that is kept as its own field.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "scope": {
            "description": "What the rule comes off. `order` is the whole basket. `products`, `collections` and `categories` mean the value comes off only the lines whose product is named by `target_ids` — directly, by collection membership read at checkout, or by category, which reaches the whole subtree beneath the categories named. A basket holding none of them is refused the code. `free_shipping` cannot be scoped: shipping is not part of any line.",
            "enum": [
              "order",
              "collections",
              "products",
              "categories"
            ],
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "target_ids": {
            "description": "What the rule points at: product, collection or category ids according to `scope` — the kind is never sent, because the scope decides it. Required and non-empty for `products`, `collections` and `categories`; absent or empty for `order` and for an omitted scope. Duplicates are deduped and order is not stored. On PATCH: absent leaves the stored set alone, a list replaces it whole, and `[]` clears it, which is legal only when the resulting scope is `order`.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "target_rules": {
            "description": "Which lines an `items` promotion comes off, or which shipping a `shipping_methods` one does (`items.product.id`, `items.product.collections.id`, `items.product.categories.id` — which reaches the category's whole subtree —, `items.product.tags.id`, `shipping_methods.shipping_option.id`). Refused on an `order` target.",
            "items": {
              "$ref": "#/components/schemas/DiscountRule"
            },
            "type": "array"
          },
          "target_type": {
            "description": "Where the value goes. `order` spreads it over every discountable line; `items` over the lines `target_rules` (or the scope's targets) reach; `shipping_methods` comes off the shipping. A scoped rule is always `items` and `free_shipping` always `shipping_methods`, whatever this says. Default `order`.",
            "enum": [
              "order",
              "items",
              "shipping_methods"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "description": "`buyget` discounts target items once enough buy items are in the basket (Medusa's buy X get Y). Default `standard`.",
            "enum": [
              "standard",
              "buyget"
            ],
            "type": "string"
          },
          "usage_limit": {
            "description": "How many times the code may be redeemed in total. Absent leaves a stored limit alone; an explicit null removes it, so a promotion can be reopened without recreating it. Zero is refused: a limit of none is null, not 0. A limit below the current `used_count` is refused.",
            "type": [
              "integer",
              "null"
            ]
          },
          "value_bp": {
            "description": "Basis points for a percentage: 1000 is 10.00%. An integer, because a percentage of money is money-adjacent and floats are forbidden near it.",
            "type": "integer"
          },
          "value_minor": {
            "description": "The amount for a fixed discount, in minor units.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "title",
          "kind"
        ],
        "type": "object"
      },
      "DiscountPreview": {
        "description": "The answer to \"would this work\". A refusal is data here and an error on the public cart route; the difference is the question, not the rule.",
        "properties": {
          "applied": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AppliedDiscount"
              }
            ],
            "description": "Present when `applies` is true. A free-shipping rule carries `free_shipping: true` and `amount_minor: 0`."
          },
          "applies": {
            "type": "boolean"
          },
          "reason": {
            "description": "Present when `applies` is false — the engine's own sentence, e.g. \"that discount has expired\", \"that discount has been fully used\", \"automatic discounts are not applied at checkout yet\".",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DiscountProduct": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "description": "The product's lead picture; absent when it has none.",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "via": {
            "description": "What brought the product in: the rule names it, one of its collections or categories does, or the rule is order-wide.",
            "enum": [
              "order",
              "product",
              "collection",
              "category"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "via"
        ],
        "type": "object"
      },
      "DiscountRedemption": {
        "description": "One order that used a rule. The code and title are the snapshot taken at checkout, not the rule's current ones, so a promotion that has since been renamed still reads as what it was.",
        "properties": {
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What this order was given, in the order's own currency."
          },
          "code": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed",
              "free_shipping"
            ],
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_total": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The order's total, in its own currency."
          },
          "payment_status": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "DiscountRule": {
        "description": "One condition, in Medusa's vocabulary: a dotted attribute into the basket, an operator and the values it is compared with. `eq` needs every basket value among the values, `in` at least one, `ne` none; the ordering operators compare as numbers.",
        "properties": {
          "attribute": {
            "example": "items.product.id",
            "type": "string"
          },
          "operator": {
            "enum": [
              "gte",
              "lte",
              "gt",
              "lt",
              "eq",
              "ne",
              "in"
            ],
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "attribute",
          "operator",
          "values"
        ],
        "type": "object"
      },
      "DiscountTarget": {
        "description": "One thing a scoped discount points at, resolved for a reader.",
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "Singular, against `scope`'s plural: a scope describes a rule, a kind describes one row. It is derived from the scope and never sent.",
            "enum": [
              "product",
              "collection",
              "category"
            ],
            "type": "string"
          },
          "missing": {
            "description": "The catalog row is gone. The target is kept rather than cleaned up, so a promotion that has narrowed is visible rather than silent.",
            "type": "boolean"
          },
          "title": {
            "description": "Read-only. A category's is its full ancestry (\"Apparel / Shirts\"), because the leaf alone does not say which one.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DocumentAccess": {
        "properties": {
          "action": {
            "enum": [
              "view",
              "ocr",
              "send"
            ],
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "actor_kind": {
            "enum": [
              "operator",
              "platform",
              "service",
              "system"
            ],
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "document_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "document_id",
          "actor_kind",
          "actor",
          "action",
          "at"
        ],
        "type": "object"
      },
      "DomainCheck": {
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/StoreDomain"
          },
          "error": {
            "type": "string"
          },
          "found": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "domain",
          "verified",
          "found"
        ],
        "type": "object"
      },
      "DomainsDnaOffer": {
        "description": "Whether the store can buy a domain here (domain sales on the live gateway).",
        "properties": {
          "available": {
            "type": "boolean"
          }
        },
        "required": [
          "available"
        ],
        "type": "object"
      },
      "DomainsDnaPurchaseInput": {
        "properties": {
          "domain": {
            "type": "string"
          },
          "years": {
            "type": "integer"
          }
        },
        "required": [
          "domain"
        ],
        "type": "object"
      },
      "DomainsDnaPurchaseStart": {
        "properties": {
          "checkout_url": {
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/DomainsDnaRequest"
          }
        },
        "required": [
          "request",
          "checkout_url"
        ],
        "type": "object"
      },
      "DomainsDnaRequest": {
        "description": "A domain the store bought (or is buying) from NeroCart.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "renew_url": {
            "type": "string"
          },
          "status": {
            "enum": [
              "checkout",
              "paid",
              "registered",
              "attached",
              "failed"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "years": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "domain",
          "years",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "DomainsDnaSearchInput": {
        "properties": {
          "query": {
            "description": "A name (ornek) or a full domain (ornek.com.tr).",
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "DomainsDnaSearchItem": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "buyable": {
            "type": "boolean"
          },
          "document_required": {
            "type": "boolean"
          },
          "domain": {
            "type": "string"
          },
          "max_years": {
            "type": "integer"
          },
          "min_years": {
            "type": "integer"
          },
          "premium": {
            "type": "boolean"
          },
          "price": {
            "description": "Registration per year in kuruş, VAT included; 0 when not sold here.",
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "renew_price": {
            "format": "int64",
            "type": "integer"
          },
          "tld": {
            "type": "string"
          },
          "trabis": {
            "type": "boolean"
          },
          "variant_id": {
            "description": "The registration product's variant of the extension (0 before the products are made).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "domain",
          "tld",
          "available",
          "premium",
          "document_required",
          "trabis",
          "price",
          "renew_price",
          "min_years",
          "max_years",
          "buyable",
          "variant_id"
        ],
        "type": "object"
      },
      "DomainsDnaSearchResult": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DomainsDnaSearchItem"
            },
            "type": "array"
          },
          "label": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        },
        "required": [
          "query",
          "label",
          "currency",
          "items"
        ],
        "type": "object"
      },
      "DutyRule": {
        "properties": {
          "hs_prefix": {
            "description": "An HS chapter, heading, subheading or national (GTİP / CN) code prefix; the longest prefix matching a variant's hs_code wins.",
            "pattern": "^[0-9]{2,12}$",
            "type": "string"
          },
          "note": {
            "description": "The merchant's note (where the rate comes from).",
            "maxLength": 200,
            "type": "string"
          },
          "rate_bp": {
            "description": "Duty in basis points (320 = 3.2 %) on the customs value (goods + shipping).",
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "hs_prefix",
          "rate_bp"
        ],
        "type": "object"
      },
      "ETGBCell": {
        "properties": {
          "auto": {
            "type": "string"
          },
          "typed": {
            "type": "boolean"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "type": "object"
      },
      "ETGBCellInput": {
        "properties": {
          "clear": {
            "type": "boolean"
          },
          "column": {
            "type": "string"
          },
          "row": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "row",
          "column"
        ],
        "type": "object"
      },
      "ETGBColumn": {
        "properties": {
          "field": {
            "type": "string"
          },
          "header": {
            "type": "string"
          },
          "key": {
            "pattern": "^[a-z][a-z0-9_]{0,39}$",
            "type": "string"
          },
          "source": {
            "enum": [
              "field",
              "constant",
              "manual"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "width": {
            "type": "number"
          }
        },
        "required": [
          "key",
          "header",
          "source"
        ],
        "type": "object"
      },
      "ETGBDay": {
        "properties": {
          "atr": {
            "type": "integer"
          },
          "closed_at": {
            "format": "date-time",
            "type": "string"
          },
          "closed_by": {
            "type": "string"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ETGBColumn"
            },
            "type": "array"
          },
          "day": {
            "format": "date",
            "type": "string"
          },
          "gifts": {
            "items": {
              "$ref": "#/components/schemas/ETGBGift"
            },
            "type": "array"
          },
          "prepared": {
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/ETGBRow"
            },
            "type": "array"
          },
          "sheet_file": {
            "type": "string"
          },
          "sheet_name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          }
        },
        "required": [
          "day",
          "status",
          "columns",
          "rows",
          "gifts",
          "sheet_file",
          "sheet_name",
          "prepared",
          "atr"
        ],
        "type": "object"
      },
      "ETGBDaySummary": {
        "properties": {
          "closed_at": {
            "format": "date-time",
            "type": "string"
          },
          "closed_by": {
            "type": "string"
          },
          "day": {
            "format": "date",
            "type": "string"
          },
          "rows": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          }
        },
        "required": [
          "day",
          "status",
          "rows"
        ],
        "type": "object"
      },
      "ETGBExcludeInput": {
        "properties": {
          "excluded": {
            "type": "boolean"
          },
          "row": {
            "type": "string"
          }
        },
        "required": [
          "row",
          "excluded"
        ],
        "type": "object"
      },
      "ETGBField": {
        "properties": {
          "key": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "text",
              "number",
              "date"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "kind"
        ],
        "type": "object"
      },
      "ETGBGift": {
        "properties": {
          "country": {
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "prepared": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "GIFT",
              "SAMPLE"
            ],
            "type": "string"
          }
        },
        "required": [
          "fulfillment_id",
          "order_id",
          "order_number",
          "reason",
          "country",
          "prepared",
          "missing"
        ],
        "type": "object"
      },
      "ETGBMail": {
        "properties": {
          "atr_groups": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "atr_to": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array"
          },
          "attach": {
            "enum": [
              "sheet",
              "zip",
              "links"
            ],
            "type": "string"
          },
          "cc": {
            "description": "Copied on the day's ETGB mail, once each, in the Cc header.",
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array"
          },
          "cc_groups": {
            "description": "Address-book groups copied on the day's ETGB mail.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "etgb_groups": {
            "description": "Address-book groups beside the addresses; read when the mail goes out.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "etgb_to": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array"
          },
          "plans": {
            "description": "Further mails of the day's sheet, each to its own people at its own times.",
            "items": {
              "$ref": "#/components/schemas/ETGBMailPlan"
            },
            "maxItems": 10,
            "type": "array"
          },
          "signature": {
            "description": "HTML.",
            "type": "string"
          },
          "subject": {
            "description": "May carry {tarih}, {magaza} and {adet}.",
            "type": "string"
          },
          "times": {
            "items": {
              "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ETGBMailLogEntry": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "day": {
            "format": "date",
            "type": "string"
          },
          "delivery": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "detail": {
            "type": "string"
          },
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "etgb",
              "atr"
            ],
            "type": "string"
          },
          "plan": {
            "description": "The send plan's id; absent for the main mail.",
            "type": "string"
          },
          "recipients": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shipments": {
            "type": "integer"
          },
          "slot": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "skipped",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "day",
          "slot",
          "kind",
          "status",
          "recipients",
          "files",
          "shipments",
          "created_at",
          "delivery"
        ],
        "type": "object"
      },
      "ETGBMailPlan": {
        "properties": {
          "attach": {
            "enum": [
              "sheet",
              "zip",
              "links"
            ],
            "type": "string"
          },
          "cc": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "groups": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "id": {
            "description": "Given by the server when empty.",
            "type": "string"
          },
          "kind": {
            "enum": [
              "etgb",
              "atr"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 60,
            "type": "string"
          },
          "subject": {
            "description": "Empty uses the main mail's subject.",
            "type": "string"
          },
          "times": {
            "items": {
              "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
              "type": "string"
            },
            "type": "array"
          },
          "to": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ETGBRow": {
        "properties": {
          "atr": {
            "type": "boolean"
          },
          "atr_unknown": {
            "type": "boolean"
          },
          "cells": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ETGBCell"
            },
            "type": "object"
          },
          "excluded": {
            "type": "boolean"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "manual": {
            "type": "boolean"
          },
          "missing": {
            "items": {
              "enum": [
                "invoice",
                "label",
                "commercial_invoice"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "prepared": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "manual",
          "excluded",
          "atr",
          "prepared",
          "missing",
          "cells"
        ],
        "type": "object"
      },
      "ETGBSettings": {
        "properties": {
          "atr_countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "atr_currency": {
            "type": "string"
          },
          "atr_threshold_minor": {
            "format": "int64",
            "type": "integer"
          },
          "close_at": {
            "type": "string"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ETGBColumn"
            },
            "type": "array"
          },
          "default_columns": {
            "type": "boolean"
          },
          "default_description": {
            "type": "string"
          },
          "default_hs_code": {
            "type": "string"
          },
          "default_incoterm": {
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ETGBField"
            },
            "type": "array"
          },
          "file_pattern": {
            "description": "{DD}, {MM}, {YYYY}; .xlsx is added.",
            "type": "string"
          },
          "mail": {
            "$ref": "#/components/schemas/ETGBMail"
          },
          "mail_ready": {
            "type": "boolean"
          },
          "sheet_name": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "columns",
          "default_columns",
          "sheet_name",
          "file_pattern",
          "atr_countries",
          "atr_threshold_minor",
          "atr_currency",
          "close_at",
          "mail",
          "fields",
          "mail_ready"
        ],
        "type": "object"
      },
      "ETGBSettingsInput": {
        "properties": {
          "atr_countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "atr_currency": {
            "type": "string"
          },
          "atr_threshold_minor": {
            "format": "int64",
            "type": "integer"
          },
          "close_at": {
            "type": "string"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ETGBColumn"
            },
            "type": "array"
          },
          "default_description": {
            "type": "string"
          },
          "default_hs_code": {
            "type": "string"
          },
          "default_incoterm": {
            "type": "string"
          },
          "file_pattern": {
            "description": "{DD}, {MM}, {YYYY}; .xlsx is added.",
            "type": "string"
          },
          "mail": {
            "$ref": "#/components/schemas/ETGBMail"
          },
          "sheet_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailCampaign": {
        "properties": {
          "audience": {
            "enum": [
              "all",
              "segment"
            ],
            "type": "string"
          },
          "body": {
            "description": "Plain text; {name} becomes the recipient's name.",
            "type": "string"
          },
          "channel": {
            "description": "An SMS campaign has no subject; its text is at most 612 characters.",
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "scheduled_at": {
            "format": "date-time",
            "type": "string"
          },
          "segment_id": {
            "format": "int64",
            "type": "integer"
          },
          "segment_name": {
            "type": "string"
          },
          "sent": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "scheduled",
              "sending",
              "sent",
              "cancelled"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "subject",
          "body",
          "audience",
          "status",
          "sent",
          "skipped",
          "created_at",
          "updated_at",
          "channel"
        ],
        "type": "object"
      },
      "EmailCampaignInput": {
        "properties": {
          "audience": {
            "enum": [
              "all",
              "segment"
            ],
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "segment_id": {
            "format": "int64",
            "type": "integer"
          },
          "subject": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Entitlements": {
        "properties": {
          "limits": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "plan": {
            "type": "string"
          },
          "source": {
            "enum": [
              "snapshot",
              "trial_default"
            ],
            "type": "string"
          },
          "switches": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "version",
          "plan",
          "source",
          "limits",
          "switches"
        ],
        "type": "object"
      },
      "ErasureResult": {
        "properties": {
          "replacement": {
            "description": "The address the store's orders now carry.",
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/PrivacyRequest"
          }
        },
        "required": [
          "request",
          "replacement"
        ],
        "type": "object"
      },
      "ErpConnectorStatus": {
        "properties": {
          "code": {
            "enum": [
              "logo",
              "mikro",
              "netsis"
            ],
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "failing": {
            "items": {
              "$ref": "#/components/schemas/ErpFailingDoc"
            },
            "type": "array"
          },
          "last_sync_at": {
            "format": "date-time",
            "type": "string"
          },
          "pending": {
            "type": "integer"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ErpRun"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "title",
          "enabled",
          "configured",
          "runs",
          "failing",
          "pending"
        ],
        "type": "object"
      },
      "ErpFailingDoc": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "entity": {
            "enum": [
              "customer",
              "order",
              "invoice"
            ],
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          }
        },
        "required": [
          "entity",
          "ref",
          "error",
          "attempts"
        ],
        "type": "object"
      },
      "ErpRun": {
        "properties": {
          "changed": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "failed": {
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "enum": [
              "items",
              "customers",
              "orders",
              "invoices"
            ],
            "type": "string"
          },
          "seen": {
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "ok",
              "partial",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "status",
          "started_at",
          "seen",
          "changed",
          "failed"
        ],
        "type": "object"
      },
      "ErpTestResult": {
        "properties": {
          "error": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "description": "Every failure uses this shape, whatever endpoint produced it.",
        "properties": {
          "error": {
            "properties": {
              "code": {
                "enum": [
                  "not_found",
                  "method_not_allowed",
                  "validation_failed",
                  "conflict",
                  "unauthorized",
                  "not_ready",
                  "internal_error"
                ],
                "type": "string"
              },
              "details": {
                "description": "Structured detail, such as per-line checkout conflicts."
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "type": "object"
      },
      "ExcludedSales": {
        "description": "Placed in the window and not a sale: still in checkout, or cancelled. Reported beside the totals and never inside them, so a figure that disagrees with the Orders list can be explained.",
        "properties": {
          "cancelled": {
            "$ref": "#/components/schemas/SalesSubset"
          },
          "pending": {
            "$ref": "#/components/schemas/SalesSubset"
          }
        },
        "required": [
          "pending",
          "cancelled"
        ],
        "type": "object"
      },
      "ExportLink": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "url": {
            "description": "Path to open, relative to the API origin.",
            "type": "string"
          }
        },
        "required": [
          "url",
          "filename",
          "expires_at"
        ],
        "type": "object"
      },
      "ExportLinkInput": {
        "properties": {
          "format": {
            "enum": [
              "nerocart",
              "shopify"
            ],
            "type": "string"
          },
          "kind": {
            "enum": [
              "products",
              "orders",
              "customers",
              "inventory",
              "categories",
              "sales",
              "refunds",
              "top-products",
              "stock-value",
              "custom-report"
            ],
            "type": "string"
          },
          "params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "FacetPrice": {
        "description": "The span of the matching variants' prices (every filter but the price), minor units; 0 when nothing matches.",
        "properties": {
          "max": {
            "format": "int64",
            "type": "integer"
          },
          "min": {
            "format": "int64",
            "type": "integer"
          },
          "selected_max": {
            "format": "int64",
            "type": "integer"
          },
          "selected_min": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "min",
          "max"
        ],
        "type": "object"
      },
      "FacetToggle": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "selected": {
            "type": "boolean"
          }
        },
        "required": [
          "count",
          "selected"
        ],
        "type": "object"
      },
      "FacetValue": {
        "properties": {
          "color": {
            "description": "A colour value's swatch colour when the store gave one.",
            "pattern": "^#[0-9a-f]{6}$",
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "label": {
            "description": "How the store writes it, in the request's language when translated.",
            "type": "string"
          },
          "selected": {
            "type": "boolean"
          },
          "value": {
            "description": "The key the filter takes back.",
            "type": "string"
          }
        },
        "required": [
          "value",
          "label",
          "count",
          "selected"
        ],
        "type": "object"
      },
      "FocalPoint": {
        "description": "A point in an image as fractions of its width and height: {0,0} the top left corner, {1,1} the bottom right.",
        "properties": {
          "x": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "y": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "x",
          "y"
        ],
        "type": "object"
      },
      "FooterBuilder": {
        "description": "The footer laid out by the merchant (ADR-0071): up to three rows of one to six columns, and the last bar. A visible legal element is required.",
        "properties": {
          "bar": {
            "$ref": "#/components/schemas/FooterBuilderBar"
          },
          "icon_look": {
            "$ref": "#/components/schemas/BuilderIconLook"
          },
          "preset": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/FooterBuilderRow"
            },
            "maxItems": 3,
            "type": "array"
          }
        },
        "type": "object"
      },
      "FooterBuilderBar": {
        "properties": {
          "align": {
            "enum": [
              "spread",
              "start",
              "center"
            ],
            "type": "string"
          },
          "elements": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          },
          "hidden": {
            "type": "boolean"
          },
          "stack": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "FooterBuilderColumn": {
        "properties": {
          "elements": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "FooterBuilderRow": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/FooterBuilderColumn"
            },
            "maxItems": 6,
            "minItems": 1,
            "type": "array"
          },
          "hidden": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "layout": {
            "enum": [
              "",
              "equal",
              "first_wide",
              "last_wide"
            ],
            "type": "string"
          },
          "scheme": {
            "type": "string"
          },
          "width": {
            "enum": [
              "",
              "container",
              "full"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "columns"
        ],
        "type": "object"
      },
      "FraudRule": {
        "properties": {
          "action": {
            "enum": [
              "require_3ds",
              "review",
              "refuse"
            ],
            "type": "string"
          },
          "limit": {
            "description": "Payments an hour; 0 off.",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "FraudRules": {
        "properties": {
          "amount_action": {
            "enum": [
              "",
              "require_3ds",
              "review",
              "refuse"
            ],
            "type": "string"
          },
          "amount_over": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Threshold per currency in minor units.",
            "type": "object"
          },
          "card_per_hour": {
            "$ref": "#/components/schemas/FraudRule"
          },
          "country_mismatch": {
            "enum": [
              "",
              "require_3ds",
              "review",
              "refuse"
            ],
            "type": "string"
          },
          "email_per_hour": {
            "$ref": "#/components/schemas/FraudRule"
          },
          "enabled": {
            "type": "boolean"
          },
          "ip_per_hour": {
            "$ref": "#/components/schemas/FraudRule"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "FreeDesign": {
        "description": "Serbest Tasarım (ADR-0104): areas designed freely in the admin on GrapesJS core. A page document holds its own area (\"home\" for the home page, \"page:\u003cid\u003e\" for another page) in the version's language only; the theme's settings hold the theme areas (header, footer, product, collection, blog, article, search, notfound, cart). An area without an entry is drawn as before (sections, the builder). Every save passes the kernel's checks: the markup re-serialized from an allow-list (no script, event handler, frame other than a YouTube/Vimeo player, form, object, base, meta or link), the CSS rewritten to apply only inside the area's box (.nc-fd-\u003cslug\u003e), the editor's project data rewritten from an allow-list, and every live component (data-live-component) of a known type with references to this store's products, collections, menus and blog (else 400 with details.reason naming the problem). With vb_free_design off nothing new or changed is accepted (details.reason feature_off). The storefront is answered without the project.",
        "properties": {
          "areas": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/FreeDesignEntry"
              },
              "type": "object"
            },
            "description": "Area → language → design.",
            "type": "object"
          },
          "version": {
            "enum": [
              1
            ],
            "type": "integer"
          }
        },
        "required": [
          "version",
          "areas"
        ],
        "type": "object"
      },
      "FreeDesignConversion": {
        "properties": {
          "converted": {
            "description": "The section ids drawn, in order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "css": {
            "description": "Unscoped; the save scopes it.",
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "skipped": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "type",
                "reason"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "html",
          "css",
          "converted"
        ],
        "type": "object"
      },
      "FreeDesignConvertInput": {
        "properties": {
          "area": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "area",
          "language"
        ],
        "type": "object"
      },
      "FreeDesignEntry": {
        "description": "One area's design in one language. At most 640 KiB of project, 256 KiB of markup, 128 KiB of CSS, 900 KiB together.",
        "properties": {
          "css": {
            "description": "The area's CSS, scoped to its box.",
            "type": "string"
          },
          "html": {
            "description": "The sanitized markup the storefront draws; live components are drawn from the store's data.",
            "type": "string"
          },
          "project": {
            "additionalProperties": true,
            "description": "GrapesJS project data, re-loaded by the editor (not in the storefront's answer).",
            "type": "object"
          }
        },
        "required": [
          "html",
          "css"
        ],
        "type": "object"
      },
      "FreeDesignStarter": {
        "properties": {
          "area": {
            "description": "The area it is made for; page stands for every page:\u003cid\u003e.",
            "type": "string"
          },
          "category": {
            "description": "The set's kind of store, in the language asked.",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "preview": {
            "description": "The storefront path of its 960×600 picture.",
            "type": "string"
          },
          "set": {
            "description": "The design set it belongs to (its id is \u003cset\u003e-\u003carea\u003e): applied together with the set's other starters.",
            "type": "string"
          },
          "set_name": {
            "description": "The set's name, in the language asked.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "area",
          "name",
          "description",
          "preview"
        ],
        "type": "object"
      },
      "FreeDesignStarterDesign": {
        "allOf": [
          {
            "$ref": "#/components/schemas/FreeDesignStarter"
          },
          {
            "properties": {
              "design": {
                "$ref": "#/components/schemas/FreeDesignEntry"
              }
            },
            "required": [
              "design"
            ],
            "type": "object"
          }
        ]
      },
      "Fulfillment": {
        "properties": {
          "awaiting_pickup": {
            "description": "A shipment a carrier module booked that the carrier has not scanned yet: the label and papers are ready, the courier has not taken the parcel. The shopper hears it left at the first scan (fulfillment.picked_up).",
            "type": "boolean"
          },
          "cancel_before": {
            "description": "When the carrier stops accepting a cancellation.",
            "format": "date-time",
            "type": "string"
          },
          "carrier": {
            "description": "Who is carrying the parcel, as a carrier code. A different fact from the provider that booked it.",
            "type": "string"
          },
          "carrier_name": {
            "description": "The carrier's display name, derived from its code on the way out.",
            "type": "string"
          },
          "cod": {
            "$ref": "#/components/schemas/FulfillmentCOD"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "description": "When the parcel was handed over, from the carrier's tracking or an operator (marking the whole order delivered stamps its parcels too). The withdrawal period runs from it.",
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "description": "Why a carrier booking failed.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label_url": {
            "type": "string"
          },
          "lines": {
            "description": "What went in this parcel. Empty on a shipment recorded before shipments named their contents.",
            "items": {
              "$ref": "#/components/schemas/FulfillmentLine"
            },
            "type": "array"
          },
          "location_id": {
            "description": "The location it left from (M6).",
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "parcels": {
            "description": "Its boxes, one when it went as a single parcel; each label is at /fulfillments/{id}/labels/{position}.",
            "items": {
              "$ref": "#/components/schemas/FulfillmentParcel"
            },
            "type": "array"
          },
          "picked_up_at": {
            "description": "The carrier's first scan of a booked parcel.",
            "format": "date-time",
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_reference": {
            "description": "The carrier's own id for the booking. Not shown to guests.",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "shipped",
              "delivered",
              "failed_delivery",
              "cancelled",
              "failed"
            ],
            "type": "string"
          },
          "tracking": {
            "type": "string"
          },
          "tracking_detail": {
            "type": "string"
          },
          "tracking_state": {
            "description": "The carrier's latest word on the parcel, finer than status.",
            "enum": [
              "in_transit",
              "out_for_delivery",
              "delivered",
              "failed_delivery",
              "returned_to_sender",
              "exception"
            ],
            "type": "string"
          },
          "tracking_updated_at": {
            "description": "When the carrier last said so: its own time for the event when it gives one.",
            "format": "date-time",
            "type": "string"
          },
          "tracking_url": {
            "description": "Where to follow the parcel, derived from the carrier and the number on the way out and never stored.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "FulfillmentCOD": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "method": {
            "enum": [
              "cash",
              "card"
            ],
            "type": "string"
          },
          "remitted_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "collected",
              "remitted",
              "mismatch"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "FulfillmentLine": {
        "description": "How much of one order line went in one parcel. The sku, title and label are joined in on the way out, because the row itself stores an id and a count.",
        "properties": {
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "FulfillmentParcel": {
        "properties": {
          "label_url": {
            "type": "string"
          },
          "position": {
            "description": "1-based box number.",
            "type": "integer"
          },
          "tracking": {
            "type": "string"
          },
          "weight_grams": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "position"
        ],
        "type": "object"
      },
      "FulfillmentPatch": {
        "description": "Only the keys present are written. Changing the tracking number re-identifies the carrier, because the stored one described the old number; an explicit `carrier` in the same request wins over that.",
        "properties": {
          "carrier": {
            "description": "A code from GET /api/admin/carriers, or empty.",
            "type": "string"
          },
          "tracking": {
            "description": "Empty clears it.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "FunnelReport": {
        "properties": {
          "days": {
            "type": "integer"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/FunnelStep"
            },
            "type": "array"
          }
        },
        "required": [
          "days",
          "steps"
        ],
        "type": "object"
      },
      "FunnelStep": {
        "properties": {
          "of_previous": {
            "type": "number"
          },
          "of_visits": {
            "type": "number"
          },
          "sessions": {
            "type": "integer"
          },
          "step": {
            "enum": [
              "visits",
              "product",
              "cart",
              "checkout",
              "order"
            ],
            "type": "string"
          }
        },
        "required": [
          "step",
          "sessions",
          "of_visits",
          "of_previous"
        ],
        "type": "object"
      },
      "GiftCard": {
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/Money"
          },
          "code": {
            "description": "Only on the answer that issued the card.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "initial": {
            "$ref": "#/components/schemas/Money"
          },
          "kind": {
            "description": "credit: a customer's store credit (0183), applied from their account without the code.",
            "enum": [
              "gift",
              "credit"
            ],
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "owner_email": {
            "description": "The customer a store credit belongs to.",
            "type": "string"
          },
          "recipient_email": {
            "type": "string"
          },
          "recipient_name": {
            "type": "string"
          },
          "source_order_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/GiftCardTransaction"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "last4",
          "currency",
          "initial",
          "balance",
          "status",
          "recipient_email",
          "recipient_name",
          "message",
          "note",
          "created_at",
          "updated_at",
          "kind"
        ],
        "type": "object"
      },
      "GiftCardBalance": {
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/Money"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "disabled",
              "expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "last4",
          "balance",
          "status"
        ],
        "type": "object"
      },
      "GiftCardCodeInput": {
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "GiftCardInput": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "credit": {
            "description": "Make it the recipient's store credit: theirs, applied from their account at checkout. Needs recipient_email.",
            "type": "boolean"
          },
          "currency": {
            "description": "Empty: the store's currency.",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "recipient_email": {
            "type": "string"
          },
          "recipient_name": {
            "type": "string"
          },
          "send": {
            "type": "boolean"
          }
        },
        "required": [
          "amount_minor"
        ],
        "type": "object"
      },
      "GiftCardPatch": {
        "properties": {
          "adjust_minor": {
            "format": "int64",
            "type": "integer"
          },
          "adjust_note": {
            "type": "string"
          },
          "clear_expiry": {
            "type": "boolean"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "GiftCardTransaction": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "issue",
              "redeem",
              "restore",
              "adjust"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "kind",
          "amount",
          "note",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "GiftSettings": {
        "properties": {
          "enabled": {
            "description": "Show the gift switch on the order page and the new order screen.",
            "type": "boolean"
          },
          "skip_invoice": {
            "description": "Keep automatic invoicing off gift orders; an invoice by hand is still possible.",
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "skip_invoice"
        ],
        "type": "object"
      },
      "GlobalButtonStyle": {
        "properties": {
          "fill": {
            "enum": [
              "solid",
              "outline"
            ],
            "type": "string"
          },
          "shape": {
            "enum": [
              "square",
              "rounded",
              "pill"
            ],
            "type": "string"
          },
          "size": {
            "enum": [
              "s",
              "m",
              "l"
            ],
            "type": "string"
          },
          "transform": {
            "enum": [
              "none",
              "uppercase",
              "lowercase",
              "capitalize"
            ],
            "type": "string"
          },
          "weight": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "GlobalColor": {
        "properties": {
          "id": {
            "pattern": "^global-[1-8]$",
            "type": "string"
          },
          "name": {
            "maxLength": 40,
            "type": "string"
          },
          "value": {
            "description": "#rrggbb",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "value"
        ],
        "type": "object"
      },
      "GlobalSpace": {
        "properties": {
          "gap": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DeviceInts"
              }
            ],
            "description": "The gap between a free layout's items (0 … 80 px, steps of 4)."
          },
          "section": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DeviceInts"
              }
            ],
            "description": "The room above and below every free layout (0 … 200 px, steps of 4)."
          }
        },
        "type": "object"
      },
      "GlobalTextStyle": {
        "properties": {
          "font": {
            "description": "The theme's heading or body family.",
            "enum": [
              "heading",
              "body"
            ],
            "type": "string"
          },
          "line_height": {
            "description": "Tenths: 10 … 20.",
            "type": "integer"
          },
          "size": {
            "$ref": "#/components/schemas/DeviceInts"
          },
          "tracking": {
            "description": "Hundredths of an em: −5 … 15.",
            "type": "integer"
          },
          "transform": {
            "enum": [
              "none",
              "uppercase",
              "lowercase",
              "capitalize"
            ],
            "type": "string"
          },
          "weight": {
            "description": "300 … 800 in steps of 100.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "GlobalUse": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "page_id",
          "kind",
          "slug",
          "name",
          "language",
          "status"
        ],
        "type": "object"
      },
      "GlossaryCheckInput": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/GlossaryField"
            },
            "maxItems": 500,
            "type": "array"
          },
          "language": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GlossaryField": {
        "properties": {
          "field": {
            "type": "string"
          },
          "source": {
            "description": "The default-language text.",
            "type": "string"
          },
          "translation": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GlossaryRule": {
        "description": "One rule of the store's translation glossary (advisory).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "protected: source_term stays unchanged in every translation; preferred: where the source has source_term, the translation into language uses target_term; forbidden: a translation into language never contains target_term (only where the source has source_term, when given).",
            "enum": [
              "protected",
              "preferred",
              "forbidden"
            ],
            "type": "string"
          },
          "language": {
            "description": "The target language; empty means every language (protected terms only).",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "source_term": {
            "type": "string"
          },
          "target_term": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GlossaryRuleInput": {
        "properties": {
          "kind": {
            "enum": [
              "protected",
              "preferred",
              "forbidden"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "note": {
            "maxLength": 500,
            "type": "string"
          },
          "source_term": {
            "maxLength": 200,
            "type": "string"
          },
          "target_term": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "GlossaryWarning": {
        "properties": {
          "expected": {
            "description": "The preferred translation (preferred rules only).",
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "protected",
              "preferred",
              "forbidden"
            ],
            "type": "string"
          },
          "rule_id": {
            "format": "int64",
            "type": "integer"
          },
          "term": {
            "description": "The protected or preferred source term, or the forbidden target term.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleAdsConversionCheck": {
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/GoogleAdsConversionCheckAction"
            },
            "type": "array"
          },
          "add_to_cart_biddable": {
            "description": "Whether the account's add-to-cart website goal counts for bidding; null when unknown.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "ads_id": {
            "description": "The AW- id the storefront's tags carry.",
            "type": "string"
          },
          "campaign_goals_not_biddable": {
            "description": "Campaign goals (campaigns on their own goal list) that leave purchase or add to cart out of bidding.",
            "type": "integer"
          },
          "container": {
            "description": "The store's Tag Manager container, when it has one.",
            "type": "string"
          },
          "customer": {
            "description": "The Google Ads customer, dashed (123-456-7890).",
            "type": "string"
          },
          "delivery": {
            "description": "How the storefront reports the conversions: the Google tag directly, the Tag Manager container, or not yet.",
            "enum": [
              "direct",
              "container",
              "none"
            ],
            "type": "string"
          },
          "last_order_at": {
            "description": "When the latest paid order was placed (UTC).",
            "type": "string"
          },
          "orders_30d": {
            "description": "NeroCart's own record: paid orders in the last 30 days.",
            "format": "int64",
            "type": "integer"
          },
          "purchase_biddable": {
            "description": "Whether the account's purchase website goal counts for bidding; null when unknown.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "stats_readable": {
            "description": "False when Google refused the conversion numbers; the statuses are still shown.",
            "type": "boolean"
          },
          "value_mode": {
            "description": "dynamic: each conversion carries its own value.",
            "type": "string"
          }
        },
        "required": [
          "customer",
          "actions",
          "stats_readable",
          "campaign_goals_not_biddable",
          "delivery",
          "orders_30d",
          "value_mode"
        ],
        "type": "object"
      },
      "GoogleAdsConversionCheckAction": {
        "properties": {
          "category": {
            "type": "string"
          },
          "conversions_30d": {
            "type": "number"
          },
          "label": {
            "description": "The conversion label, from the action's own tag snippet.",
            "type": "string"
          },
          "last_conversion_date": {
            "description": "YYYY-MM-DD of the latest day Google counted a conversion in the last 30 days; empty when none or unreadable.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "description": "purchase or add_to_cart for the action the storefront's tags report to; other for any further purchase or add-to-cart action.",
            "type": "string"
          },
          "status": {
            "description": "The action's status at Google (ENABLED, HIDDEN).",
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "role",
          "name",
          "category",
          "type",
          "status",
          "conversions_30d"
        ],
        "type": "object"
      },
      "GoogleMerchantAccounts": {
        "properties": {
          "accounts": {
            "items": {
              "properties": {
                "accountId": {
                  "type": "string"
                },
                "accountName": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "selected": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleMerchantAuditEntry": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "action": {
            "enum": [
              "google.merchant.oauth_started",
              "google.merchant.oauth_connected",
              "google.merchant.registration_started",
              "google.merchant.registration_completed",
              "google.merchant.registration_failed",
              "google.merchant.service_account_tested",
              "google.merchant.service_account_granted"
            ],
            "type": "string"
          },
          "actorId": {
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "errorCode": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "status": {
            "description": "A status word. For google.merchant.service_account_granted: created, updated or unchanged, with +verified when the run verified a PENDING user, +verify_failed when verifySelf failed, or failed.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleMerchantAuthorization": {
        "properties": {
          "authorizationUrl": {
            "format": "uri",
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleMerchantConnection": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "apiDeveloper": {
            "type": "boolean"
          },
          "connectedAt": {
            "format": "date-time",
            "type": "string"
          },
          "connectedBy": {
            "format": "int64",
            "type": "integer"
          },
          "gcpIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "lastError": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "owned",
              "merchant"
            ],
            "type": "string"
          },
          "registrationStatus": {
            "enum": [
              "not_started",
              "pending",
              "completed",
              "failed",
              "not_applicable"
            ],
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleMerchantGoogleError": {
        "description": "Google's own answer to the call that failed. The message and the status are sanitized: they never carry a token, a code, a secret or key material.",
        "properties": {
          "code": {
            "description": "The normalized code (UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code).",
            "type": "string"
          },
          "httpStatus": {
            "description": "The HTTP status Google answered (absent when Google could not be reached).",
            "type": "integer"
          },
          "message": {
            "description": "Google's message, sanitized and bounded.",
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "status": {
            "description": "Google's status word, e.g. PERMISSION_DENIED or invalid_grant.",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "GoogleMerchantRegistration": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "apiDeveloper": {
            "type": "boolean"
          },
          "errorCode": {
            "type": "string"
          },
          "gcpIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "google": {
            "$ref": "#/components/schemas/GoogleMerchantGoogleError"
          },
          "registered": {
            "type": "boolean"
          },
          "registrationStatus": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "GoogleMerchantServiceAccountGrant": {
        "properties": {
          "accessRights": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "accountId": {
            "type": "string"
          },
          "action": {
            "enum": [
              "created",
              "updated",
              "unchanged"
            ],
            "type": "string"
          },
          "serviceAccountEmail": {
            "type": "string"
          },
          "state": {
            "description": "The user's state as Google reports it (after verifySelf when it ran), e.g. VERIFIED or PENDING.",
            "type": "string"
          },
          "verified": {
            "description": "True when Google reports the user VERIFIED: already, or after this run called users/me:verifySelf with the service account's own token.",
            "type": "boolean"
          }
        },
        "required": [
          "action",
          "accountId",
          "serviceAccountEmail",
          "verified",
          "accessRights"
        ],
        "type": "object"
      },
      "GoogleMerchantServiceAccountTest": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "accountName": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "serviceAccountEmail": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleMerchantStatus": {
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/GoogleMerchantConnection"
            },
            "type": "array"
          },
          "developerEmail": {
            "type": "string"
          },
          "expectedProjectNumber": {
            "type": "string"
          },
          "ownedAccountId": {
            "type": "string"
          },
          "ownedConfigured": {
            "type": "boolean"
          },
          "ownerTenant": {
            "type": "boolean"
          },
          "serviceAccount": {
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "lastTest": {
                "$ref": "#/components/schemas/GoogleMerchantAuditEntry"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "GoogleServicesActor": {
        "properties": {
          "id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "operator",
              "platform",
              "token",
              "system"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "GoogleServicesApproveInput": {
        "properties": {
          "hash": {
            "description": "The plan's plan_hash.",
            "type": "string"
          }
        },
        "required": [
          "hash"
        ],
        "type": "object"
      },
      "GoogleServicesAudit": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesAuditEntry"
            },
            "type": "array"
          },
          "writes": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesBindingWrite"
            },
            "type": "array"
          }
        },
        "required": [
          "entries",
          "writes"
        ],
        "type": "object"
      },
      "GoogleServicesAuditEntry": {
        "properties": {
          "action": {
            "type": "string"
          },
          "actor": {
            "$ref": "#/components/schemas/GoogleServicesActor"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "operation_id": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "action",
          "actor",
          "created_at"
        ],
        "type": "object"
      },
      "GoogleServicesBinding": {
        "properties": {
          "connection_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "$ref": "#/components/schemas/GoogleServicesActor"
          },
          "detail": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "external_path": {
            "type": "string"
          },
          "facts": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_checked_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "last_synced_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "operation_id": {
            "type": "string"
          },
          "provenance": {
            "type": "string"
          },
          "service": {
            "enum": [
              "search_console",
              "site_verification",
              "tag_manager",
              "analytics",
              "ads",
              "merchant",
              "gmail",
              "adsense",
              "business_profile"
            ],
            "type": "string"
          },
          "settings_ref": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesSettingRef"
            },
            "type": "array"
          },
          "status": {
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "store_id",
          "service",
          "external_id",
          "settings_ref",
          "provenance",
          "status",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "GoogleServicesBindingWrite": {
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/GoogleServicesActor"
          },
          "binding_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "new_value": {
            "type": "string"
          },
          "operation_id": {
            "type": "string"
          },
          "plugin": {
            "type": "string"
          },
          "previous_value": {
            "type": "string"
          },
          "provenance": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "service": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "service",
          "plugin",
          "field",
          "previous_value",
          "new_value",
          "provenance",
          "actor",
          "operation_id",
          "created_at"
        ],
        "type": "object"
      },
      "GoogleServicesBoundField": {
        "properties": {
          "current": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "plugin": {
            "type": "string"
          }
        },
        "required": [
          "plugin",
          "field",
          "current"
        ],
        "type": "object"
      },
      "GoogleServicesCandidate": {
        "properties": {
          "access": {
            "type": "string"
          },
          "detail": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "domain": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "match": {
            "enum": [
              "exact",
              "partial",
              "none"
            ],
            "type": "string"
          },
          "note_code": {
            "description": "detail.note as a stable message code (GoogleServicesMessage).",
            "type": "string"
          },
          "note_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "path": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "title_code": {
            "description": "title as a stable message code when the title carries words of the module's own (\"Analytics account …\"); absent for a bare Google name.",
            "type": "string"
          },
          "title_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          }
        },
        "required": [
          "id",
          "match"
        ],
        "type": "object"
      },
      "GoogleServicesCapabilities": {
        "additionalProperties": {
          "$ref": "#/components/schemas/GoogleServicesCapability"
        },
        "description": "The support matrix row: DISCOVER, CREATE, CONFIGURE, VERIFY, BIND_TO_NEROCART, ACTIVATE, SYNC.",
        "type": "object"
      },
      "GoogleServicesCapability": {
        "properties": {
          "code": {
            "description": "reason as a stable message code, where a screen shows the reason (readiness, an unsupported service).",
            "type": "string"
          },
          "level": {
            "enum": [
              "SUPPORTED",
              "PREREQUISITE_REQUIRED",
              "HUMAN_ACTION_REQUIRED",
              "UNSUPPORTED"
            ],
            "type": "string"
          },
          "params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "description": "Official source ids (G01–G19).",
            "type": "string"
          }
        },
        "required": [
          "level",
          "reason"
        ],
        "type": "object"
      },
      "GoogleServicesCatalogEntry": {
        "properties": {
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "apis": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "available": {
            "type": "boolean"
          },
          "batch": {
            "type": "integer"
          },
          "capabilities": {
            "$ref": "#/components/schemas/GoogleServicesCapabilities"
          },
          "id": {
            "type": "string"
          },
          "scopes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "scopes",
          "apis",
          "batch",
          "available",
          "capabilities"
        ],
        "type": "object"
      },
      "GoogleServicesChoice": {
        "properties": {
          "candidate_id": {
            "type": "string"
          },
          "create": {
            "type": "boolean"
          },
          "options": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "GoogleServicesConnection": {
        "description": "A connected Google account. Never carries a token.",
        "properties": {
          "connected_at": {
            "format": "date-time",
            "type": "string"
          },
          "connected_by": {
            "$ref": "#/components/schemas/GoogleServicesActor"
          },
          "email": {
            "description": "Display only.",
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "granted_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "issuer": {
            "type": "string"
          },
          "last_checked_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "last_error": {
            "type": "string"
          },
          "last_refreshed_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "scope_type": {
            "enum": [
              "platform",
              "store"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "healthy",
              "reauth_required",
              "revoked",
              "disconnected"
            ],
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "subject": {
            "description": "The stable Google account id; issuer + subject is the identity.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "scope_type",
          "store_id",
          "issuer",
          "subject",
          "email",
          "email_verified",
          "granted_scopes",
          "status",
          "connected_by",
          "connected_at",
          "updated_at"
        ],
        "type": "object"
      },
      "GoogleServicesDisconnectInput": {
        "properties": {
          "revoke": {
            "description": "Also revoke the grant at Google (affects every connection of the same account).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "GoogleServicesDisconnectOutput": {
        "properties": {
          "affected": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesConnection"
            },
            "type": "array"
          },
          "connection": {
            "$ref": "#/components/schemas/GoogleServicesConnection"
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "required": [
          "connection",
          "revoked",
          "affected"
        ],
        "type": "object"
      },
      "GoogleServicesDiscoverInput": {
        "properties": {
          "connection_id": {
            "format": "int64",
            "type": "integer"
          },
          "services": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "services"
        ],
        "type": "object"
      },
      "GoogleServicesDiscovery": {
        "properties": {
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesCandidate"
            },
            "type": "array"
          },
          "complete": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          },
          "detail_code": {
            "description": "detail as a stable message code (GoogleServicesMessage).",
            "type": "string"
          },
          "detail_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "missing_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "service": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "suggested": {
            "type": "string"
          }
        },
        "required": [
          "service",
          "status",
          "complete",
          "candidates"
        ],
        "type": "object"
      },
      "GoogleServicesExternalAction": {
        "properties": {
          "code": {
            "description": "description as a stable message code (GoogleServicesMessage).",
            "type": "string"
          },
          "cost": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "publishing": {
            "type": "boolean"
          },
          "target": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The resources the action acts on, as planned (e.g. a link's Google Ads customer_id and login_customer_id); bound into the plan hash.",
            "type": "object"
          }
        },
        "required": [
          "key",
          "description"
        ],
        "type": "object"
      },
      "GoogleServicesFieldWrite": {
        "properties": {
          "current": {
            "description": "The value at plan time; apply refuses to overwrite a field that moved.",
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "plugin": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "plugin",
          "field",
          "value",
          "current"
        ],
        "type": "object"
      },
      "GoogleServicesGmailInbox": {
        "properties": {
          "enabled": {
            "description": "email-gmail.inbox is on (set only by an approved gmail_inbox option).",
            "type": "boolean"
          },
          "last_sync_at": {
            "format": "date-time",
            "type": "string"
          },
          "mailbox": {
            "type": "string"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesGmailInboxMessage"
            },
            "type": "array"
          },
          "retention_days": {
            "type": "integer"
          },
          "status": {
            "description": "watching, off, or why not (renew_failed:CODE, needs_consent, reauth_required, mailbox_mismatch, not_configured).",
            "type": "string"
          },
          "watch_expires_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "status",
          "retention_days",
          "messages"
        ],
        "type": "object"
      },
      "GoogleServicesGmailInboxMessage": {
        "properties": {
          "date": {
            "format": "date-time",
            "type": "string"
          },
          "from_address": {
            "type": "string"
          },
          "from_name": {
            "description": "Untrusted header text (cleaned, plain text).",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "match": {
            "$ref": "#/components/schemas/GoogleServicesInboxMatch"
          },
          "open_url": {
            "description": "https://mail.google.com/mail/u/?authuser=\u003cmailbox\u003e#all/\u003cthreadId\u003e",
            "type": "string"
          },
          "received_at": {
            "format": "date-time",
            "type": "string"
          },
          "subject": {
            "description": "Untrusted header text (cleaned, plain text).",
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "thread_id",
          "from_name",
          "from_address",
          "subject",
          "labels",
          "received_at"
        ],
        "type": "object"
      },
      "GoogleServicesGmailTestInput": {
        "properties": {
          "confirm": {
            "description": "The operator confirmed the recipient; required.",
            "type": "boolean"
          },
          "to": {
            "description": "The recipient the operator sees; must be their own address.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GoogleServicesGmailTestResult": {
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "accepted",
          "to",
          "from"
        ],
        "type": "object"
      },
      "GoogleServicesGoogleError": {
        "properties": {
          "code": {
            "type": "string"
          },
          "httpStatus": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "GoogleServicesInboxMatch": {
        "properties": {
          "customer_id": {
            "description": "The store's customer record with this address, when there is one.",
            "format": "int64",
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "last_order_id": {
            "format": "int64",
            "type": "integer"
          },
          "last_order_number": {
            "type": "string"
          },
          "orders": {
            "description": "Orders placed with this address.",
            "type": "integer"
          }
        },
        "required": [
          "email",
          "orders"
        ],
        "type": "object"
      },
      "GoogleServicesMessage": {
        "description": "An explanation the screens show, as a stable machine code, its parameters and the English text the API has always carried. A screen words the code in its own language and falls back to the text for a code it does not know. The codes and their English templates are kernel/ext/google-services/messages.go (exported to testdata/message_codes.json).",
        "properties": {
          "code": {
            "description": "Stable message code, e.g. card.connect_account. Empty for a text stored before codes existed.",
            "type": "string"
          },
          "params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "text": {
            "description": "The English text.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "text"
        ],
        "type": "object"
      },
      "GoogleServicesOverview": {
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesConnection"
            },
            "type": "array"
          },
          "latest_plan": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesPlan"
              }
            ]
          },
          "latest_run": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesRun"
              }
            ]
          },
          "readiness": {
            "$ref": "#/components/schemas/GoogleServicesReadiness"
          },
          "services": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesServiceCard"
            },
            "type": "array"
          },
          "store": {
            "$ref": "#/components/schemas/GoogleServicesStoreFacts"
          }
        },
        "required": [
          "configured",
          "store",
          "connections",
          "services",
          "readiness"
        ],
        "type": "object"
      },
      "GoogleServicesPlan": {
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/GoogleServicesActor"
          },
          "approved_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "approved_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesActor"
              }
            ]
          },
          "connection_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesPlanItem"
            },
            "type": "array"
          },
          "mode": {
            "type": "string"
          },
          "options": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "plan_hash": {
            "description": "The approval must name it exactly.",
            "type": "string"
          },
          "prerequisite_details": {
            "description": "prerequisites, one for one, as messages with codes (an entry of a plan stored before codes existed has an empty code).",
            "items": {
              "$ref": "#/components/schemas/GoogleServicesMessage"
            },
            "type": "array"
          },
          "prerequisites": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "services": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source_hash": {
            "type": "string"
          },
          "source_version": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "approved",
              "running",
              "done",
              "partial",
              "failed",
              "superseded"
            ],
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "store_id",
          "actor",
          "mode",
          "services",
          "options",
          "items",
          "prerequisites",
          "source_hash",
          "source_version",
          "plan_hash",
          "status",
          "created_at",
          "updated_at",
          "prerequisite_details"
        ],
        "type": "object"
      },
      "GoogleServicesPlanInput": {
        "properties": {
          "choices": {
            "additionalProperties": {
              "$ref": "#/components/schemas/GoogleServicesChoice"
            },
            "type": "object"
          },
          "connection_id": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "bind_existing",
              "create_missing",
              "verify_sync"
            ],
            "type": "string"
          },
          "options": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Explicit switches: place_tags, publish_version, use_as_sender, sync_products, submit_sitemap, use_gtm, domain_property, claim_homepage, conversion_tracking, link_ga4_ads, link_merchant_ads, gmail_inbox. Absent means no.",
            "type": "object"
          },
          "services": {
            "description": "Service ids, titles or aliases (\"Webmaster Tools\" is Search Console).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "mode",
          "services"
        ],
        "type": "object"
      },
      "GoogleServicesPlanItem": {
        "properties": {
          "account": {
            "type": "string"
          },
          "action": {
            "enum": [
              "bind",
              "create",
              "verify",
              "configure",
              "none",
              "unsupported"
            ],
            "type": "string"
          },
          "candidate": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesCandidate"
              }
            ]
          },
          "external": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesExternalAction"
            },
            "type": "array"
          },
          "options": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "prerequisite_details": {
            "description": "prerequisites, one for one, as messages with codes.",
            "items": {
              "$ref": "#/components/schemas/GoogleServicesMessage"
            },
            "type": "array"
          },
          "prerequisites": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reason": {
            "type": "string"
          },
          "reason_code": {
            "description": "reason as a stable message code (GoogleServicesMessage).",
            "type": "string"
          },
          "reason_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "service": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "writes": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesFieldWrite"
            },
            "type": "array"
          }
        },
        "required": [
          "service",
          "action",
          "status",
          "writes",
          "external"
        ],
        "type": "object"
      },
      "GoogleServicesPlanView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GoogleServicesPlan"
          },
          {
            "properties": {
              "run": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GoogleServicesRun"
                  }
                ]
              }
            },
            "type": "object"
          }
        ]
      },
      "GoogleServicesReadiness": {
        "description": "The one-time OAuth preparation diagnostic. Nothing here configures a client.",
        "properties": {
          "app_verification": {
            "$ref": "#/components/schemas/GoogleServicesCapability"
          },
          "callback_path": {
            "type": "string"
          },
          "client_configured": {
            "type": "boolean"
          },
          "cloud_apis": {
            "$ref": "#/components/schemas/GoogleServicesCapability"
          },
          "connections": {
            "type": "integer"
          },
          "consent_screen": {
            "$ref": "#/components/schemas/GoogleServicesCapability"
          },
          "redirect_uri": {
            "type": "string"
          },
          "services": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesReadinessService"
            },
            "type": "array"
          }
        },
        "required": [
          "client_configured",
          "redirect_uri",
          "callback_path",
          "connections",
          "services",
          "consent_screen",
          "app_verification",
          "cloud_apis"
        ],
        "type": "object"
      },
      "GoogleServicesReadinessService": {
        "properties": {
          "apis": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "batch": {
            "type": "integer"
          },
          "scopes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object"
          },
          "service": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "service",
          "title",
          "batch",
          "scopes",
          "apis"
        ],
        "type": "object"
      },
      "GoogleServicesRun": {
        "properties": {
          "attempt": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "idempotency_key": {
            "type": "string"
          },
          "job_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": "string"
          },
          "plan_id": {
            "format": "int64",
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "done",
              "partial",
              "failed"
            ],
            "type": "string"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesStep"
            },
            "type": "array"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "store_id",
          "plan_id",
          "idempotency_key",
          "status",
          "attempt",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "GoogleServicesServiceCard": {
        "properties": {
          "aliases": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "apis": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "available": {
            "description": "A provider for this service exists in this build.",
            "type": "boolean"
          },
          "batch": {
            "type": "integer"
          },
          "binding": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesBinding"
              }
            ]
          },
          "bound_fields": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesBoundField"
            },
            "type": "array"
          },
          "capabilities": {
            "$ref": "#/components/schemas/GoogleServicesCapabilities"
          },
          "external_url": {
            "type": "string"
          },
          "last_checked_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "missing_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "needed_action": {
            "type": "string"
          },
          "needed_action_code": {
            "description": "needed_action as a stable message code (GoogleServicesMessage); absent when nothing is needed.",
            "type": "string"
          },
          "needed_action_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "scopes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object"
          },
          "service": {
            "enum": [
              "search_console",
              "site_verification",
              "tag_manager",
              "analytics",
              "ads",
              "merchant",
              "gmail",
              "adsense",
              "business_profile"
            ],
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "service",
          "title",
          "batch",
          "available",
          "status",
          "needed_action",
          "bound_fields",
          "scopes",
          "apis",
          "capabilities"
        ],
        "type": "object"
      },
      "GoogleServicesServiceDiscovery": {
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/GoogleServicesCapabilities"
          },
          "discovery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesDiscovery"
              }
            ]
          },
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GoogleServicesGoogleError"
              }
            ]
          },
          "service": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "service",
          "title",
          "capabilities"
        ],
        "type": "object"
      },
      "GoogleServicesSettingRef": {
        "properties": {
          "field": {
            "type": "string"
          },
          "plugin": {
            "type": "string"
          }
        },
        "required": [
          "plugin",
          "field"
        ],
        "type": "object"
      },
      "GoogleServicesStartInput": {
        "properties": {
          "connection_id": {
            "description": "Re-authorize or widen an existing connection (same account required).",
            "format": "int64",
            "type": "integer"
          },
          "levels": {
            "description": "Scope levels; default read + write. publish (GTM publish, Gmail send) and inbox (Gmail's restricted gmail.metadata, for the gmail_inbox option) only when asked.",
            "items": {
              "enum": [
                "read",
                "write",
                "publish",
                "inbox"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "return_path": {
            "description": "Where the callback sends the operator: a path under /admin/ or /control/.",
            "type": "string"
          },
          "services": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "services"
        ],
        "type": "object"
      },
      "GoogleServicesStartOutput": {
        "properties": {
          "authorizationUrl": {
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "purpose": {
            "enum": [
              "connect",
              "reauthorize",
              "incremental"
            ],
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "authorizationUrl",
          "expiresAt",
          "scopes",
          "purpose"
        ],
        "type": "object"
      },
      "GoogleServicesStep": {
        "properties": {
          "action": {
            "type": "string"
          },
          "attempt": {
            "type": "integer"
          },
          "depends_on": {
            "type": "string"
          },
          "external_result": {},
          "finished_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "idempotency_key": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_error_code": {
            "description": "last_error as a stable message code (GoogleServicesMessage); absent for a step journaled before codes existed.",
            "type": "string"
          },
          "last_error_params": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The code's parameters, by name (the {name} placeholders of its template).",
            "type": "object"
          },
          "local_result": {},
          "operation_id": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "run_id": {
            "format": "int64",
            "type": "integer"
          },
          "service": {
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "running",
              "done",
              "skipped",
              "waiting",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "run_id",
          "key",
          "service",
          "action",
          "status",
          "attempt",
          "operation_id",
          "idempotency_key"
        ],
        "type": "object"
      },
      "GoogleServicesStepResult": {
        "properties": {
          "detail": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "external_id": {
            "type": "string"
          },
          "external_path": {
            "type": "string"
          },
          "operation_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "writes": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesFieldWrite"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "GoogleServicesStoreFacts": {
        "properties": {
          "canonical_url": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "hosts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "language": {
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "legal_name": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "primary_host": {
            "type": "string"
          },
          "sitemap_url": {
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "tenant_id",
          "store_id",
          "name",
          "primary_host",
          "canonical_url",
          "hosts",
          "country",
          "language",
          "languages",
          "currency",
          "timezone"
        ],
        "type": "object"
      },
      "GoogleServicesSyncResult": {
        "properties": {
          "binding": {
            "$ref": "#/components/schemas/GoogleServicesBinding"
          },
          "result": {
            "$ref": "#/components/schemas/GoogleServicesStepResult"
          },
          "written": {
            "items": {
              "$ref": "#/components/schemas/GoogleServicesSettingRef"
            },
            "type": "array"
          }
        },
        "required": [
          "binding",
          "result",
          "written"
        ],
        "type": "object"
      },
      "GroupMembersInput": {
        "description": "Addresses as pasted or one CSV column: entries may hold several separated by commas, semicolons, spaces or new lines.",
        "properties": {
          "emails": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "remove": {
            "type": "boolean"
          }
        },
        "required": [
          "emails"
        ],
        "type": "object"
      },
      "GroupMembersResult": {
        "properties": {
          "changed": {
            "type": "integer"
          },
          "invalid": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "unchanged": {
            "type": "integer"
          }
        },
        "required": [
          "changed",
          "unchanged",
          "invalid"
        ],
        "type": "object"
      },
      "GroupPriceRow": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "min_quantity": {
            "minimum": 1,
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "group_id",
          "variant_id",
          "min_quantity",
          "amount_minor"
        ],
        "type": "object"
      },
      "GuestLicenceKeys": {
        "properties": {
          "held": {
            "description": "Some codes wait for the store's review.",
            "type": "boolean"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/DeliveredLicenceKey"
            },
            "type": "array"
          },
          "pending": {
            "description": "Units not delivered yet (awaiting payment, the store's review, or a code).",
            "type": "integer"
          }
        },
        "required": [
          "keys",
          "pending",
          "held"
        ],
        "type": "object"
      },
      "GuestReturn": {
        "description": "A return the shopper asked for, as their own order read shows it.",
        "properties": {
          "authorized_at": {
            "format": "date-time",
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "closed_at": {
            "format": "date-time",
            "type": "string"
          },
          "defective": {
            "description": "The request was a defect claim.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/GuestReturnLine"
            },
            "type": "array"
          },
          "reason": {
            "type": "string"
          },
          "received_at": {
            "format": "date-time",
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "requested",
              "authorized",
              "rejected",
              "received",
              "inspected",
              "closed",
              "cancelled",
              "withdrawn"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "GuestReturnLine": {
        "properties": {
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "description": "How many were asked to come back.",
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "variant_label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "HSAlternative": {
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "description"
        ],
        "type": "object"
      },
      "HSItem": {
        "description": "One line of the tariff list.",
        "properties": {
          "code": {
            "description": "Digits alone: 09 (chapter), 0902 (heading), 090210 (subheading), 090421900011 (Türkiye's GTİP); a section by its roman number.",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "level": {
            "enum": [
              "section",
              "chapter",
              "heading",
              "subheading",
              "national"
            ],
            "type": "string"
          },
          "path": {
            "description": "Where the line sits: section › chapter › heading.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "level",
          "description",
          "path"
        ],
        "type": "object"
      },
      "HSSearchResult": {
        "properties": {
          "exact": {
            "$ref": "#/components/schemas/HSItem"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/HSItem"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "HSSuggestInput": {
        "description": "What the product page knows of the item.",
        "properties": {
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "language": {
            "description": "The language the lines are shown in: tr reads Türkiye's tariff text, anything else the English.",
            "type": "string"
          },
          "product_type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "HSSuggestion": {
        "description": "The suggestion: the subheading the store's AI chose among the tariff list's closest lines, and those lines.",
        "properties": {
          "alternatives": {
            "items": {
              "$ref": "#/components/schemas/HSAlternative"
            },
            "type": "array"
          },
          "candidates": {
            "description": "The tariff list's closest lines for the item (at most 10).",
            "items": {
              "$ref": "#/components/schemas/HSItem"
            },
            "type": "array"
          },
          "code": {
            "description": "Six digits, like 090210; empty when there is no AI or it chose none.",
            "type": "string"
          },
          "confidence": {
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "type": "string"
          },
          "description": {
            "description": "The tariff list's text for code.",
            "type": "string"
          },
          "error": {
            "description": "Why the AI did not choose: not_configured, rate_limited, provider_error, timeout, network, refused, invalid_answer, no_match.",
            "type": "string"
          },
          "source": {
            "description": "ai: the AI chose among the list's lines; list: the list's closest lines alone.",
            "enum": [
              "ai",
              "list"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HTMLRemoval": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "host": {
            "description": "An iframe's host, when it named one.",
            "type": "string"
          },
          "kind": {
            "enum": [
              "element",
              "attribute"
            ],
            "type": "string"
          },
          "name": {
            "description": "The element (script, iframe, svg …) or attribute (onerror, style, href …) taken out.",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "name",
          "count"
        ],
        "type": "object"
      },
      "HeaderBuilder": {
        "description": "The header laid out by the merchant (ADR-0071): rows for the computer and the phone, each with left, centre and right slots, and the phone's side menu.",
        "properties": {
          "desktop": {
            "$ref": "#/components/schemas/HeaderCanvas"
          },
          "drawer": {
            "$ref": "#/components/schemas/HeaderDrawer"
          },
          "icon_look": {
            "$ref": "#/components/schemas/BuilderIconLook"
          },
          "logo_alt": {
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "readOnly": true,
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "logo_sticky": {
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "readOnly": true,
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "mobile": {
            "$ref": "#/components/schemas/HeaderCanvas"
          },
          "overlay": {
            "description": "The header over the first section: off, on the home page or everywhere.",
            "enum": [
              "",
              "off",
              "home",
              "all"
            ],
            "type": "string"
          },
          "preset": {
            "type": "string"
          },
          "sticky": {
            "$ref": "#/components/schemas/HeaderSticky"
          }
        },
        "type": "object"
      },
      "HeaderCTA": {
        "description": "The theme's call to action drawn from the main menu's last link (custom.cta_last); the builder moves it into its own button element on the first change (2026-10-10). Absent when the store does not draw one.",
        "properties": {
          "href": {
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The link's words per language.",
            "type": "object"
          },
          "menu": {
            "description": "The main menu without that link.",
            "items": {
              "$ref": "#/components/schemas/ThemeMenuItem"
            },
            "type": "array"
          }
        },
        "required": [
          "label",
          "href",
          "menu"
        ],
        "type": "object"
      },
      "HeaderCanvas": {
        "properties": {
          "rows": {
            "description": "top, main and bottom, in that order (completed by the kernel).",
            "items": {
              "$ref": "#/components/schemas/HeaderRow"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "HeaderDrawer": {
        "properties": {
          "elements": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          },
          "side": {
            "enum": [
              "left",
              "right"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HeaderRow": {
        "properties": {
          "border": {
            "type": "boolean"
          },
          "height": {
            "description": "px, 32–160; 0 is the row's default.",
            "maximum": 160,
            "minimum": 0,
            "type": "integer"
          },
          "hidden": {
            "type": "boolean"
          },
          "id": {
            "enum": [
              "top",
              "main",
              "bottom"
            ],
            "type": "string"
          },
          "scheme": {
            "description": "One of the theme's colour schemes, or empty.",
            "type": "string"
          },
          "slots": {
            "$ref": "#/components/schemas/HeaderSlots"
          },
          "sticky": {
            "description": "Stays on screen with the header's sticky mode.",
            "type": "boolean"
          },
          "transparent": {
            "description": "No background of its own.",
            "type": "boolean"
          },
          "width": {
            "enum": [
              "",
              "container",
              "full"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "slots"
        ],
        "type": "object"
      },
      "HeaderSlots": {
        "properties": {
          "center": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          },
          "left": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          },
          "right": {
            "items": {
              "$ref": "#/components/schemas/BuilderElement"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "HeaderSticky": {
        "properties": {
          "mode": {
            "enum": [
              "off",
              "always",
              "scroll_up"
            ],
            "type": "string"
          },
          "shrink": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "HealthBoard": {
        "properties": {
          "pos": {
            "items": {
              "$ref": "#/components/schemas/HealthPOS"
            },
            "type": "array"
          },
          "rules": {
            "$ref": "#/components/schemas/HealthRules"
          }
        },
        "required": [
          "rules",
          "pos"
        ],
        "type": "object"
      },
      "HealthPOS": {
        "properties": {
          "down_until": {
            "format": "date-time",
            "type": "string"
          },
          "failures": {
            "type": "integer"
          },
          "healthy": {
            "type": "boolean"
          },
          "last_error": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "reason": {
            "description": "failures, error_rate or slow",
            "type": "string"
          },
          "windows": {
            "items": {
              "$ref": "#/components/schemas/HealthWindow"
            },
            "type": "array"
          }
        },
        "required": [
          "provider",
          "name",
          "healthy",
          "failures",
          "windows"
        ],
        "type": "object"
      },
      "HealthRules": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "max_avg_ms": {
            "description": "0 off.",
            "type": "integer"
          },
          "max_error_rate": {
            "description": "Percent of technical errors.",
            "type": "integer"
          },
          "min_calls": {
            "type": "integer"
          },
          "rest_minutes": {
            "type": "integer"
          },
          "window_minutes": {
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "window_minutes",
          "min_calls",
          "max_error_rate",
          "max_avg_ms",
          "rest_minutes"
        ],
        "type": "object"
      },
      "HealthWindow": {
        "properties": {
          "avg_ms": {
            "type": "integer"
          },
          "calls": {
            "type": "integer"
          },
          "declines": {
            "type": "integer"
          },
          "error_permille": {
            "description": "Technical errors per thousand calls.",
            "type": "integer"
          },
          "max_ms": {
            "type": "integer"
          },
          "minutes": {
            "type": "integer"
          },
          "success_permille": {
            "description": "Successes per thousand calls.",
            "type": "integer"
          },
          "successes": {
            "type": "integer"
          },
          "tech_errors": {
            "type": "integer"
          }
        },
        "required": [
          "minutes",
          "calls",
          "successes",
          "declines",
          "tech_errors",
          "avg_ms",
          "max_ms",
          "success_permille",
          "error_permille"
        ],
        "type": "object"
      },
      "HiddenStock": {
        "description": "A variant's hidden count (ADR-0142): panel only, never limits a sale.",
        "properties": {
          "movements": {
            "items": {
              "$ref": "#/components/schemas/HiddenStockMovement"
            },
            "type": "array"
          },
          "quantity": {
            "minimum": 0,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HiddenStockInput": {
        "description": "Exactly one of adjust and set.",
        "properties": {
          "adjust": {
            "description": "A move, + or −.",
            "type": "integer"
          },
          "reason": {
            "maxLength": 200,
            "type": "string"
          },
          "set": {
            "description": "A count of the shelf.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HiddenStockMovement": {
        "description": "One line of the hidden stock's ledger.",
        "properties": {
          "actor": {
            "description": "Who moved it (the operator's e-mail; system for the automatic preparation).",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delta": {
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "adjust / count: by hand; order: taken for an order's automatic preparation; order_returned: given back when its booking failed.",
            "enum": [
              "adjust",
              "count",
              "order",
              "order_returned"
            ],
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "quantity_after": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HiddenStockRow": {
        "properties": {
          "label": {
            "description": "The variant's option values.",
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_title": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HistoryPreviewInput": {
        "description": "Exactly one of version_id and checkpoint_id.",
        "properties": {
          "checkpoint_id": {
            "format": "int64",
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HubAdCampaign": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "creative": {
            "$ref": "#/components/schemas/HubAdCreative"
          },
          "currency": {
            "type": "string"
          },
          "daily_budget_minor": {
            "format": "int64",
            "type": "integer"
          },
          "desired": {
            "enum": [
              "paused",
              "enabled",
              "removed"
            ],
            "type": "string"
          },
          "display": {
            "description": "The one plain status (Hazırlanıyor, İncelemede, Yayında, Duraklatıldı, Reddedildi, Ödeme bekliyor, Bitti, Kısmen yayında).",
            "enum": [
              "preparing",
              "in_review",
              "live",
              "paused",
              "rejected",
              "payment_pending",
              "ended",
              "partial"
            ],
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "goal": {
            "enum": [
              "sales",
              "traffic",
              "whatsapp"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "performance_max",
              "search",
              "catalog_sales",
              "link_ad",
              "click_to_whatsapp"
            ],
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "month_spend_minor": {
            "format": "int64",
            "type": "integer"
          },
          "monthly_max_minor": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "paused_by": {
            "enum": [
              "owner",
              "cap",
              "failure"
            ],
            "type": "string"
          },
          "payment_pending": {
            "type": "boolean"
          },
          "plan_id": {
            "format": "int64",
            "type": "integer"
          },
          "primary_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "primary_status": {
            "type": "string"
          },
          "problem": {
            "enum": [
              "launch_failed",
              "cap_reached"
            ],
            "type": "string"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/HubAdTarget"
            },
            "type": "array"
          },
          "provider": {
            "enum": [
              "google",
              "microsoft-ads",
              "yandex-direct",
              "meta"
            ],
            "type": "string"
          },
          "review": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "store",
              "products"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "preparing",
              "paused",
              "enabled",
              "removed",
              "failed"
            ],
            "type": "string"
          },
          "synced_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "plan_id",
          "provider",
          "name",
          "kind",
          "goal",
          "scope",
          "currency",
          "daily_budget_minor",
          "monthly_max_minor",
          "creative",
          "status",
          "desired",
          "primary_reasons",
          "payment_pending",
          "version",
          "created_at",
          "products",
          "month_spend_minor",
          "display"
        ],
        "type": "object"
      },
      "HubAdCreative": {
        "description": "A campaign's words and pictures. NeroCart builds them from the products; any field sent replaces the built one.",
        "properties": {
          "business_name": {
            "type": "string"
          },
          "descriptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "final_url": {
            "type": "string"
          },
          "headlines": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "images": {
            "items": {
              "$ref": "#/components/schemas/HubAdImage"
            },
            "type": "array"
          },
          "keywords": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "logo_url": {
            "type": "string"
          },
          "long_headlines": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "max_cpc_minor": {
            "description": "Search: the most one click may cost (Maximize clicks' ceiling).",
            "format": "int64",
            "type": "integer"
          },
          "welcome_message": {
            "description": "A click-to-WhatsApp ad's text the customer's message box is filled with (ADR-0059); absent for every other kind.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubAdImage": {
        "properties": {
          "height": {
            "type": "integer"
          },
          "role": {
            "enum": [
              "square",
              "landscape",
              "logo"
            ],
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "role",
          "url"
        ],
        "type": "object"
      },
      "HubAdProblem": {
        "properties": {
          "code": {
            "description": "too_long, too_few, too_many, required, invalid, invalid_url, needs_short, or platform:\u003cthe engine's error code\u003e.",
            "type": "string"
          },
          "engine": {
            "description": "The engine the problem is about.",
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "index": {
            "type": "integer"
          }
        },
        "required": [
          "field",
          "code",
          "index"
        ],
        "type": "object"
      },
      "HubAdTarget": {
        "properties": {
          "item_id": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "item_id",
          "title"
        ],
        "type": "object"
      },
      "HubAdsChange": {
        "properties": {
          "campaign_id": {
            "format": "int64",
            "type": "integer"
          },
          "daily_budget_minor": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "previous_daily_minor": {
            "format": "int64",
            "type": "integer"
          },
          "provider": {
            "description": "The campaign's engine; absent: google.",
            "type": "string"
          }
        },
        "required": [
          "campaign_id",
          "name",
          "daily_budget_minor",
          "previous_daily_minor"
        ],
        "type": "object"
      },
      "HubAdsLaunch": {
        "description": "A launch as an ads_launch plan carries it (the plan hash covers it).",
        "properties": {
          "account": {
            "type": "string"
          },
          "also": {
            "description": "The launch's other engines (ADR-0054), each with its account, kind, creative and share of the daily budget.",
            "items": {
              "$ref": "#/components/schemas/HubAdsLaunch"
            },
            "type": "array"
          },
          "assets": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Meta (ADR-0056): the Page, Instagram account, catalog and pixel ids the campaign is made with, as Meta answered them when the owner chose them.",
            "type": "object"
          },
          "creative": {
            "$ref": "#/components/schemas/HubAdCreative"
          },
          "currency": {
            "type": "string"
          },
          "daily_budget_minor": {
            "format": "int64",
            "type": "integer"
          },
          "goal": {
            "enum": [
              "sales",
              "traffic",
              "whatsapp"
            ],
            "type": "string"
          },
          "kind": {
            "enum": [
              "performance_max",
              "search",
              "catalog_sales",
              "link_ad",
              "click_to_whatsapp"
            ],
            "type": "string"
          },
          "merchant_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/HubAdTarget"
            },
            "type": "array"
          },
          "provider": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "store",
              "products"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "provider",
          "kind",
          "goal",
          "scope",
          "products",
          "currency",
          "daily_budget_minor",
          "account",
          "creative"
        ],
        "type": "object"
      },
      "HubAdsSection": {
        "description": "\"Reklamlar\" (ADR-0052, ADR-0054): the ad engines' numbers for the period (Google Ads, Microsoft Advertising, Yandex Direct), in the accounts' own currency (minor units), never converted; the totals add up the engines in the section's currency. Read only.",
        "properties": {
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/HubCampaignItem"
            },
            "type": "array"
          },
          "chart": {
            "items": {
              "properties": {
                "clicks": {
                  "format": "int64",
                  "type": "integer"
                },
                "conversion_value_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "cost_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "day": {
                  "format": "date",
                  "type": "string"
                }
              },
              "required": [
                "day",
                "cost_minor",
                "clicks",
                "conversion_value_minor"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "clicks": {
            "format": "int64",
            "type": "integer"
          },
          "conversion_value_minor": {
            "format": "int64",
            "type": "integer"
          },
          "conversions": {
            "description": "Google's conversions, two decimals (data-driven attribution splits one).",
            "type": "number"
          },
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "description": "The ad account's currency (ISO 4217).",
            "type": "string"
          },
          "customer": {
            "description": "The account's id as people know it (123-456-7890).",
            "type": "string"
          },
          "engines": {
            "items": {
              "properties": {
                "account": {
                  "type": "string"
                },
                "clicks": {
                  "format": "int64",
                  "type": "integer"
                },
                "conversion_value_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "conversions": {
                  "type": "number"
                },
                "cost_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                },
                "has": {
                  "type": "boolean"
                },
                "impressions": {
                  "format": "int64",
                  "type": "integer"
                },
                "in_total": {
                  "type": "boolean"
                },
                "message": {
                  "type": "string"
                },
                "provider": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "state": {
                  "description": "One plain status; the screen words it, never shows it.",
                  "enum": [
                    "NOT_CONNECTED",
                    "CONNECTED",
                    "NEEDS_REAUTH",
                    "NEEDS_PLATFORM_SETUP",
                    "NEEDS_OWNER_ACTION",
                    "UNAVAILABLE",
                    "ERROR"
                  ],
                  "type": "string"
                },
                "whatsapp_conversations": {
                  "description": "WhatsApp conversations the ads started (Meta's click-to-WhatsApp ads; onsite_conversion.messaging_conversation_started_7d).",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "provider",
                "source",
                "state",
                "has",
                "in_total",
                "cost_minor",
                "impressions",
                "clicks",
                "conversions",
                "conversion_value_minor",
                "whatsapp_conversations"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "has": {
            "type": "boolean"
          },
          "impressions": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "description": "A code the screen words (not_bound, scope_missing, grant_expired, api_disabled, no_access, rate_limited, provider_down, fetch_failed).",
            "type": "string"
          },
          "return_on_spend": {
            "description": "Conversion value ÷ cost, two decimals; 0 without cost.",
            "type": "number"
          },
          "state": {
            "description": "One plain status; the screen words it, never shows it.",
            "enum": [
              "NOT_CONNECTED",
              "CONNECTED",
              "NEEDS_REAUTH",
              "NEEDS_PLATFORM_SETUP",
              "NEEDS_OWNER_ACTION",
              "UNAVAILABLE",
              "ERROR"
            ],
            "type": "string"
          },
          "whatsapp_conversations": {
            "description": "WhatsApp conversations the ads started (Meta's click-to-WhatsApp ads; onsite_conversion.messaging_conversation_started_7d).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "state",
          "has",
          "cost_minor",
          "impressions",
          "clicks",
          "conversions",
          "conversion_value_minor",
          "return_on_spend",
          "chart",
          "campaigns",
          "engines",
          "whatsapp_conversations"
        ],
        "type": "object"
      },
      "HubAdsView": {
        "properties": {
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/HubAdCampaign"
            },
            "type": "array"
          },
          "can_launch": {
            "type": "boolean"
          },
          "engines": {
            "items": {
              "properties": {
                "provider": {
                  "type": "string"
                },
                "ready": {
                  "type": "boolean"
                }
              },
              "required": [
                "provider",
                "ready"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "policies": {
            "items": {
              "$ref": "#/components/schemas/HubBudgetPolicy"
            },
            "type": "array"
          },
          "spend_enabled": {
            "type": "boolean"
          },
          "whatsapp_phone": {
            "description": "The store's WhatsApp number the ad opens a chat with.",
            "type": "string"
          },
          "whatsapp_ready": {
            "description": "Whether the goal \"WhatsApp'tan mesaj al\" can be offered: Meta ready for ads and a WhatsApp number chosen (ADR-0059).",
            "type": "boolean"
          }
        },
        "required": [
          "campaigns",
          "spend_enabled",
          "can_launch",
          "policies",
          "engines",
          "whatsapp_ready"
        ],
        "type": "object"
      },
      "HubApproveInput": {
        "additionalProperties": false,
        "properties": {
          "confirm_currency": {
            "description": "The plan's currency as the person was shown it; required for a plan that sets an ad budget.",
            "type": "string"
          },
          "confirm_monthly_max_minor": {
            "description": "The plan's monthly_max_minor as the person was shown it; required for a plan that sets an ad budget.",
            "format": "int64",
            "type": "integer"
          },
          "hash": {
            "description": "The plan's plan_hash, exactly.",
            "type": "string"
          }
        },
        "required": [
          "hash"
        ],
        "type": "object"
      },
      "HubBudgetPolicy": {
        "description": "One store's ad budget in one currency (ADR-0052).",
        "properties": {
          "auto_pause_on_cap": {
            "description": "Pause every campaign when the month's spend reaches the cap minus one day's maximum (enforced once NeroCart runs campaigns; phase 2 runs none).",
            "type": "boolean"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "max_daily_minor": {
            "description": "The most the store's ads may spend in a day, minor units; not above the monthly cap.",
            "format": "int64",
            "type": "integer"
          },
          "monthly_cap_minor": {
            "description": "The most the store's ads may spend in a month, minor units.",
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "monthly_cap_minor",
          "max_daily_minor",
          "auto_pause_on_cap"
        ],
        "type": "object"
      },
      "HubBudgetView": {
        "properties": {
          "can_raise": {
            "description": "Whether the caller could approve a raise: a signed-in person with ads.spend, the switch on.",
            "type": "boolean"
          },
          "currencies": {
            "description": "Currencies a policy is offered in: the ad account's first, then the store's.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "month_spend": {
            "items": {
              "properties": {
                "cost_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                },
                "from": {
                  "format": "date",
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "to": {
                  "format": "date",
                  "type": "string"
                }
              },
              "required": [
                "source",
                "currency",
                "cost_minor",
                "from",
                "to"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pending": {
            "$ref": "#/components/schemas/HubPlan"
          },
          "policies": {
            "items": {
              "$ref": "#/components/schemas/HubBudgetPolicy"
            },
            "type": "array"
          },
          "spend_enabled": {
            "description": "The server's kill switch (COS_ADS_SPEND=on).",
            "type": "boolean"
          }
        },
        "required": [
          "policies",
          "currencies",
          "month_spend",
          "spend_enabled",
          "can_raise"
        ],
        "type": "object"
      },
      "HubCampaignItem": {
        "properties": {
          "clicks": {
            "format": "int64",
            "type": "integer"
          },
          "conversion_value_minor": {
            "format": "int64",
            "type": "integer"
          },
          "conversions": {
            "type": "number"
          },
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "impressions": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "whatsapp_conversations": {
            "description": "WhatsApp conversations the ads started (Meta's click-to-WhatsApp ads; onsite_conversion.messaging_conversation_started_7d).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "cost_minor",
          "impressions",
          "clicks",
          "conversions",
          "conversion_value_minor",
          "provider",
          "whatsapp_conversations"
        ],
        "type": "object"
      },
      "HubCatalogCard": {
        "properties": {
          "external_id": {
            "type": "string"
          },
          "items": {
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "last_full_sync_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_sync_at": {
            "format": "date-time",
            "type": "string"
          },
          "pending": {
            "type": "boolean"
          },
          "platform": {
            "enum": [
              "meta",
              "tiktok"
            ],
            "type": "string"
          },
          "rejected": {
            "type": "integer"
          },
          "sync_status": {
            "enum": [
              "idle",
              "running",
              "ok",
              "error"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubCatalogProblem": {
        "properties": {
          "platform": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "retailer_id": {
            "type": "string"
          },
          "review_status": {
            "type": "string"
          },
          "status": {
            "enum": [
              "rejected",
              "error"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HubChannelCard": {
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "catalog": {
            "$ref": "#/components/schemas/HubCatalogCard"
          },
          "category_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "channel": {
            "enum": [
              "whatsapp",
              "instagram",
              "facebook",
              "tiktok"
            ],
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "external_id": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "missing_permissions": {
            "description": "Meta permissions the channel needs and the grant lacks; start the login with ?scopes=social to ask for them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "needs": {
            "description": "What the owner must do first: connect_meta, choose_page, link_instagram, choose_whatsapp_number, connect_tiktok; empty when nothing.",
            "type": "string"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "products_mode": {
            "enum": [
              "all",
              "categories",
              "selected"
            ],
            "type": "string"
          },
          "review_status": {
            "type": "string"
          },
          "setup": {
            "additionalProperties": {
              "$ref": "#/components/schemas/HubSetupStep"
            },
            "type": "object"
          },
          "status": {
            "enum": [
              "pending",
              "active",
              "review_pending",
              "rejected",
              "disabled",
              "error"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubChannelUpdate": {
        "properties": {
          "category_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "products_mode": {
            "enum": [
              "all",
              "categories",
              "selected"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubChannelsView": {
        "properties": {
          "channels": {
            "items": {
              "$ref": "#/components/schemas/HubChannelCard"
            },
            "type": "array"
          },
          "inbox_allowed": {
            "type": "boolean"
          },
          "meta_connected": {
            "type": "boolean"
          },
          "tiktok_connected": {
            "type": "boolean"
          },
          "tiktok_shop": {
            "description": "TikTok Shop takes sellers from the store's country; it is connected under Marketplaces.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "HubChooseAccountInput": {
        "additionalProperties": false,
        "properties": {
          "account_id": {
            "description": "The account's id or its number (G10762ZE).",
            "type": "string"
          }
        },
        "required": [
          "account_id"
        ],
        "type": "object"
      },
      "HubConnections": {
        "properties": {
          "cards": {
            "items": {
              "properties": {
                "account_id": {
                  "description": "The one id people recognise (the Google account, the site).",
                  "type": "string"
                },
                "account_name": {
                  "type": "string"
                },
                "accounts": {
                  "description": "The ad accounts the owned grant reaches.",
                  "items": {
                    "$ref": "#/components/schemas/HubOwnedAccount"
                  },
                  "type": "array"
                },
                "assets": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "An owned connection's other choices (Meta: page_id, page_name, instagram_id, instagram_name, catalog_id, catalog_name, pixel_id, pixel_name, and feed, place_pixel, conversions = on). Ids and names only.",
                  "type": "object"
                },
                "chosen_account": {
                  "description": "The chosen account's id.",
                  "type": "string"
                },
                "configured": {
                  "description": "For an owned connection: whether the platform's app is in place. false: NeroCart is preparing it.",
                  "type": "boolean"
                },
                "currency": {
                  "description": "The chosen ad account's currency.",
                  "type": "string"
                },
                "grant_expires_at": {
                  "description": "When the stored grant stops working by itself (Meta's long-lived token); absent when it does not expire.",
                  "format": "date-time",
                  "type": "string"
                },
                "message": {
                  "description": "A code the screen words (not_bound, scope_missing, grant_expired, api_disabled, no_access, rate_limited, provider_down, not_configured, coming_soon, fetch_failed, not_verified, choose_account, no_account, no_chat, webhook_failed, meta_first, choose_number).",
                  "type": "string"
                },
                "owned": {
                  "description": "A connection the hub keeps itself (ADR-0054): the card connects and chooses the account in place.",
                  "type": "boolean"
                },
                "provider": {
                  "enum": [
                    "google",
                    "bing",
                    "yandex",
                    "microsoft-ads",
                    "yandex-direct",
                    "meta",
                    "tiktok",
                    "whatsapp",
                    "telegram"
                  ],
                  "type": "string"
                },
                "ready": {
                  "description": "false: NeroCart does not connect this provider yet (Yakında).",
                  "type": "boolean"
                },
                "settings": {
                  "description": "The admin screen (under the panel's base path) where the owner connects or repairs it.",
                  "type": "string"
                },
                "state": {
                  "description": "One plain status; the screen words it, never shows it.",
                  "enum": [
                    "NOT_CONNECTED",
                    "CONNECTED",
                    "NEEDS_REAUTH",
                    "NEEDS_PLATFORM_SETUP",
                    "NEEDS_OWNER_ACTION",
                    "UNAVAILABLE",
                    "ERROR"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "provider",
                "state",
                "ready"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "cards"
        ],
        "type": "object"
      },
      "HubConversionsProvider": {
        "properties": {
          "failed": {
            "type": "integer"
          },
          "last_failure": {
            "description": "The last failure's code (meta:\u003ccode\u003e, not_received, gave_up …).",
            "type": "string"
          },
          "last_sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "no_consent": {
            "type": "integer"
          },
          "provider": {
            "enum": [
              "meta",
              "tiktok"
            ],
            "type": "string"
          },
          "queued": {
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "test_mode": {
            "description": "A Meta test event code is set: events show under Test events.",
            "type": "boolean"
          },
          "via": {
            "description": "connection: the store's connected account; pixel: the Meta pixel plugin's own Conversions API token; off: not sent.",
            "enum": [
              "connection",
              "pixel",
              "off"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider",
          "via",
          "sent",
          "no_consent",
          "failed",
          "queued"
        ],
        "type": "object"
      },
      "HubConversionsSummary": {
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/HubConversionsProvider"
            },
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "type": "object"
      },
      "HubDashboard": {
        "properties": {
          "ads": {
            "$ref": "#/components/schemas/HubAdsSection"
          },
          "from": {
            "format": "date",
            "type": "string"
          },
          "index": {
            "items": {
              "properties": {
                "crawl_errors": {
                  "format": "int64",
                  "type": "integer"
                },
                "excluded": {
                  "format": "int64",
                  "type": "integer"
                },
                "has": {
                  "type": "boolean"
                },
                "in_index": {
                  "format": "int64",
                  "type": "integer"
                },
                "problems": {
                  "format": "int64",
                  "type": "integer"
                },
                "provider": {
                  "type": "string"
                },
                "quality": {
                  "format": "int64",
                  "type": "integer"
                },
                "state": {
                  "description": "One plain status; the screen words it, never shows it.",
                  "enum": [
                    "NOT_CONNECTED",
                    "CONNECTED",
                    "NEEDS_REAUTH",
                    "NEEDS_PLATFORM_SETUP",
                    "NEEDS_OWNER_ACTION",
                    "UNAVAILABLE",
                    "ERROR"
                  ],
                  "type": "string"
                },
                "submitted": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "provider",
                "state",
                "has"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "period_days": {
            "enum": [
              7,
              28,
              90
            ],
            "type": "integer"
          },
          "search": {
            "properties": {
              "chart": {
                "items": {
                  "properties": {
                    "clicks": {
                      "additionalProperties": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "object"
                    },
                    "day": {
                      "format": "date",
                      "type": "string"
                    },
                    "impressions": {
                      "additionalProperties": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "object"
                    }
                  },
                  "required": [
                    "day",
                    "impressions",
                    "clicks"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "engines": {
                "items": {
                  "properties": {
                    "clicks": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "has": {
                      "type": "boolean"
                    },
                    "impressions": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "message": {
                      "description": "A code the screen words (not_bound, scope_missing, grant_expired, api_disabled, no_access, rate_limited, provider_down, not_configured, coming_soon, fetch_failed, not_verified).",
                      "type": "string"
                    },
                    "position": {
                      "description": "Impression-weighted average position; 0 when none.",
                      "type": "number"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "state": {
                      "description": "One plain status; the screen words it, never shows it.",
                      "enum": [
                        "NOT_CONNECTED",
                        "CONNECTED",
                        "NEEDS_REAUTH",
                        "NEEDS_PLATFORM_SETUP",
                        "NEEDS_OWNER_ACTION",
                        "UNAVAILABLE",
                        "ERROR"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "provider",
                    "source",
                    "state",
                    "has",
                    "impressions",
                    "clicks",
                    "position"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "pages": {
                "additionalProperties": {
                  "items": {
                    "$ref": "#/components/schemas/HubTopItem"
                  },
                  "type": "array"
                },
                "description": "Provider (google, bing, yandex) to its top 10.",
                "type": "object"
              },
              "queries": {
                "additionalProperties": {
                  "items": {
                    "$ref": "#/components/schemas/HubTopItem"
                  },
                  "type": "array"
                },
                "description": "Provider (google, bing, yandex) to its top 10.",
                "type": "object"
              }
            },
            "required": [
              "engines",
              "chart",
              "queries",
              "pages"
            ],
            "type": "object"
          },
          "sources": {
            "items": {
              "properties": {
                "data_from": {
                  "format": "date",
                  "type": "string"
                },
                "data_to": {
                  "format": "date",
                  "type": "string"
                },
                "facts": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "last_attempt_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "last_success_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "message": {
                  "description": "A code the screen words (not_bound, scope_missing, grant_expired, api_disabled, no_access, rate_limited, provider_down, not_configured, coming_soon, fetch_failed, not_verified).",
                  "type": "string"
                },
                "provider": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "state": {
                  "description": "One plain status; the screen words it, never shows it.",
                  "enum": [
                    "NOT_CONNECTED",
                    "CONNECTED",
                    "NEEDS_REAUTH",
                    "NEEDS_PLATFORM_SETUP",
                    "NEEDS_OWNER_ACTION",
                    "UNAVAILABLE",
                    "ERROR"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "source",
                "provider",
                "state",
                "facts"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "tiles": {
            "properties": {
              "ad_spend": {
                "$ref": "#/components/schemas/HubTile"
              },
              "clicks": {
                "$ref": "#/components/schemas/HubTile"
              },
              "impressions": {
                "$ref": "#/components/schemas/HubTile"
              },
              "revenue": {
                "$ref": "#/components/schemas/HubTile"
              },
              "visitors": {
                "$ref": "#/components/schemas/HubTile"
              }
            },
            "required": [
              "impressions",
              "clicks",
              "visitors",
              "revenue",
              "ad_spend"
            ],
            "type": "object"
          },
          "to": {
            "format": "date",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "visitors": {
            "properties": {
              "channels": {
                "items": {
                  "$ref": "#/components/schemas/HubTopItem"
                },
                "type": "array"
              },
              "chart": {
                "items": {
                  "properties": {
                    "day": {
                      "format": "date",
                      "type": "string"
                    },
                    "sessions": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "users": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "day",
                    "sessions",
                    "users"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "currency": {
                "type": "string"
              },
              "has": {
                "type": "boolean"
              },
              "message": {
                "description": "A code the screen words (not_bound, scope_missing, grant_expired, api_disabled, no_access, rate_limited, provider_down, not_configured, coming_soon, fetch_failed, not_verified).",
                "type": "string"
              },
              "page_views": {
                "format": "int64",
                "type": "integer"
              },
              "pages": {
                "items": {
                  "$ref": "#/components/schemas/HubTopItem"
                },
                "type": "array"
              },
              "purchases": {
                "format": "int64",
                "type": "integer"
              },
              "revenue_minor": {
                "format": "int64",
                "type": "integer"
              },
              "sessions": {
                "format": "int64",
                "type": "integer"
              },
              "state": {
                "description": "One plain status; the screen words it, never shows it.",
                "enum": [
                  "NOT_CONNECTED",
                  "CONNECTED",
                  "NEEDS_REAUTH",
                  "NEEDS_PLATFORM_SETUP",
                  "NEEDS_OWNER_ACTION",
                  "UNAVAILABLE",
                  "ERROR"
                ],
                "type": "string"
              },
              "users": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "state",
              "has",
              "users",
              "sessions",
              "page_views",
              "purchases",
              "revenue_minor",
              "chart",
              "pages",
              "channels"
            ],
            "type": "object"
          }
        },
        "required": [
          "period_days",
          "from",
          "to",
          "tiles",
          "search",
          "visitors",
          "ads",
          "index",
          "sources"
        ],
        "type": "object"
      },
      "HubInboxAssign": {
        "properties": {
          "user_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "user_id"
        ],
        "type": "object"
      },
      "HubInboxCustomer": {
        "properties": {
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_order_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "phone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "orders"
        ],
        "type": "object"
      },
      "HubInboxItem": {
        "properties": {
          "assigned_user_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "channel": {
            "enum": [
              "whatsapp",
              "instagram",
              "facebook"
            ],
            "type": "string"
          },
          "customer_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "handle": {
            "description": "The phone (WhatsApp) or the Instagram username.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "wa",
              "social"
            ],
            "type": "string"
          },
          "last_inbound_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          },
          "unread": {
            "type": "integer"
          },
          "window_open": {
            "type": "boolean"
          },
          "window_until": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "channel",
          "name",
          "handle",
          "last_message_at",
          "last_inbound_at",
          "window_open",
          "unread",
          "status",
          "assigned_user_id",
          "customer_id",
          "preview"
        ],
        "type": "object"
      },
      "HubInboxMessage": {
        "properties": {
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "direction": {
            "enum": [
              "in",
              "out"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "type": "object"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "kind",
          "body",
          "payload",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "HubInboxPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HubInboxItem"
            },
            "type": "array"
          },
          "next": {
            "description": "The next page's cursor (pass as before); empty at the end.",
            "type": "string"
          }
        },
        "required": [
          "items",
          "next"
        ],
        "type": "object"
      },
      "HubInboxStatus": {
        "properties": {
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "HubInboxThread": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HubInboxItem"
          },
          {
            "properties": {
              "customer": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/HubInboxCustomer"
                  }
                ]
              },
              "messages": {
                "items": {
                  "$ref": "#/components/schemas/HubInboxMessage"
                },
                "type": "array"
              }
            },
            "required": [
              "messages",
              "customer"
            ],
            "type": "object"
          }
        ]
      },
      "HubInstagramPublish": {
        "properties": {
          "caption": {
            "maxLength": 2200,
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "product_id"
        ],
        "type": "object"
      },
      "HubInstagramPublished": {
        "properties": {
          "media_id": {
            "type": "string"
          },
          "permalink": {
            "type": "string"
          },
          "tagged": {
            "type": "boolean"
          }
        },
        "required": [
          "media_id",
          "permalink",
          "tagged"
        ],
        "type": "object"
      },
      "HubLaunchInput": {
        "additionalProperties": false,
        "description": "The \"Reklam ver\" wizard's answer.",
        "properties": {
          "budgets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "daily_budget_minor split per engine (adding up to it); empty splits it evenly.",
            "type": "object"
          },
          "creative": {
            "$ref": "#/components/schemas/HubAdCreative"
          },
          "daily_budget_minor": {
            "format": "int64",
            "type": "integer"
          },
          "engines": {
            "description": "Where to advertise: google, microsoft-ads, yandex-direct (ADR-0055), meta (Facebook and Instagram, ADR-0056).",
            "items": {
              "enum": [
                "google",
                "microsoft-ads",
                "yandex-direct",
                "meta"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "goal": {
            "enum": [
              "sales",
              "traffic",
              "whatsapp"
            ],
            "type": "string"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "scope": {
            "enum": [
              "store",
              "products"
            ],
            "type": "string"
          }
        },
        "required": [
          "scope",
          "goal",
          "daily_budget_minor"
        ],
        "type": "object"
      },
      "HubLive": {
        "description": "The store's GA4 Realtime numbers (\"Şu an sitede\"). On a refusal, status names it and the numbers are zero.",
        "properties": {
          "active_users_30m": {
            "format": "int64",
            "type": "integer"
          },
          "active_users_5m": {
            "format": "int64",
            "type": "integer"
          },
          "connect_path": {
            "description": "The admin screen that connects Google or binds the GA4 property.",
            "type": "string"
          },
          "countries": {
            "items": {
              "$ref": "#/components/schemas/HubLiveItem"
            },
            "maxItems": 5,
            "type": "array"
          },
          "devices": {
            "description": "desktop, mobile, tablet.",
            "items": {
              "$ref": "#/components/schemas/HubLiveItem"
            },
            "maxItems": 5,
            "type": "array"
          },
          "events": {
            "properties": {
              "add_to_cart": {
                "format": "int64",
                "type": "integer"
              },
              "purchase": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "add_to_cart",
              "purchase"
            ],
            "type": "object"
          },
          "fetched_at": {
            "description": "When Google answered; the answer is served from memory for up to 20 seconds.",
            "format": "date-time",
            "type": "string"
          },
          "message": {
            "description": "The connector's message code behind a refusal (scope_missing, api_disabled, rate_limited, …).",
            "type": "string"
          },
          "per_minute": {
            "description": "Active users per minute, oldest first: [0] is 29 minutes ago, [29] this minute.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 30,
            "minItems": 30,
            "type": "array"
          },
          "status": {
            "enum": [
              "ok",
              "not_connected",
              "needs_reauth",
              "not_bound",
              "quota",
              "unavailable"
            ],
            "type": "string"
          },
          "top_pages": {
            "description": "Page titles (unifiedScreenName) by active users.",
            "items": {
              "$ref": "#/components/schemas/HubLiveItem"
            },
            "maxItems": 5,
            "type": "array"
          }
        },
        "required": [
          "status",
          "active_users_30m",
          "active_users_5m",
          "per_minute",
          "top_pages",
          "countries",
          "devices",
          "events"
        ],
        "type": "object"
      },
      "HubLiveItem": {
        "properties": {
          "code": {
            "description": "A country's ISO 3166-1 alpha-2 code (countries only).",
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "users": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "users"
        ],
        "type": "object"
      },
      "HubMetaAssets": {
        "description": "What the owner chooses from on Meta (read from Meta), and what is chosen.",
        "properties": {
          "can_create_catalog": {
            "type": "boolean"
          },
          "catalogs": {
            "items": {
              "$ref": "#/components/schemas/HubMetaOption"
            },
            "type": "array"
          },
          "chosen": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "pages": {
            "items": {
              "$ref": "#/components/schemas/HubMetaPage"
            },
            "type": "array"
          },
          "pixels": {
            "items": {
              "$ref": "#/components/schemas/HubMetaOption"
            },
            "type": "array"
          }
        },
        "required": [
          "pages",
          "catalogs",
          "pixels",
          "chosen",
          "can_create_catalog"
        ],
        "type": "object"
      },
      "HubMetaChoice": {
        "description": "The owner's Meta choice. Every id must be one Meta answers for the grant; feed, place_pixel and conversions are each the owner's explicit choice.",
        "properties": {
          "catalog_id": {
            "type": "string"
          },
          "conversions": {
            "description": "Send paid orders of shoppers with marketing consent to the pixel (Conversions API).",
            "type": "boolean"
          },
          "create_catalog": {
            "type": "boolean"
          },
          "create_pixel": {
            "type": "boolean"
          },
          "feed": {
            "description": "Register the store's product feed URL on the catalog (daily).",
            "type": "boolean"
          },
          "instagram_id": {
            "type": "string"
          },
          "page_id": {
            "type": "string"
          },
          "pixel_id": {
            "type": "string"
          },
          "place_pixel": {
            "description": "Switch on the storefront's Meta pixel plugin with the pixel (loads only with marketing consent).",
            "type": "boolean"
          }
        },
        "required": [
          "page_id"
        ],
        "type": "object"
      },
      "HubMetaChoiceResult": {
        "properties": {
          "chosen": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "problems": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Parts that failed, by part (feed, place_pixel): a code. The rest is stored.",
            "type": "object"
          }
        },
        "required": [
          "chosen",
          "problems"
        ],
        "type": "object"
      },
      "HubMetaOption": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "HubMetaPage": {
        "properties": {
          "id": {
            "type": "string"
          },
          "instagram_id": {
            "type": "string"
          },
          "instagram_name": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "HubOAuthStart": {
        "properties": {
          "authorization_url": {
            "format": "uri",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "authorization_url",
          "expires_at"
        ],
        "type": "object"
      },
      "HubOwnedAccount": {
        "description": "One ad account an owned grant reaches: ids and names, no secret.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "number": {
            "description": "The account number Microsoft shows (G10762ZE), or the Yandex Direct login.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "name",
          "customer_id",
          "active"
        ],
        "type": "object"
      },
      "HubPlan": {
        "description": "A proposed change (ADR-0052). A money plan's approval echoes plan_hash, monthly_max_minor and currency.",
        "properties": {
          "ads": {
            "$ref": "#/components/schemas/HubAdsLaunch"
          },
          "approved_at": {
            "format": "date-time",
            "type": "string"
          },
          "approved_by": {
            "properties": {
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "kind": {
                "enum": [
                  "operator",
                  "api_key",
                  "platform",
                  "token",
                  "system"
                ],
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          "budget": {
            "$ref": "#/components/schemas/HubBudgetPolicy"
          },
          "change": {
            "$ref": "#/components/schemas/HubAdsChange"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "properties": {
              "id": {
                "format": "int64",
                "type": "integer"
              },
              "kind": {
                "enum": [
                  "operator",
                  "api_key",
                  "platform",
                  "token",
                  "system"
                ],
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          "currency": {
            "type": "string"
          },
          "daily_max_minor": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "increases_spend": {
            "description": "The plan can raise spend: its approval needs ads.spend, a signed-in person and COS_ADS_SPEND=on.",
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "budget_policy",
              "ads_launch",
              "ads_resume",
              "ads_budget"
            ],
            "type": "string"
          },
          "monthly_max_minor": {
            "format": "int64",
            "type": "integer"
          },
          "needs_right": {
            "enum": [
              "marketing.write",
              "ads.spend"
            ],
            "type": "string"
          },
          "plan_hash": {
            "type": "string"
          },
          "previous": {
            "$ref": "#/components/schemas/HubBudgetPolicy"
          },
          "source_version": {
            "description": "The version the plan was made against: the budget policy's (budget_policy, ads_launch) or the campaign's (ads_resume, ads_budget); 0: none.",
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "approved",
              "running",
              "done",
              "failed",
              "superseded"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "currency",
          "daily_max_minor",
          "monthly_max_minor",
          "increases_spend",
          "needs_right",
          "source_version",
          "plan_hash",
          "status",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "HubPlanInput": {
        "additionalProperties": false,
        "description": "budget_policy needs budget; ads_launch needs launch; ads_resume needs change.campaign_id; ads_budget needs change.campaign_id and change.daily_budget_minor.",
        "properties": {
          "budget": {
            "additionalProperties": false,
            "properties": {
              "auto_pause_on_cap": {
                "default": true,
                "type": "boolean"
              },
              "currency": {
                "pattern": "^[A-Za-z]{3}$",
                "type": "string"
              },
              "max_daily_minor": {
                "format": "int64",
                "type": "integer"
              },
              "monthly_cap_minor": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "currency",
              "monthly_cap_minor",
              "max_daily_minor"
            ],
            "type": "object"
          },
          "change": {
            "additionalProperties": false,
            "properties": {
              "campaign_id": {
                "format": "int64",
                "type": "integer"
              },
              "daily_budget_minor": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "campaign_id"
            ],
            "type": "object"
          },
          "kind": {
            "enum": [
              "budget_policy",
              "ads_launch",
              "ads_resume",
              "ads_budget"
            ],
            "type": "string"
          },
          "launch": {
            "$ref": "#/components/schemas/HubLaunchInput"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "HubPlanView": {
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/HubPlan"
          },
          "run": {
            "$ref": "#/components/schemas/HubRun"
          }
        },
        "required": [
          "plan"
        ],
        "type": "object"
      },
      "HubPreflight": {
        "description": "The check before a launch. Writes nothing; Google is asked with validate_only; Microsoft Advertising's and Yandex Direct's account, location and limits are read.",
        "properties": {
          "can_approve": {
            "type": "boolean"
          },
          "cap_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "daily_max_minor": {
            "format": "int64",
            "type": "integer"
          },
          "engine": {
            "description": "The engine a refusal is about.",
            "type": "string"
          },
          "launch": {
            "$ref": "#/components/schemas/HubAdsLaunch"
          },
          "launches": {
            "items": {
              "$ref": "#/components/schemas/HubAdsLaunch"
            },
            "type": "array"
          },
          "monthly_max_minor": {
            "description": "daily × 30.4: the amount the confirm card shows and the approval echoes.",
            "format": "int64",
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/HubAdProblem"
            },
            "type": "array"
          },
          "projected_monthly_minor": {
            "description": "Every running campaign plus this one, × 30.4.",
            "format": "int64",
            "type": "integer"
          },
          "refusal": {
            "enum": [
              "ADS_NO_BUDGET",
              "ADS_OVER_DAILY_MAX",
              "ADS_OVER_MONTHLY_CAP",
              "ADS_CAP_REACHED",
              "ADS_NOT_CONNECTED",
              "ADS_CURRENCY_MISMATCH"
            ],
            "type": "string"
          },
          "spend_enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "problems",
          "daily_max_minor",
          "monthly_max_minor",
          "projected_monthly_minor",
          "cap_minor",
          "spend_enabled",
          "can_approve",
          "launches"
        ],
        "type": "object"
      },
      "HubRefreshResult": {
        "properties": {
          "next_at": {
            "format": "date-time",
            "type": "string"
          },
          "queued": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "throttled": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "queued",
          "throttled"
        ],
        "type": "object"
      },
      "HubRun": {
        "properties": {
          "attempt": {
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "plan_id": {
            "format": "int64",
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "type": "string"
          },
          "steps": {
            "items": {
              "properties": {
                "action": {
                  "type": "string"
                },
                "finished_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "last_error": {
                  "description": "A refusal code (PLAN_STALE, ADS_SPEND_OFF).",
                  "type": "string"
                },
                "result": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "status": {
                  "enum": [
                    "pending",
                    "running",
                    "done",
                    "skipped",
                    "failed"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "key",
                "action",
                "status"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "plan_id",
          "status",
          "attempt",
          "steps"
        ],
        "type": "object"
      },
      "HubSetupStep": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "state": {
            "enum": [
              "ok",
              "error",
              "skipped"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubSocialReply": {
        "properties": {
          "text": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "type": "object"
      },
      "HubSocialSend": {
        "properties": {
          "lines": {
            "items": {
              "properties": {
                "quantity": {
                  "type": "integer"
                },
                "unit_price_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "variant_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "variant_id"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "text": {
            "description": "Words before the payment link.",
            "maxLength": 500,
            "type": "string"
          },
          "type": {
            "enum": [
              "product",
              "payment_link"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "HubTelegram": {
        "properties": {
          "account_id": {
            "description": "The bot's @username.",
            "type": "string"
          },
          "bot_name": {
            "type": "string"
          },
          "bot_username": {
            "type": "string"
          },
          "default_kinds": {
            "description": "What a newly linked chat hears.",
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "kinds": {
            "description": "Every kind a chat may hear, in display order.",
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "description": "A code the screen words (no_chat, webhook_failed, grant_expired).",
            "type": "string"
          },
          "provider": {
            "enum": [
              "telegram"
            ],
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/HubTelegramRecipient"
            },
            "type": "array"
          },
          "state": {
            "description": "One plain status; the screen words it, never shows it.",
            "enum": [
              "NOT_CONNECTED",
              "CONNECTED",
              "NEEDS_REAUTH",
              "NEEDS_PLATFORM_SETUP",
              "NEEDS_OWNER_ACTION",
              "UNAVAILABLE",
              "ERROR"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider",
          "state",
          "recipients",
          "kinds",
          "default_kinds"
        ],
        "type": "object"
      },
      "HubTelegramConnectInput": {
        "properties": {
          "token": {
            "description": "The bot token from @BotFather (a secret; never shown again). Empty: set the webhook again with the stored one.",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "HubTelegramKindsInput": {
        "properties": {
          "kinds": {
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "kinds"
        ],
        "type": "object"
      },
      "HubTelegramLink": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "group_url": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "group_url",
          "expires_at"
        ],
        "type": "object"
      },
      "HubTelegramRecipient": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "chat_type": {
            "enum": [
              "private",
              "group",
              "supergroup"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inactive_reason": {
            "description": "blocked: the person blocked the bot; left: the bot was removed from the group.",
            "enum": [
              "blocked",
              "left"
            ],
            "type": "string"
          },
          "kinds": {
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "linked_at": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "description": "A group's title, or the person's name and @username as Telegram shows them.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "chat_type",
          "active",
          "kinds",
          "linked_at"
        ],
        "type": "object"
      },
      "HubTelegramTestResult": {
        "properties": {
          "queued": {
            "type": "integer"
          }
        },
        "required": [
          "queued"
        ],
        "type": "object"
      },
      "HubTikTokAssets": {
        "description": "What the owner chooses from on TikTok, and what is chosen (pixel_id is the pixel's code).",
        "properties": {
          "chosen": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "pixels": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "pixels",
          "chosen"
        ],
        "type": "object"
      },
      "HubTikTokChoice": {
        "description": "The owner's TikTok choice. The pixel must be one TikTok lists for the advertiser; place_pixel and conversions are each the owner's explicit choice.",
        "properties": {
          "conversions": {
            "description": "Report paid orders to TikTok from the server (Events API), only for shoppers who allowed marketing cookies.",
            "type": "boolean"
          },
          "create_pixel": {
            "description": "With no pixel_id: make a pixel named after the store on the ad account (one of that name is adopted) and choose it.",
            "type": "boolean"
          },
          "pixel_id": {
            "description": "The pixel's code.",
            "type": "string"
          },
          "place_pixel": {
            "description": "Switch on the storefront's TikTok pixel (marketing cookies only).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "HubTikTokChoiceResult": {
        "properties": {
          "chosen": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "problems": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The parts that failed, by part (place_pixel): codes the admin words.",
            "type": "object"
          }
        },
        "required": [
          "chosen",
          "problems"
        ],
        "type": "object"
      },
      "HubTikTokFeed": {
        "properties": {
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "HubTile": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "has": {
            "type": "boolean"
          },
          "previous": {
            "description": "The same number for the period before; absent when not comparable.",
            "format": "int64",
            "type": "integer"
          },
          "value": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "value",
          "has"
        ],
        "type": "object"
      },
      "HubTopItem": {
        "properties": {
          "clicks": {
            "format": "int64",
            "type": "integer"
          },
          "impressions": {
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "page_views": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "type": "number"
          },
          "sessions": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "clicks",
          "impressions",
          "position"
        ],
        "type": "object"
      },
      "HubWASend": {
        "properties": {
          "lines": {
            "items": {
              "properties": {
                "quantity": {
                  "type": "integer"
                },
                "variant_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "text": {
            "type": "string"
          },
          "type": {
            "enum": [
              "product",
              "product_list",
              "catalog",
              "payment_link"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "HubWhatsApp": {
        "properties": {
          "account_id": {
            "description": "The number as WhatsApp shows it.",
            "type": "string"
          },
          "customer_notify": {
            "type": "boolean"
          },
          "day_templates": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "display_phone": {
            "type": "string"
          },
          "has_pin": {
            "type": "boolean"
          },
          "kinds": {
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "marketing_price_minor": {
            "description": "The owner's per-message price of a marketing template for the estimate, in minor units of price_currency; 0 shows the count only.",
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "description": "A code the screen words (meta_first, choose_number, webhook_failed, grant_expired, not_configured).",
            "type": "string"
          },
          "month_templates": {
            "type": "integer"
          },
          "name_status": {
            "type": "string"
          },
          "needs_register": {
            "description": "Meta answered 133010 (not registered on the Cloud API) on a send: the card offers \"Numarayı etkinleştir\".",
            "type": "boolean"
          },
          "pending": {
            "$ref": "#/components/schemas/HubWhatsAppPending"
          },
          "phone_number_id": {
            "type": "string"
          },
          "price_currency": {
            "type": "string"
          },
          "provider": {
            "enum": [
              "whatsapp"
            ],
            "type": "string"
          },
          "quality_rating": {
            "type": "string"
          },
          "staff": {
            "items": {
              "$ref": "#/components/schemas/HubWhatsAppStaff"
            },
            "type": "array"
          },
          "state": {
            "description": "One plain status; the screen words it, never shows it.",
            "enum": [
              "NOT_CONNECTED",
              "CONNECTED",
              "NEEDS_REAUTH",
              "NEEDS_PLATFORM_SETUP",
              "NEEDS_OWNER_ACTION",
              "UNAVAILABLE",
              "ERROR"
            ],
            "type": "string"
          },
          "subscribed": {
            "type": "boolean"
          },
          "template_cap": {
            "type": "integer"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/HubWhatsAppTemplate"
            },
            "type": "array"
          },
          "verified_name": {
            "type": "string"
          },
          "waba_id": {
            "type": "string"
          },
          "waba_name": {
            "type": "string"
          },
          "webhook_ready": {
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "state",
          "subscribed",
          "customer_notify",
          "template_cap",
          "month_templates",
          "day_templates",
          "templates",
          "staff",
          "kinds",
          "has_pin",
          "webhook_ready",
          "needs_register",
          "marketing_price_minor"
        ],
        "type": "object"
      },
      "HubWhatsAppAudience": {
        "properties": {
          "cap_left": {
            "description": "Template messages the monthly cap still allows.",
            "type": "integer"
          },
          "count": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "daily_limit": {
            "description": "Customers per 24 hours Meta's tier allows (as last read; 0 unknown).",
            "type": "integer"
          },
          "estimate_minor": {
            "description": "count × price_minor; 0 without a price.",
            "format": "int64",
            "type": "integer"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "price_minor",
          "estimate_minor",
          "cap_left",
          "daily_limit"
        ],
        "type": "object"
      },
      "HubWhatsAppAudienceFilter": {
        "properties": {
          "group_id": {
            "description": "Only this customer group.",
            "format": "int64",
            "type": "integer"
          },
          "ordered_within_days": {
            "description": "Only those who ordered in the last days.",
            "maximum": 3650,
            "minimum": 0,
            "type": "integer"
          },
          "product_id": {
            "description": "Only those who bought this product.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HubWhatsAppCampaign": {
        "properties": {
          "approved_at": {
            "format": "date-time",
            "type": "string"
          },
          "audience_count": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "estimate_minor": {
            "format": "int64",
            "type": "integer"
          },
          "filter": {
            "$ref": "#/components/schemas/HubWhatsAppAudienceFilter"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "header_url": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "next_batch_at": {
            "format": "date-time",
            "type": "string"
          },
          "params": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "report": {
            "$ref": "#/components/schemas/HubWhatsAppCampaignReport"
          },
          "status": {
            "enum": [
              "draft",
              "sending",
              "done",
              "cancelled",
              "stopped"
            ],
            "type": "string"
          },
          "stop_reason": {
            "description": "spend_off, cap, template_not_approved or no_number.",
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "template",
          "params",
          "filter",
          "audience_count",
          "price_minor",
          "estimate_minor",
          "status",
          "created_at",
          "report"
        ],
        "type": "object"
      },
      "HubWhatsAppCampaignInput": {
        "properties": {
          "filter": {
            "$ref": "#/components/schemas/HubWhatsAppAudienceFilter"
          },
          "header_image_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "params": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "template": {
            "description": "An approved MARKETING template.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "template"
        ],
        "type": "object"
      },
      "HubWhatsAppCampaignReport": {
        "properties": {
          "delivered": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "read": {
            "type": "integer"
          },
          "recipients": {
            "type": "integer"
          },
          "replies": {
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "waiting": {
            "type": "integer"
          }
        },
        "required": [
          "recipients",
          "waiting",
          "sent",
          "delivered",
          "read",
          "failed",
          "skipped",
          "replies"
        ],
        "type": "object"
      },
      "HubWhatsAppCampaigns": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HubWhatsAppCampaign"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "HubWhatsAppChoice": {
        "properties": {
          "phone_number_id": {
            "type": "string"
          },
          "waba_id": {
            "type": "string"
          }
        },
        "required": [
          "waba_id",
          "phone_number_id"
        ],
        "type": "object"
      },
      "HubWhatsAppChoiceResult": {
        "properties": {
          "problems": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "view": {
            "$ref": "#/components/schemas/HubWhatsApp"
          }
        },
        "required": [
          "view",
          "problems"
        ],
        "type": "object"
      },
      "HubWhatsAppConversation": {
        "properties": {
          "ad_headline": {
            "description": "That ad's headline.",
            "type": "string"
          },
          "from_ad": {
            "description": "Whether the conversation came from a click-to-WhatsApp ad (\"Reklamdan geldi\").",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_message_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "preview": {
            "type": "string"
          },
          "unread": {
            "type": "integer"
          },
          "window_open": {
            "type": "boolean"
          },
          "window_until": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "phone",
          "name",
          "last_message_at",
          "unread",
          "window_open",
          "preview",
          "from_ad"
        ],
        "type": "object"
      },
      "HubWhatsAppConversations": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/HubWhatsAppConversation"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total"
        ],
        "type": "object"
      },
      "HubWhatsAppMessage": {
        "properties": {
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "direction": {
            "enum": [
              "in",
              "out"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "text",
              "template",
              "other"
            ],
            "type": "string"
          },
          "purpose": {
            "enum": [
              "inbound",
              "reply",
              "order",
              "staff",
              "commercial"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "enum": [
              "received",
              "queued",
              "accepted",
              "sent",
              "delivered",
              "read",
              "failed",
              "skipped",
              "unknown"
            ],
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "kind",
          "body",
          "purpose",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "HubWhatsAppNewNumber": {
        "properties": {
          "cc": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "verified_name": {
            "type": "string"
          }
        },
        "required": [
          "phone"
        ],
        "type": "object"
      },
      "HubWhatsAppNumber": {
        "properties": {
          "code_verification_status": {
            "type": "string"
          },
          "display_phone": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name_status": {
            "type": "string"
          },
          "quality_rating": {
            "type": "string"
          },
          "verified_name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_phone",
          "verified_name",
          "quality_rating",
          "code_verification_status",
          "name_status"
        ],
        "type": "object"
      },
      "HubWhatsAppNumbers": {
        "properties": {
          "accounts": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "numbers": {
                  "items": {
                    "$ref": "#/components/schemas/HubWhatsAppNumber"
                  },
                  "type": "array"
                }
              },
              "required": [
                "id",
                "name",
                "numbers"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "accounts"
        ],
        "type": "object"
      },
      "HubWhatsAppPIN": {
        "properties": {
          "pin": {
            "description": "The six-digit two-step verification PIN, shown this once.",
            "type": "string"
          },
          "view": {
            "$ref": "#/components/schemas/HubWhatsApp"
          }
        },
        "required": [
          "pin",
          "view"
        ],
        "type": "object"
      },
      "HubWhatsAppPending": {
        "properties": {
          "display_phone": {
            "type": "string"
          },
          "name_status": {
            "type": "string"
          },
          "phone_number_id": {
            "type": "string"
          },
          "step": {
            "enum": [
              "added",
              "code_sent",
              "verified"
            ],
            "type": "string"
          },
          "verified_name": {
            "type": "string"
          }
        },
        "required": [
          "phone_number_id",
          "display_phone",
          "verified_name",
          "step"
        ],
        "type": "object"
      },
      "HubWhatsAppReply": {
        "properties": {
          "params": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "template": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubWhatsAppSendInput": {
        "properties": {
          "confirm_count": {
            "description": "The recipient count the person was shown; a different audience now is COUNT_CHANGED.",
            "type": "integer"
          }
        },
        "required": [
          "confirm_count"
        ],
        "type": "object"
      },
      "HubWhatsAppSettings": {
        "properties": {
          "customer_notify": {
            "type": "boolean"
          },
          "marketing_price_minor": {
            "format": "int64",
            "maximum": 100000000,
            "minimum": 0,
            "type": "integer"
          },
          "price_currency": {
            "description": "ISO 4217, or empty.",
            "type": "string"
          },
          "template_cap": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "HubWhatsAppStaff": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kinds": {
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "label": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "window_open": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "phone",
          "label",
          "kinds",
          "active",
          "window_open"
        ],
        "type": "object"
      },
      "HubWhatsAppStaffInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "kinds": {
            "items": {
              "enum": [
                "order_new",
                "order_paid",
                "owner_request",
                "ads_cap",
                "connection",
                "contact_message"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "label": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "HubWhatsAppTemplate": {
        "properties": {
          "body": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "header": {
            "description": "IMAGE for a template with a picture on top; absent when none.",
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "opt_out": {
            "description": "Whether it carries the quick-reply button \"Pazarlama mesajı istemem\".",
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "standard": {
            "type": "boolean"
          },
          "status": {
            "description": "Meta's review: APPROVED, PENDING, REJECTED, PAUSED, DISABLED, or empty for a standard template not submitted yet.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "language",
          "category",
          "status",
          "body",
          "standard"
        ],
        "type": "object"
      },
      "HubWhatsAppTemplateInput": {
        "description": "A marketing template written in the panel (ADR-0059); NeroCart adds the footer \"Mesaj almak istemiyorsanız DUR yazın.\" and, unless opt_out_button is false, the quick-reply button \"Pazarlama mesajı istemem\", then submits it to Meta.",
        "properties": {
          "body": {
            "description": "Turkish text; {{1}}, {{2}}, … in order, not at the very start or end.",
            "maxLength": 1024,
            "type": "string"
          },
          "button_text": {
            "maxLength": 25,
            "type": "string"
          },
          "button_url": {
            "description": "An optional https link button.",
            "type": "string"
          },
          "examples": {
            "description": "One sample per variable.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "header_image_url": {
            "description": "An optional https JPEG or PNG picture on top.",
            "type": "string"
          },
          "name": {
            "pattern": "^[a-z0-9_]{1,512}$",
            "type": "string"
          },
          "opt_out_button": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "body"
        ],
        "type": "object"
      },
      "HubWhatsAppThread": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HubWhatsAppConversation"
          },
          {
            "properties": {
              "messages": {
                "items": {
                  "$ref": "#/components/schemas/HubWhatsAppMessage"
                },
                "type": "array"
              },
              "templates": {
                "items": {
                  "$ref": "#/components/schemas/HubWhatsAppTemplate"
                },
                "type": "array"
              }
            },
            "required": [
              "messages",
              "templates"
            ],
            "type": "object"
          }
        ]
      },
      "IconLookPreset": {
        "properties": {
          "id": {
            "type": "string"
          },
          "look": {
            "$ref": "#/components/schemas/BuilderIconLook"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ImageGenInput": {
        "properties": {
          "aspect": {
            "enum": [
              "1:1",
              "16:9",
              "3:2",
              "2:3"
            ],
            "type": "string"
          },
          "count": {
            "maximum": 4,
            "minimum": 1,
            "type": "integer"
          },
          "kind": {
            "enum": [
              "logo",
              "banner"
            ],
            "type": "string"
          },
          "prompt": {
            "maxLength": 800,
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "style": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "prompt",
          "provider"
        ],
        "type": "object"
      },
      "ImageGenResult": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Media"
            },
            "type": "array"
          },
          "monthly_limit": {
            "type": "integer"
          },
          "used_this_month": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "used_this_month",
          "monthly_limit"
        ],
        "type": "object"
      },
      "ImageGenStatus": {
        "properties": {
          "aspects": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "monthly_limit": {
            "type": "integer"
          },
          "providers": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "configured": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name",
                "configured"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "ready": {
            "type": "boolean"
          },
          "styles": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "used_this_month": {
            "type": "integer"
          }
        },
        "required": [
          "providers",
          "ready",
          "monthly_limit",
          "used_this_month",
          "styles",
          "aspects"
        ],
        "type": "object"
      },
      "ImportJob": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_email": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "format": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "products",
              "translations",
              "inventory",
              "categories",
              "customers"
            ],
            "type": "string"
          },
          "options": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "What the upload said besides the file: `reason_code` (stock), `consent_note` (customers).",
            "type": "object"
          },
          "overwrite": {
            "type": "boolean"
          },
          "report": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ImportResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ImportResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "rows_done": {
            "type": "integer"
          },
          "rows_total": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "validating",
              "validated",
              "applying",
              "applied",
              "failed",
              "cancelled"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ImportPlanItem": {
        "description": "One row a dry run would write: a product (`slug`, `variants`), or for the other kinds the row's `key` — `sku@location`, a category path, a customer's address — and `detail`, a short account of the change.",
        "properties": {
          "action": {
            "enum": [
              "create",
              "update"
            ],
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "entity": {
            "description": "Translation files: the record.",
            "enum": [
              "product",
              "collection",
              "category"
            ],
            "type": "string"
          },
          "fields": {
            "description": "Translation files: how many fields the file sets.",
            "type": "integer"
          },
          "id": {
            "description": "Translation files: the record id.",
            "format": "int64",
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "language": {
            "description": "Translation files: the language.",
            "type": "string"
          },
          "line": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "variants": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ImportResult": {
        "properties": {
          "created": {
            "type": "integer"
          },
          "dry_run": {
            "type": "boolean"
          },
          "duration": {
            "type": "string"
          },
          "errors": {
            "items": {
              "properties": {
                "line": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "format": {
            "description": "The dialect the file turned out to be in.",
            "enum": [
              "nerocart",
              "shopify",
              "translations"
            ],
            "type": "string"
          },
          "plan": {
            "description": "A dry run's product-by-product account, at most 1000 entries.",
            "items": {
              "$ref": "#/components/schemas/ImportPlanItem"
            },
            "type": "array"
          },
          "plan_truncated": {
            "type": "boolean"
          },
          "skipped": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "warnings": {
            "description": "Advisory findings that do not stop a row: a translation file's glossary warnings, by line.",
            "items": {
              "properties": {
                "line": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "InstallmentQuote": {
        "description": "What a card may be split into for an amount, as the payment provider quotes it (ADR-0023).",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "bank_name": {
            "type": "string"
          },
          "bin": {
            "description": "The card's first six digits, as asked about.",
            "type": "string"
          },
          "card_association": {
            "type": "string"
          },
          "card_family": {
            "type": "string"
          },
          "card_type": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "force_3ds": {
            "description": "The card must go through 3-D Secure.",
            "type": "boolean"
          },
          "options": {
            "items": {
              "properties": {
                "count": {
                  "type": "integer"
                },
                "installment_minor": {
                  "description": "Each installment.",
                  "format": "int64",
                  "type": "integer"
                },
                "provider": {
                  "description": "The POS that takes this count, in the one table of a routing store's card choice (card_router, ADR-0140); omitted otherwise.",
                  "type": "string"
                },
                "total_minor": {
                  "description": "What the shopper pays in all; above amount_minor by the installment charge when the shopper pays it.",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "provider": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "InventorySettings": {
        "properties": {
          "low_stock_threshold": {
            "minimum": 0,
            "type": "integer"
          },
          "reason_codes": {
            "items": {
              "enum": [
                "counted",
                "received",
                "damaged",
                "lost",
                "returned",
                "correction",
                "other"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "low_stock_threshold",
          "reason_codes"
        ],
        "type": "object"
      },
      "Invitation": {
        "description": "An invitation to join the team. The alternative it replaces is an owner inventing somebody else's password and then telling it to them, which means two people know it from the moment it exists.",
        "properties": {
          "accept_url": {
            "description": "The link to send, built from the request so it resolves from wherever the store is actually reached. Present with `token` and just as briefly.",
            "type": "string"
          },
          "accepted_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivery": {
            "description": "On the response that created the invitation only: email when the invitation was emailed to the invitee (an email backend such as the SMTP module is set up), none when accept_url has to be passed on by hand.",
            "enum": [
              "email",
              "none"
            ],
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "existing_account": {
            "description": "On the public lookup only: the address already signs in to NeroCart, so joining takes that account's password, not a new one.",
            "type": "boolean"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "invited_by": {
            "description": "The inviter's email. Empty when the static admin token issued it, which has no person behind it.",
            "type": "string"
          },
          "invited_by_id": {
            "format": "int64",
            "type": "integer"
          },
          "rights": {
            "description": "What the role carries. Sent so the person deciding to invite can see what they are handing over.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "role": {
            "description": "A system role (owner, manager, staff) or a custom role's key.",
            "type": "string"
          },
          "status": {
            "description": "Expiry is a fact about now rather than a column, so it is resolved on the way out.",
            "enum": [
              "pending",
              "accepted",
              "expired"
            ],
            "type": "string"
          },
          "token": {
            "description": "The secret, present on the creating response and never again — only its SHA-256 is stored. Losing it means issuing a new invitation.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Invoice": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "buyer_alias": {
            "type": "string"
          },
          "cancel_deadline": {
            "description": "8 days from delivery (from issue when delivery is unknown).",
            "format": "date-time",
            "type": "string"
          },
          "cancel_reason": {
            "type": "string"
          },
          "cancel_reference": {
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "carrier_name": {
            "type": "string"
          },
          "carrier_tax_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dispatched_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "ettn": {
            "description": "The invoice UUID; deterministic per invoice, the idempotency key of every send.",
            "format": "uuid",
            "type": "string"
          },
          "exchange_rate": {
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "issued_at": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "enum": [
              "",
              "e_arsiv",
              "e_fatura"
            ],
            "type": "string"
          },
          "number": {
            "description": "The integrator's legal invoice number — never the order number.",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "pdf_url": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_status": {
            "type": "string"
          },
          "return_documents": {
            "items": {
              "$ref": "#/components/schemas/InvoiceReturnDocument"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "pending",
              "sent",
              "issued",
              "failed",
              "rejected",
              "cancelled"
            ],
            "type": "string"
          },
          "tax": {
            "$ref": "#/components/schemas/Money"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "InvoiceItem": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customs": {
            "description": "The goods description on customs papers (HERBAL TEA); empty: the name.",
            "type": "string"
          },
          "hs_code": {
            "description": "The tariff number (GTİP, 6–12 digits); empty: each product's own.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "description": "What the invoice says (BİTKİSEL ÇAY).",
            "type": "string"
          },
          "products": {
            "description": "How many of the store's products are invoiced as it.",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "customs",
          "hs_code",
          "products",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "InvoiceItemAssignInput": {
        "properties": {
          "item_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "product_ids",
          "item_id"
        ],
        "type": "object"
      },
      "InvoiceItemAssignment": {
        "properties": {
          "item_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "product_id",
          "item_id"
        ],
        "type": "object"
      },
      "InvoiceItemInput": {
        "properties": {
          "customs": {
            "type": "string"
          },
          "hs_code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "InvoiceReturnDocument": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "document_date": {
            "format": "date",
            "type": "string"
          },
          "document_number": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "buyer_return_invoice",
              "expense_slip",
              "other"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "return_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "InvoiceReturnDocumentInput": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "document_date": {
            "format": "date",
            "type": "string"
          },
          "document_number": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "buyer_return_invoice",
              "expense_slip",
              "other"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "return_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "document_number",
          "document_date"
        ],
        "type": "object"
      },
      "InvoicingSettings": {
        "properties": {
          "auto_issue": {
            "description": "Issue when an order's last parcel ships.",
            "type": "boolean"
          },
          "carriers": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CarrierIdentity"
            },
            "description": "Carrier code → unvan and VKN, printed on an internet-sale invoice.",
            "type": "object"
          },
          "consumer_tax_id": {
            "type": "string"
          },
          "default_carrier": {
            "description": "The carrier an invoice issued at payment names: a code of carriers, or a known one (ups).",
            "type": "string"
          },
          "despatch_note": {
            "description": "Print 'İrsaliye yerine geçer' so the printout travels in the parcel.",
            "type": "boolean"
          },
          "export_exemption_code": {
            "description": "The KDV exemption of an order delivered abroad without KDV (default 301, 11/1-a mal ihracatı).",
            "type": "string"
          },
          "export_freight": {
            "description": "A fixed freight in the order's currency an export invoice shows as a NAVLUN line, the goods being the rest of what the buyer paid; empty: the shipping the order charged.",
            "type": "string"
          },
          "export_note": {
            "description": "Words every export invoice carries, such as 'Menşe: Türkiye Teslim Şekli: CPT'.",
            "type": "string"
          },
          "foreign_tax_id": {
            "type": "string"
          },
          "issue_on": {
            "description": "When an invoice is issued: the last parcel shipped, or the payment taken (the carrier's customs invoice then names it).",
            "enum": [
              "shipped",
              "paid"
            ],
            "type": "string"
          },
          "merge_items": {
            "description": "Lines invoiced under one name (an invoice item) are one line.",
            "type": "boolean"
          },
          "payment_methods": {
            "additionalProperties": {
              "enum": [
                "KREDIKARTI/BANKAKARTI",
                "EFT/HAVALE",
                "KAPIDAODEME",
                "ODEMEARACISI",
                "DIGER"
              ],
              "type": "string"
            },
            "type": "object"
          },
          "provider": {
            "description": "Empty: the only installed provider.",
            "type": "string"
          },
          "zero_rate_exemption_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "InvoicingStatus": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "providers": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "configured": {
                  "type": "boolean"
                },
                "issues_export": {
                  "description": "The integrator can issue export (İHRACAT) e-Fatura invoices.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "settings": {
            "$ref": "#/components/schemas/InvoicingSettings"
          }
        },
        "type": "object"
      },
      "Job": {
        "description": "One background job (ADR-0014).",
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "correlation_id": {
            "description": "The request that enqueued it; its handler runs under the same request id.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "known": {
            "description": "This build registers a handler for the type.",
            "type": "boolean"
          },
          "last_error": {
            "type": "string"
          },
          "lease_until": {
            "format": "date-time",
            "type": "string"
          },
          "max_attempts": {
            "type": "integer"
          },
          "payload": {
            "description": "On the single-job read only, redacted: the JSON the job was enqueued with, usually an object of ids."
          },
          "priority": {
            "type": "integer"
          },
          "recurring": {
            "description": "The type is scheduled.",
            "type": "boolean"
          },
          "run_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "dead",
              "cancelled"
            ],
            "type": "string"
          },
          "store_id": {
            "description": "The store it was enqueued for; null for tenant-wide work.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "status",
          "store_id",
          "priority",
          "run_at",
          "attempts",
          "max_attempts",
          "created_at",
          "recurring",
          "known"
        ],
        "type": "object"
      },
      "KDVCategory": {
        "description": "An entry of the platform's KDV list (ADR-0147): a group (no rate) or a kind of goods with its Turkish KDV rate and legal basis.",
        "properties": {
          "basis": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "confidence": {
            "enum": [
              "kesin",
              "kontrol"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "parent_code": {
            "type": "string"
          },
          "rate_bp": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "code",
          "parent_code",
          "name",
          "rate_bp",
          "basis",
          "confidence",
          "note"
        ],
        "type": "object"
      },
      "KDVClass": {
        "description": "A store's KDV class: from the platform list (kdv_code) or the merchant's own.",
        "properties": {
          "basis": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "confidence": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kdv_code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "rate_bp": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "rate_bp",
          "kdv_code",
          "basis",
          "confidence",
          "note"
        ],
        "type": "object"
      },
      "KDVClassInput": {
        "description": "kdv_code picks an entry of the list; otherwise name and rate_bp make the merchant's own class.",
        "properties": {
          "kdv_code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rate_bp": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "KYCDocument": {
        "properties": {
          "checks": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "file: ok, small or unreadable; tax_number, title, iban: match, mismatch or not_found (absent when it does not apply). Verdicts only, never the values.",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_on": {
            "format": "date",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "mime": {
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png"
            ],
            "type": "string"
          },
          "ocr_status": {
            "description": "unavailable: this server cannot read documents; a person checks it by eye.",
            "enum": [
              "pending",
              "done",
              "unavailable",
              "failed"
            ],
            "type": "string"
          },
          "pages": {
            "type": "integer"
          },
          "reject_reason": {
            "type": "string"
          },
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "uploaded",
              "checking",
              "approved",
              "rejected"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "filename",
          "mime",
          "size_bytes",
          "status",
          "ocr_status",
          "pages",
          "checks",
          "created_at"
        ],
        "type": "object"
      },
      "KitApplied": {
        "properties": {
          "styles": {
            "type": "boolean"
          },
          "template": {
            "$ref": "#/components/schemas/BuilderTemplate"
          }
        },
        "required": [
          "styles",
          "template"
        ],
        "type": "object"
      },
      "KitApplyInput": {
        "properties": {
          "lang": {
            "type": "string"
          },
          "styles": {
            "description": "Write the kit's global styles into the theme draft (default true).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "KitBundle": {
        "properties": {
          "buttons": {
            "$ref": "#/components/schemas/ThemeButtons"
          },
          "format": {
            "enum": [
              "nerocart.kit"
            ],
            "type": "string"
          },
          "global_styles": {
            "$ref": "#/components/schemas/ThemeGlobalStyles"
          },
          "name": {
            "type": "string"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/KitBundleTemplate"
            },
            "maxItems": 20,
            "type": "array"
          },
          "version": {
            "enum": [
              1
            ],
            "type": "integer"
          }
        },
        "required": [
          "format",
          "version",
          "name",
          "templates"
        ],
        "type": "object"
      },
      "KitBundleTemplate": {
        "properties": {
          "category": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "layout",
              "page"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "kind",
          "sections"
        ],
        "type": "object"
      },
      "KitExportInput": {
        "properties": {
          "lang": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "refs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "styles": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "KitImportInput": {
        "properties": {
          "bundle": {
            "$ref": "#/components/schemas/KitBundle"
          },
          "styles": {
            "type": "boolean"
          }
        },
        "required": [
          "bundle"
        ],
        "type": "object"
      },
      "KitImportLog": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "missing": {
            "items": {
              "$ref": "#/components/schemas/KitMissingPicture"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "enum": [
              "file",
              "kit"
            ],
            "type": "string"
          },
          "styles": {
            "type": "boolean"
          },
          "templates": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "KitImported": {
        "properties": {
          "missing": {
            "items": {
              "$ref": "#/components/schemas/KitMissingPicture"
            },
            "type": "array"
          },
          "styles": {
            "type": "boolean"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/BuilderTemplate"
            },
            "type": "array"
          }
        },
        "required": [
          "templates",
          "styles",
          "missing"
        ],
        "type": "object"
      },
      "KitMissingPicture": {
        "properties": {
          "block_id": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "file": {
            "type": "string"
          },
          "section_id": {
            "type": "string"
          },
          "template": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LandedCost": {
        "description": "A landed-cost estimate (ADR-0123): customs duty and import VAT for one basket, destination and delivery charge, in the basket's currency.",
        "properties": {
          "applies": {
            "description": "False when no customs border is crossed (same country, or within the EU).",
            "type": "boolean"
          },
          "assumptions": {
            "description": "Stable codes of the assumptions made (ADR-0123 §2).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "duty": {
            "$ref": "#/components/schemas/Money"
          },
          "duty_lines": {
            "items": {
              "$ref": "#/components/schemas/LandedDuty"
            },
            "type": "array"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "import_vat": {
            "$ref": "#/components/schemas/Money"
          },
          "intrinsic_eur_cents": {
            "description": "The goods' value in euro cents, when the store has the exchange rate.",
            "format": "int64",
            "type": "integer"
          },
          "low_value_rule": {
            "description": "The EU low-value rule that decided the duty.",
            "enum": [
              "relief",
              "flat_fee",
              "preferential",
              "none",
              "rate_unknown",
              "not_eu"
            ],
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "region": {
            "enum": [
              "domestic",
              "intra_eu",
              "eu",
              "other"
            ],
            "type": "string"
          },
          "shipping": {
            "$ref": "#/components/schemas/Money"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "vat_in_order_tax": {
            "$ref": "#/components/schemas/Money"
          },
          "vat_lines": {
            "items": {
              "$ref": "#/components/schemas/LandedVATRow"
            },
            "type": "array"
          },
          "vat_source": {
            "enum": [
              "store",
              "eu_standard",
              "unknown"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "LandedCostPreviewInput": {
        "properties": {
          "country": {
            "description": "ISO 3166-1 alpha-2 destination.",
            "type": "string"
          },
          "price_minor": {
            "description": "A unit price instead of the variant's base price.",
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "description": "Default 1.",
            "minimum": 0,
            "type": "integer"
          },
          "settings": {
            "$ref": "#/components/schemas/CrossBorderSettings"
          },
          "shipping_minor": {
            "format": "int64",
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "country",
          "variant_id"
        ],
        "type": "object"
      },
      "LandedDuty": {
        "properties": {
          "base_minor": {
            "format": "int64",
            "type": "integer"
          },
          "duty_minor": {
            "format": "int64",
            "type": "integer"
          },
          "hs_code": {
            "type": "string"
          },
          "rate_bp": {
            "type": "integer"
          },
          "ref": {
            "type": "string"
          },
          "rule": {
            "description": "The duty rule's prefix that matched; \"\" the default rate, \"flat_fee\" the EU's €3, \"relief\" none under the low-value relief.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LandedVATRow": {
        "properties": {
          "base_minor": {
            "format": "int64",
            "type": "integer"
          },
          "rate_bp": {
            "type": "integer"
          },
          "ref": {
            "type": "string"
          },
          "vat_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LaunchChecklist": {
        "properties": {
          "done": {
            "type": "integer"
          },
          "hidden": {
            "description": "Whether the operator put the checklist away on the home screen.",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/LaunchItem"
            },
            "type": "array"
          },
          "ready": {
            "type": "boolean"
          },
          "required": {
            "type": "integer"
          }
        },
        "required": [
          "ready",
          "done",
          "required",
          "items",
          "hidden"
        ],
        "type": "object"
      },
      "LaunchChecklistVisibility": {
        "properties": {
          "hidden": {
            "description": "True puts the checklist away; false shows it again.",
            "type": "boolean"
          }
        },
        "required": [
          "hidden"
        ],
        "type": "object"
      },
      "LaunchItem": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "key": {
            "enum": [
              "store_details",
              "tax_rate",
              "shipping",
              "payment",
              "legal_texts",
              "product",
              "domain",
              "email",
              "iys",
              "sms"
            ],
            "type": "string"
          },
          "missing": {
            "description": "What is still missing, as codes (profile fields, legal kinds).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "not_required": {
            "description": "Done because the store does not need it: shipping, when every active product is never sent (ADR-0045).",
            "type": "boolean"
          },
          "optional": {
            "description": "Optional items do not count towards ready.",
            "type": "boolean"
          },
          "path": {
            "description": "The merchant admin screen that fixes it.",
            "type": "string"
          },
          "status": {
            "enum": [
              "done",
              "todo",
              "in_progress"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "status",
          "optional",
          "count",
          "path"
        ],
        "type": "object"
      },
      "LayoutConversion": {
        "properties": {
          "notes": {
            "items": {
              "properties": {
                "block_id": {
                  "type": "string"
                },
                "note": {
                  "description": "section_css: the section's own CSS was written for the columns; widths_unused: the width preset is for another number of columns; heading_size: a heading's size became the nearest text size; heading_group: a heading's eyebrow and subtitle became texts in a group with it; empty_dropped: an empty row of buttons was left out.",
                  "enum": [
                    "section_css",
                    "widths_unused",
                    "heading_size",
                    "heading_group",
                    "empty_dropped"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "section": {
            "$ref": "#/components/schemas/TemplateSection"
          }
        },
        "required": [
          "section"
        ],
        "type": "object"
      },
      "LedgerPayment": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "amount_mismatch": {
            "type": "boolean"
          },
          "attention": {
            "description": "Why it needs a look, when it does.",
            "enum": [
              "amount_mismatch",
              "left_authorized",
              "waiting_too_long"
            ],
            "type": "string"
          },
          "captured": {
            "$ref": "#/components/schemas/Money"
          },
          "commission": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Estimated from the routing's rates; absent without a rate."
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "installments": {
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "refunded": {
            "$ref": "#/components/schemas/Money"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "order_number",
          "provider",
          "provider_name",
          "status",
          "amount",
          "captured",
          "refunded",
          "created_at"
        ],
        "type": "object"
      },
      "LegalAcceptance": {
        "properties": {
          "accepted_at": {
            "format": "date-time",
            "type": "string"
          },
          "document_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "language_fallback": {
            "description": "True when the text kept is in another language than the order's, because the store had no text of this kind in it (English, then the store's default language, is used).",
            "type": "boolean"
          },
          "order_language": {
            "description": "The language the order was placed in.",
            "type": "string"
          },
          "rendered": {
            "description": "The text as accepted; only on the acceptance routes.",
            "type": "string"
          },
          "snapshot_sha256": {
            "description": "SHA-256 of the text as rendered for this order.",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LegalAcceptanceInput": {
        "properties": {
          "document_id": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "description": "The version the shopper was shown; a newer published one answers 409.",
            "type": "integer"
          }
        },
        "required": [
          "document_id"
        ],
        "type": "object"
      },
      "LegalDocument": {
        "properties": {
          "body": {
            "description": "Text with {{placeholders}}. For a document written with the block editor (body_doc), the plain text derived from it — what an order accepts and hashes.",
            "type": "string"
          },
          "body_doc": {
            "additionalProperties": true,
            "description": "A TipTap / ProseMirror JSON document under the \"legal\" rich-text profile (kernel/core/richtext_profiles.json, ADR-0086): clauses numbered by attrs.clauses (decimal or madde), definitions, tables, notices, a table of contents and placeholder nodes. Absent for a text written as plain text.",
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "distance_sales",
              "preliminary_info",
              "kvkk_notice",
              "cookie_policy",
              "return_policy",
              "privacy_policy",
              "terms_of_use",
              "delivery_terms",
              "explicit_consent",
              "commercial_messages",
              "subscription_terms",
              "data_inventory"
            ],
            "type": "string"
          },
          "language": {
            "enum": [
              "tr",
              "en",
              "de"
            ],
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "required_at_checkout": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "draft",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LegalDocumentInput": {
        "properties": {
          "body": {
            "type": "string"
          },
          "body_doc": {
            "additionalProperties": true,
            "description": "A TipTap / ProseMirror JSON document under the \"legal\" rich-text profile (kernel/core/richtext_profiles.json, ADR-0086): clauses numbered by attrs.clauses (decimal or madde), definitions, tables, notices, a table of contents and placeholder nodes. When given, body is derived from it (send body as \"\").",
            "type": "object"
          },
          "kind": {
            "enum": [
              "distance_sales",
              "preliminary_info",
              "kvkk_notice",
              "cookie_policy",
              "return_policy",
              "privacy_policy",
              "terms_of_use",
              "delivery_terms",
              "explicit_consent",
              "commercial_messages",
              "subscription_terms",
              "data_inventory"
            ],
            "type": "string"
          },
          "language": {
            "enum": [
              "tr",
              "en",
              "de"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "language",
          "title",
          "body"
        ],
        "type": "object"
      },
      "LegalDocumentPatch": {
        "properties": {
          "body": {
            "type": "string"
          },
          "body_doc": {
            "additionalProperties": true,
            "description": "The document (\"legal\" profile, ADR-0086): replaces the document and the plain text derived from it. null turns the draft back into plain text (keeping the text derived last). Sending body alone edits a plain-text draft and drops a document.",
            "type": [
              "object",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LegalEngineApplied": {
        "properties": {
          "document": {
            "$ref": "#/components/schemas/LegalDocument"
          },
          "engine_document": {
            "$ref": "#/components/schemas/LegalEngineDocument"
          }
        },
        "required": [
          "document",
          "engine_document"
        ],
        "type": "object"
      },
      "LegalEngineAuditInput": {
        "properties": {
          "document_id": {
            "description": "The legal text to audit.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "document_id"
        ],
        "type": "object"
      },
      "LegalEngineCategory": {
        "description": "A category and its legal class.",
        "properties": {
          "category_id": {
            "description": "0: the active products in no category.",
            "format": "int64",
            "type": "integer"
          },
          "class": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          },
          "confirmed": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "needs_review": {
            "description": "Unsure or with an obstacle, not yet confirmed by the owner.",
            "type": "boolean"
          },
          "obstacle": {
            "description": "Why it may not be sold online as it is (alcohol, tobacco, a missing permit).",
            "type": "string"
          },
          "products": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "samples": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secondary": {
            "type": "string"
          },
          "source": {
            "description": "ai or owner.",
            "type": "string"
          }
        },
        "required": [
          "category_id",
          "name",
          "products",
          "samples",
          "confidence",
          "confirmed",
          "needs_review"
        ],
        "type": "object"
      },
      "LegalEngineClassInfo": {
        "description": "One EK-C class.",
        "properties": {
          "code": {
            "type": "string"
          },
          "examples": {
            "type": "string"
          },
          "exception": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "examples",
          "exception"
        ],
        "type": "object"
      },
      "LegalEngineClassInput": {
        "properties": {
          "class": {
            "enum": [
              "DAYANIKLI",
              "GIDA",
              "HIJYEN",
              "KISIYE_OZEL",
              "DIJITAL",
              "MEDYA",
              "TARIHLI_HIZMET",
              "HIZMET",
              "ABONELIK",
              "IKINCI_EL",
              "AGIR_BUYUK",
              "YAS_SINIRLI",
              "IZINLI"
            ],
            "type": "string"
          },
          "secondary": {
            "description": "Another class, or empty.",
            "type": "string"
          }
        },
        "required": [
          "class"
        ],
        "type": "object"
      },
      "LegalEngineCompanyCheck": {
        "description": "EK-D R10: the store's details on the site.",
        "properties": {
          "basis": {
            "type": "string"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ok": {
            "type": "boolean"
          },
          "rule": {
            "type": "string"
          }
        },
        "required": [
          "rule",
          "basis",
          "ok",
          "missing"
        ],
        "type": "object"
      },
      "LegalEngineCounts": {
        "properties": {
          "met": {
            "type": "integer"
          },
          "missing": {
            "type": "integer"
          },
          "partial": {
            "type": "integer"
          }
        },
        "required": [
          "met",
          "partial",
          "missing"
        ],
        "type": "object"
      },
      "LegalEngineDocument": {
        "description": "One document of a pass: the draft (or the audited text) and its audit.",
        "properties": {
          "continuations": {
            "type": "integer"
          },
          "counts": {
            "$ref": "#/components/schemas/LegalEngineCounts"
          },
          "document_id": {
            "description": "The legal text the draft is (or became).",
            "format": "int64",
            "type": "integer"
          },
          "document_status": {
            "type": "string"
          },
          "document_version": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineFinding"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "placeholders": {
            "items": {
              "$ref": "#/components/schemas/LegalPlaceholder"
            },
            "type": "array"
          },
          "revised": {
            "type": "boolean"
          },
          "run_id": {
            "format": "int64",
            "type": "integer"
          },
          "run_kind": {
            "type": "string"
          },
          "score": {
            "description": "Weighted share of the items met, 0–100.",
            "type": "integer"
          },
          "source_document_id": {
            "description": "An audit's published text.",
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "queued",
              "writing",
              "auditing",
              "revising",
              "suggesting",
              "done",
              "failed"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "type_title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "run_id",
          "run_kind",
          "type",
          "type_title",
          "kind",
          "language",
          "status",
          "title",
          "revised",
          "continuations",
          "counts",
          "score",
          "findings",
          "placeholders",
          "updated_at"
        ],
        "type": "object"
      },
      "LegalEngineField": {
        "description": "A field the drafts leave for the owner.",
        "properties": {
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "owner": {
            "description": "The owner typed the value.",
            "type": "boolean"
          },
          "standard": {
            "type": "boolean"
          },
          "used_in": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "value": {
            "description": "What it will be filled with; empty: nothing yet.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "value",
          "owner",
          "used_in",
          "standard"
        ],
        "type": "object"
      },
      "LegalEngineFinding": {
        "description": "One checklist item's verdict.",
        "properties": {
          "applied": {
            "type": "boolean"
          },
          "basis": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "lehe",
              "aleyhe",
              "notr"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "paragraph": {
            "description": "The paragraph the finding is about, when one was found.",
            "type": "string"
          },
          "precheck": {
            "description": "Decided without the model (template residue).",
            "type": "boolean"
          },
          "question": {
            "type": "string"
          },
          "status": {
            "description": "TAMAM (met), EKSIK (there but short or against the rules), YOK (missing).",
            "enum": [
              "TAMAM",
              "EKSIK",
              "YOK"
            ],
            "type": "string"
          },
          "suggestion": {
            "$ref": "#/components/schemas/LegalSuggestion"
          },
          "tries": {
            "type": "integer"
          },
          "weight": {
            "type": "integer"
          }
        },
        "required": [
          "code",
          "status",
          "direction",
          "note"
        ],
        "type": "object"
      },
      "LegalEngineObstacle": {
        "properties": {
          "category_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "category_id",
          "reason"
        ],
        "type": "object"
      },
      "LegalEnginePlan": {
        "description": "The last BELGE PLANI, settled against EK-D.",
        "properties": {
          "classes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "company": {
            "$ref": "#/components/schemas/LegalEngineCompanyCheck"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/LegalEnginePlanDoc"
            },
            "type": "array"
          },
          "obstacles": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineObstacle"
            },
            "type": "array"
          },
          "profile": {
            "$ref": "#/components/schemas/LegalEngineProfile"
          }
        },
        "required": [
          "profile",
          "classes",
          "documents",
          "obstacles",
          "company",
          "created_at"
        ],
        "type": "object"
      },
      "LegalEnginePlanDoc": {
        "description": "One planned document.",
        "properties": {
          "basis": {
            "type": "string"
          },
          "excluded": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "included": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "level": {
            "enum": [
              "zorunlu",
              "onerilen"
            ],
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "weight": {
            "type": "integer"
          }
        },
        "required": [
          "type",
          "title",
          "kind",
          "language",
          "level",
          "rule",
          "basis",
          "weight",
          "included",
          "excluded"
        ],
        "type": "object"
      },
      "LegalEngineProfile": {
        "description": "EK-D's store profile.",
        "properties": {
          "cerez_zorunlu_disi": {
            "type": "string"
          },
          "ebulten": {
            "type": "string"
          },
          "satis": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ucuncu_taraf": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "uyelik": {
            "type": "string"
          },
          "veri_toplama": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "yurtdisi_satis": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LegalEngineProgress": {
        "properties": {
          "done": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "done",
          "total"
        ],
        "type": "object"
      },
      "LegalEngineRun": {
        "description": "A background pass.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "doc_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "error": {
            "description": "ai_not_configured, ai_account, ai_refused, invalid_answer or failed.",
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "classify",
              "prepare",
              "regenerate",
              "audit"
            ],
            "type": "string"
          },
          "reason": {
            "description": "Why a regeneration was started.",
            "type": "string"
          },
          "stage": {
            "enum": [
              "classify",
              "plan",
              "documents",
              "done"
            ],
            "type": "string"
          },
          "status": {
            "description": "waiting: a category waits for the owner.",
            "enum": [
              "queued",
              "running",
              "waiting",
              "done",
              "failed"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "stage",
          "doc_types",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "LegalEngineRunInput": {
        "properties": {
          "kind": {
            "enum": [
              "classify",
              "prepare"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "LegalEngineSettingsInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "LegalEngineState": {
        "description": "The contract engine's state for the store.",
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/AIStatus"
          },
          "audits": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineDocument"
            },
            "type": "array"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineCategory"
            },
            "type": "array"
          },
          "classes": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineClassInfo"
            },
            "type": "array"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineDocument"
            },
            "type": "array"
          },
          "drafted_at": {
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/LegalEngineField"
            },
            "type": "array"
          },
          "ledger_version": {
            "type": "integer"
          },
          "plan": {
            "$ref": "#/components/schemas/LegalEnginePlan"
          },
          "progress": {
            "$ref": "#/components/schemas/LegalEngineProgress"
          },
          "run": {
            "$ref": "#/components/schemas/LegalEngineRun"
          }
        },
        "required": [
          "enabled",
          "ai",
          "ledger_version",
          "categories",
          "classes",
          "progress",
          "documents",
          "audits",
          "fields"
        ],
        "type": "object"
      },
      "LegalEngineValuesInput": {
        "properties": {
          "values": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Field name (without brackets) → value; empty removes.",
            "type": "object"
          }
        },
        "required": [
          "values"
        ],
        "type": "object"
      },
      "LegalMissingText": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "language": {
            "description": "The store language with no text of this contract.",
            "type": "string"
          },
          "sent_in": {
            "description": "The language shoppers of that language get it in.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LegalPlaceholder": {
        "properties": {
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "LegalSettings": {
        "properties": {
          "contract_archive_email": {
            "description": "Where the store's copy of the contracts goes. Empty: the store's own contact address.",
            "type": "string"
          },
          "contract_archive_enabled": {
            "default": true,
            "description": "Whether the contracts a shopper accepted are emailed to the shopper and to the store when the order is placed. On by default; omitted on a write keeps the current choice.",
            "type": "boolean"
          },
          "delivery_days": {
            "description": "Longest delivery promise printed into the texts (default 30).",
            "type": "integer"
          },
          "kep_address": {
            "type": "string"
          },
          "mersis_no": {
            "description": "16 digits.",
            "type": "string"
          },
          "missing_texts": {
            "description": "Read-only: per contract, a store language it has no text in and the language that text is sent in instead.",
            "items": {
              "$ref": "#/components/schemas/LegalMissingText"
            },
            "readOnly": true,
            "type": "array"
          },
          "return_carrier": {
            "description": "The carrier or way a shopper sends a withdrawn product back with, printed as {{seller.return_carrier}} (at most 200 characters). Empty: the texts say the seller names it in its reply to the notice of withdrawal.",
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          },
          "trade_registry_no": {
            "type": "string"
          },
          "web_address": {
            "type": "string"
          },
          "withdrawal_ack_digital": {
            "default": true,
            "description": "Whether checkout asks the shopper to acknowledge, for goods delivered instantly by electronic means (MSY m.15/1-ğ), that the right of withdrawal ends on delivery. On by default; a service performed at once (15/1-h) always asks. Omitted on a write keeps the current choice.",
            "type": "boolean"
          },
          "withdrawal_days": {
            "description": "Cayma period printed into the texts (default 14).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LegalSuggestion": {
        "description": "A proposed clause for one finding.",
        "properties": {
          "basis": {
            "description": "The item's own legal basis.",
            "type": "string"
          },
          "problem": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "problem",
          "basis",
          "text",
          "rationale"
        ],
        "type": "object"
      },
      "LicenceKey": {
        "description": "One code as the staff see it: masked.",
        "properties": {
          "assigned_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "held": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "masked": {
            "example": "••••••AB12",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "replaces_id": {
            "format": "int64",
            "type": "integer"
          },
          "retire_reason": {
            "type": "string"
          },
          "retired_at": {
            "format": "date-time",
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "status": {
            "enum": [
              "available",
              "assigned",
              "burned",
              "removed",
              "expired"
            ],
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "viewed_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "sku",
          "status",
          "masked",
          "created_at"
        ],
        "type": "object"
      },
      "LicenceKeyCounts": {
        "description": "A pool's codes by state; delivered and held count within assigned.",
        "properties": {
          "assigned": {
            "type": "integer"
          },
          "available": {
            "type": "integer"
          },
          "burned": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "expired": {
            "type": "integer"
          },
          "held": {
            "type": "integer"
          },
          "removed": {
            "type": "integer"
          }
        },
        "required": [
          "available",
          "assigned",
          "delivered",
          "held",
          "burned",
          "removed",
          "expired"
        ],
        "type": "object"
      },
      "LicenceKeyImportInput": {
        "additionalProperties": false,
        "properties": {
          "codes": {
            "items": {
              "properties": {
                "code": {
                  "maxLength": 500,
                  "type": "string"
                },
                "expires_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "note": {
                  "maxLength": 500,
                  "type": "string"
                }
              },
              "required": [
                "code"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "dry_run": {
            "type": "boolean"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "note": {
            "maxLength": 500,
            "type": "string"
          },
          "text": {
            "description": "One code per line, or a CSV whose header names a code column (expires_at, note optional).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LicenceKeyImportResult": {
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "duplicates": {
            "description": "Already in the store (any pool, any state).",
            "type": "integer"
          },
          "imported": {
            "type": "integer"
          },
          "pool": {
            "$ref": "#/components/schemas/LicenceKeyPool"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/LicenceKeyIssue"
            },
            "type": "array"
          },
          "repeated": {
            "description": "More than once in this batch; imported once.",
            "type": "integer"
          }
        },
        "required": [
          "imported",
          "duplicates",
          "repeated",
          "problems",
          "dry_run"
        ],
        "type": "object"
      },
      "LicenceKeyIssue": {
        "properties": {
          "line": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "line",
          "message"
        ],
        "type": "object"
      },
      "LicenceKeyPool": {
        "description": "A variant's licence-key pool (ADR-0088 §2).",
        "properties": {
          "counts": {
            "$ref": "#/components/schemas/LicenceKeyCounts"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "location_id": {
            "description": "The shelf whose stock is the pool's unused codes.",
            "format": "int64",
            "type": "integer"
          },
          "low": {
            "type": "boolean"
          },
          "low_threshold": {
            "description": "The pool is low at or below this many unused codes (licence_key.pool_low).",
            "type": "integer"
          },
          "max_per_customer": {
            "description": "Units one customer (by e-mail) may buy in all orders not cancelled; null is no limit (checkout refuses more: 422, details.reason quantity_limit).",
            "type": [
              "integer",
              "null"
            ]
          },
          "review_before_delivery": {
            "description": "A paid order's codes wait for an operator's release (fraud hold).",
            "type": "boolean"
          },
          "sku": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "sku",
          "location_id",
          "max_per_customer",
          "review_before_delivery",
          "low_threshold",
          "counts",
          "low",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "LicenceKeyPoolInput": {
        "additionalProperties": false,
        "properties": {
          "low_threshold": {
            "maximum": 1000000,
            "minimum": 0,
            "type": "integer"
          },
          "max_per_customer": {
            "description": "null or 0 removes the limit.",
            "maximum": 100000,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "review_before_delivery": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "LineAdjustment": {
        "description": "What one promotion took off one order line (or off the shipping), snapshotted at checkout.",
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "code": {
            "type": "string"
          },
          "discount_id": {
            "description": "Absent once the promotion has been deleted.",
            "format": "int64",
            "type": "integer"
          },
          "is_tax_inclusive": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LineLicenceKeys": {
        "description": "Where an order line's codes stand (ADR-0088 §2). The staff's read lists them masked; the shopper's read carries the counts only (their codes: GET /api/orders/{number}/licence-keys).",
        "properties": {
          "assigned": {
            "description": "Live codes the line holds.",
            "type": "integer"
          },
          "codes": {
            "items": {
              "$ref": "#/components/schemas/LicenceKey"
            },
            "type": "array"
          },
          "delivered": {
            "description": "Of those, the ones the shopper can see.",
            "type": "integer"
          },
          "held": {
            "description": "Codes wait for the store's review.",
            "type": "boolean"
          },
          "missing": {
            "description": "Units still without a code.",
            "type": "integer"
          }
        },
        "required": [
          "assigned",
          "delivered",
          "held",
          "missing"
        ],
        "type": "object"
      },
      "LinePersonalisation": {
        "description": "One value on a cart line or an order line, ready to show in the read's language.",
        "properties": {
          "display": {
            "description": "What to show: the text, the option's name, the date; \"✓\" for a ticked box; empty for a picture.",
            "type": "string"
          },
          "erased": {
            "description": "The value was removed with the customer's personal data (erasure); the label stays.",
            "type": "boolean"
          },
          "font": {
            "type": "string"
          },
          "image": {
            "$ref": "#/components/schemas/PersonalisationImage"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "price_add": {
            "$ref": "#/components/schemas/Money",
            "description": "What this value adds to one unit (already in the line's unit price); absent when nothing."
          },
          "type": {
            "enum": [
              "text",
              "textarea",
              "choice",
              "checkbox",
              "image",
              "date"
            ],
            "type": "string"
          },
          "value": {
            "description": "As given: the text, the option's value, \"true\", the date; empty for a picture.",
            "type": "string"
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "value",
          "display"
        ],
        "type": "object"
      },
      "LinePreorder": {
        "description": "The line was sold as a pre-order, with the expected ship date promised.",
        "properties": {
          "ships_on": {
            "format": "date",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LineSource": {
        "description": "Where a supplied line's units come from (ADR-0082): a supplier's offer in the supply network, snapshotted at checkout. Absent on a line sold from the store's own inventory. Staff only: a shopper's view of an order never carries it.",
        "properties": {
          "hold_ref": {
            "type": "string"
          },
          "location_id": {
            "description": "The supplier's stock location the units are held at (an id of the supplier's tenant).",
            "format": "int64",
            "type": "integer"
          },
          "offer_id": {
            "format": "int64",
            "type": "integer"
          },
          "sku": {
            "description": "The supplier's own SKU.",
            "type": "string"
          },
          "tenant_id": {
            "description": "The supplying business (an opaque id of another tenant).",
            "format": "int64",
            "type": "integer"
          },
          "terms_version": {
            "type": "integer"
          },
          "type": {
            "enum": [
              "offer"
            ],
            "type": "string"
          },
          "unit_cost": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "type",
          "tenant_id",
          "offer_id",
          "unit_cost"
        ],
        "type": "object"
      },
      "LineTax": {
        "description": "The tax one line was charged, snapshotted at checkout like its price.",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "example": "KDV",
            "type": "string"
          },
          "rate_bp": {
            "description": "The rate in basis points: 2000 is 20 %.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ListMeta": {
        "description": "Accompanies every paginated collection. Both coordinate systems are reported: `offset` for a client walking a cursor, and `page` for a UI drawing \"3 of 12\". The page fields are derived from the offset, so the two can never disagree.",
        "properties": {
          "has_more": {
            "description": "Whether records follow this window. The response's Link header (RFC 8288) names the next, previous, first and last windows, so a client walks a collection by following rel=\"next\" until it is gone.",
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "page": {
            "description": "The page this window falls in, counting from 1.",
            "type": "integer"
          },
          "total": {
            "description": "Matching records in the whole collection, not just this page.",
            "type": "integer"
          },
          "total_pages": {
            "description": "Pages at this limit. Zero when nothing matched.",
            "type": "integer"
          }
        },
        "required": [
          "total",
          "limit",
          "offset",
          "page",
          "total_pages"
        ],
        "type": "object"
      },
      "ListingFacets": {
        "properties": {
          "attributes": {
            "description": "The attribute facets asked for with facet_attr, in that order (ADR-0076).",
            "items": {
              "$ref": "#/components/schemas/AttributeFacet"
            },
            "type": "array"
          },
          "colors": {
            "description": "By count, then label.",
            "items": {
              "$ref": "#/components/schemas/FacetValue"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "in_stock": {
            "$ref": "#/components/schemas/FacetToggle"
          },
          "on_sale": {
            "$ref": "#/components/schemas/FacetToggle"
          },
          "price": {
            "$ref": "#/components/schemas/FacetPrice"
          },
          "sizes": {
            "description": "XS…XL, then numbers, then words.",
            "items": {
              "$ref": "#/components/schemas/FacetValue"
            },
            "type": "array"
          },
          "total": {
            "description": "Products matching every filter.",
            "type": "integer"
          },
          "truncated": {
            "description": "More than 10,000 products: counted over the first 10,000.",
            "type": "boolean"
          }
        },
        "required": [
          "currency",
          "total",
          "colors",
          "sizes",
          "in_stock",
          "on_sale",
          "price"
        ],
        "type": "object"
      },
      "Localization": {
        "description": "Filled on store reads: the language the text is in and the record's slug per translated language. A missing translation falls back to the default language per field and reports translated=false; a storefront marks such a page noindex and leaves the language out of its alternates.",
        "properties": {
          "fallback": {
            "description": "On a translated record in a language other than the default: the text fields its translation leaves empty while the default language has text, so they carry the default language's text. A storefront builds the page's title and description from the translated fields instead.",
            "items": {
              "enum": [
                "subtitle",
                "description",
                "seo_title",
                "seo_description"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "language": {
            "type": "string"
          },
          "slugs": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Language → slug, for every store language the record is translated into, the default language always.",
            "type": "object"
          },
          "translated": {
            "description": "The title exists in this language (always true in the default language).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Location": {
        "description": "A place stock physically is: a shop, a warehouse, a shelf in somebody's garage. Every store has one from the day it is created, and a store with a single location never has to name it — every stock operation defaults to it.",
        "properties": {
          "active": {
            "description": "Whether new orders may be filled from here. A location holding stock cannot be deactivated: move the stock first.",
            "type": "boolean"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "code": {
            "description": "Stable, lowercase and unique. What an import or a script refers to.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_default": {
            "description": "Where stock lands when nothing names a place. Exactly one location has this.",
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "on_hand": {
            "description": "Units held here, across every variant.",
            "type": "integer"
          },
          "priority": {
            "description": "Lower is preferred. A reservation is taken from the first active location, in this order, that can cover the quantity.",
            "type": "integer"
          },
          "reserved": {
            "type": "integer"
          },
          "skus": {
            "description": "How many variants have a non-zero count here.",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LocationInput": {
        "properties": {
          "active": {
            "default": true,
            "type": "boolean"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "code": {
            "example": "warehouse",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "example": "North warehouse",
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "type": "object"
      },
      "LookBrandKit": {
        "properties": {
          "colors": {
            "items": {
              "$ref": "#/components/schemas/LookColor"
            },
            "type": "array"
          },
          "looks": {
            "items": {
              "$ref": "#/components/schemas/LookCard"
            },
            "type": "array"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "media_id",
          "colors",
          "looks"
        ],
        "type": "object"
      },
      "LookBrandKitInput": {
        "properties": {
          "media_id": {
            "description": "The logo, a picture of the store's media library.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "media_id"
        ],
        "type": "object"
      },
      "LookCard": {
        "properties": {
          "code": {
            "description": "The look's recipe as a short code (\"theme\" is the theme's own look).",
            "type": "string"
          },
          "density": {
            "enum": [
              "airy",
              "balanced",
              "compact"
            ],
            "type": "string"
          },
          "fonts": {
            "$ref": "#/components/schemas/LookFonts"
          },
          "main": {
            "description": "Its main colour (the theme's accent, or what stands for it), #rrggbb.",
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The look's name by language (tr, en, de).",
            "type": "object"
          },
          "parts": {
            "additionalProperties": true,
            "description": "The parts it writes by path: color_schemes (null: the theme's own), buttons (the store's set in the look's shape).",
            "type": "object"
          },
          "preview": {
            "$ref": "#/components/schemas/ContentPreviewToken"
          },
          "report": {
            "$ref": "#/components/schemas/LookReport"
          },
          "shape": {
            "enum": [
              "sharp",
              "soft",
              "round"
            ],
            "type": "string"
          },
          "swatch": {
            "description": "Its colours as a card draws them (#rrggbb): the page, the text, the main colour …",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "values": {
            "additionalProperties": true,
            "description": "The settings the look writes, by setting id, in the editor's form; null puts a setting back to the theme's own.",
            "type": "object"
          }
        },
        "required": [
          "code",
          "name",
          "swatch",
          "values",
          "parts",
          "report"
        ],
        "type": "object"
      },
      "LookColor": {
        "properties": {
          "chromatic": {
            "type": "boolean"
          },
          "hex": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "role": {
            "enum": [
              "primary",
              "secondary",
              "ink"
            ],
            "type": "string"
          },
          "share": {
            "description": "The part of the mark it covers, 0–1.",
            "type": "number"
          }
        },
        "required": [
          "hex",
          "share",
          "chromatic",
          "name"
        ],
        "type": "object"
      },
      "LookDeal": {
        "properties": {
          "brand": {
            "description": "The colour every look kept, when locked.",
            "type": "string"
          },
          "looks": {
            "items": {
              "$ref": "#/components/schemas/LookCard"
            },
            "type": "array"
          },
          "round": {
            "type": "integer"
          },
          "seed": {
            "format": "int64",
            "type": "integer"
          },
          "theme_id": {
            "type": "string"
          }
        },
        "required": [
          "seed",
          "round",
          "theme_id",
          "looks"
        ],
        "type": "object"
      },
      "LookDealInput": {
        "properties": {
          "brand": {
            "description": "A colour every look keeps on the theme's main colour (instead of the one now).",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "count": {
            "description": "How many looks (default 6).",
            "maximum": 6,
            "minimum": 1,
            "type": "integer"
          },
          "lock": {
            "description": "\"Bu renkler benim markam\": every look keeps the store's main colour now.",
            "type": "boolean"
          },
          "round": {
            "description": "The roll's round (0 starts with the theme's own look).",
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "seed": {
            "description": "The roll; absent rolls a new one (the answer names it).",
            "format": "int64",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LookFonts": {
        "properties": {
          "body": {
            "type": "string"
          },
          "heading": {
            "type": "string"
          }
        },
        "required": [
          "heading",
          "body"
        ],
        "type": "object"
      },
      "LookIcons": {
        "properties": {
          "favicon": {
            "$ref": "#/components/schemas/LookPicture"
          },
          "share_image": {
            "$ref": "#/components/schemas/LookPicture"
          }
        },
        "required": [
          "favicon",
          "share_image"
        ],
        "type": "object"
      },
      "LookIconsInput": {
        "properties": {
          "code": {
            "description": "The look whose colours the share card takes.",
            "type": "string"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "media_id",
          "code"
        ],
        "type": "object"
      },
      "LookPicture": {
        "properties": {
          "alt": {
            "type": "string"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "media_id",
          "alt"
        ],
        "type": "object"
      },
      "LookReport": {
        "description": "What the look was checked for: how many pairs, and the lowest WCAG 2.x contrast of its text, button text and marks.",
        "properties": {
          "min_button": {
            "type": "number"
          },
          "min_text": {
            "type": "number"
          },
          "min_ui": {
            "type": "number"
          },
          "pairs": {
            "type": "integer"
          }
        },
        "required": [
          "pairs",
          "min_text",
          "min_button",
          "min_ui"
        ],
        "type": "object"
      },
      "LoyaltyAccount": {
        "properties": {
          "balance": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "friend_points": {
            "type": "integer"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/LoyaltyEntry"
            },
            "type": "array"
          },
          "min_redeem_points": {
            "type": "integer"
          },
          "referral_code": {
            "type": "string"
          },
          "referrer_points": {
            "type": "integer"
          },
          "value": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "enabled",
          "balance",
          "value",
          "min_redeem_points",
          "referrer_points",
          "friend_points",
          "history"
        ],
        "type": "object"
      },
      "LoyaltyEntry": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "enum": [
              "earn",
              "reverse",
              "redeem",
              "adjust",
              "referral"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "points": {
            "type": "integer"
          }
        },
        "required": [
          "points",
          "kind",
          "created_at"
        ],
        "type": "object"
      },
      "LoyaltyProgram": {
        "properties": {
          "currency": {
            "description": "The store's base currency (read only).",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "friend_points": {
            "type": "integer"
          },
          "min_redeem_points": {
            "type": "integer"
          },
          "point_value_minor": {
            "type": "integer"
          },
          "points_per_unit": {
            "type": "integer"
          },
          "referrer_points": {
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "points_per_unit",
          "point_value_minor",
          "min_redeem_points",
          "referrer_points",
          "friend_points"
        ],
        "type": "object"
      },
      "MNGTestResult": {
        "properties": {
          "error": {
            "description": "MNG Kargo's reason when the test failed.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "MailBook": {
        "properties": {
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/MailContact"
            },
            "type": "array"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/MailGroup"
            },
            "type": "array"
          }
        },
        "required": [
          "contacts",
          "groups"
        ],
        "type": "object"
      },
      "MailCheck": {
        "properties": {
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "dkim": {
            "$ref": "#/components/schemas/MailCheckItem"
          },
          "dmarc": {
            "$ref": "#/components/schemas/MailCheckItem"
          },
          "domain": {
            "type": "string"
          },
          "mx": {
            "$ref": "#/components/schemas/MailCheckItem"
          },
          "provider": {
            "type": "string"
          },
          "spf": {
            "$ref": "#/components/schemas/MailCheckItem"
          }
        },
        "required": [
          "domain",
          "checked_at",
          "mx",
          "spf",
          "dkim",
          "dmarc",
          "provider"
        ],
        "type": "object"
      },
      "MailCheckItem": {
        "properties": {
          "found": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "description": "elsewhere: the record exists but is not the hosted mail provider's (another server's MX, an SPF that leaves the provider out, another DKIM key); only the hosted mailboxes' DNS view reports it.",
            "enum": [
              "ok",
              "warn",
              "missing",
              "error",
              "unchecked",
              "elsewhere"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "found"
        ],
        "type": "object"
      },
      "MailContact": {
        "properties": {
          "company": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "group_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "company",
          "note",
          "group_ids",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "MailContactInput": {
        "properties": {
          "company": {
            "maxLength": 80,
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "group_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "note": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "MailDKIMInput": {
        "properties": {
          "selector": {
            "type": "string"
          },
          "value": {
            "description": "The key record (v=DKIM1; k=rsa; p=…) or, for Microsoft 365, the CNAME target.",
            "type": "string"
          }
        },
        "required": [
          "selector",
          "value"
        ],
        "type": "object"
      },
      "MailGroup": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "members": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "note",
          "members",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "MailGroupInput": {
        "properties": {
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "note": {
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "MailMX": {
        "properties": {
          "host": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          }
        },
        "required": [
          "host",
          "priority"
        ],
        "type": "object"
      },
      "MailMxActionInput": {
        "properties": {
          "action": {
            "enum": [
              "read",
              "unread",
              "flag",
              "unflag",
              "trash",
              "spam",
              "unspam"
            ],
            "type": "string"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "MailMxActionResult": {
        "properties": {
          "done": {
            "type": "boolean"
          }
        },
        "required": [
          "done"
        ],
        "type": "object"
      },
      "MailMxAddress": {
        "properties": {
          "address": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "address"
        ],
        "type": "object"
      },
      "MailMxAlias": {
        "properties": {
          "destination": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source",
          "destination"
        ],
        "type": "object"
      },
      "MailMxAliasInput": {
        "properties": {
          "destination": {
            "type": "string"
          },
          "local_part": {
            "type": "string"
          }
        },
        "required": [
          "local_part",
          "destination"
        ],
        "type": "object"
      },
      "MailMxAutoReply": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "end": {
            "description": "Unix seconds; 0 never ends.",
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "start": {
            "description": "Unix seconds; 0 starts now.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MailMxComposeInput": {
        "properties": {
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reply_to": {
            "description": "The message answered; 0 for a new message.",
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "to",
          "subject",
          "text"
        ],
        "type": "object"
      },
      "MailMxDNSInfo": {
        "properties": {
          "check": {
            "$ref": "#/components/schemas/MailCheck"
          },
          "domain": {
            "type": "string"
          },
          "managed": {
            "type": "boolean"
          },
          "plan": {
            "$ref": "#/components/schemas/MailSetupPlan"
          },
          "records": {
            "items": {
              "$ref": "#/components/schemas/MailMxRecord"
            },
            "type": "array"
          }
        },
        "required": [
          "domain",
          "managed",
          "records"
        ],
        "type": "object"
      },
      "MailMxDomain": {
        "properties": {
          "dns_applied_at": {
            "format": "date-time",
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "managed": {
            "description": "The domain answers from NeroCart's DNS: the records can be written for the merchant.",
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "active",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "domain",
          "managed",
          "status"
        ],
        "type": "object"
      },
      "MailMxFolder": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "depth": {
            "type": "integer"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "unread": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "path",
          "count",
          "unread",
          "depth"
        ],
        "type": "object"
      },
      "MailMxGroup": {
        "properties": {
          "description": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "members": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "email",
          "members"
        ],
        "type": "object"
      },
      "MailMxGroupInput": {
        "properties": {
          "description": {
            "type": "string"
          },
          "local_part": {
            "type": "string"
          },
          "members": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "local_part",
          "members"
        ],
        "type": "object"
      },
      "MailMxLogEntry": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "result": {
            "enum": [
              "delivered",
              "refused",
              "held",
              "waiting",
              "other"
            ],
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "spam": {
            "type": "boolean"
          },
          "subject": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "from",
          "to",
          "subject",
          "result",
          "spam",
          "size"
        ],
        "type": "object"
      },
      "MailMxLogs": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/MailMxLogEntry"
            },
            "type": "array"
          },
          "sign_ins": {
            "items": {
              "$ref": "#/components/schemas/MailMxSignIn"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "MailMxMailbox": {
        "properties": {
          "address": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "free": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          },
          "lapses_at": {
            "description": "When an unpaid package drops (end of the grace period).",
            "format": "date-time",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "paid_until": {
            "description": "The end of the month the package is paid for; absent without a paid package.",
            "format": "date-time",
            "type": "string"
          },
          "quota_mb": {
            "type": "integer"
          },
          "renewal": {
            "description": "Where the paid package stands: due (renewal open), overdue (month over, in the grace period), lapsed (suspended).",
            "enum": [
              "paid",
              "due",
              "overdue",
              "lapsed"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "awaiting_payment",
              "creating",
              "active",
              "suspended",
              "failed"
            ],
            "type": "string"
          },
          "used_checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "used_mb": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "address",
          "display_name",
          "quota_mb",
          "used_mb",
          "package",
          "free",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "MailMxMailboxCreated": {
        "properties": {
          "mailbox": {
            "$ref": "#/components/schemas/MailMxMailbox"
          },
          "password": {
            "description": "Shown this once.",
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/MailMxRequest"
          }
        },
        "required": [
          "mailbox"
        ],
        "type": "object"
      },
      "MailMxMailboxInput": {
        "properties": {
          "display_name": {
            "type": "string"
          },
          "local_part": {
            "type": "string"
          }
        },
        "required": [
          "local_part"
        ],
        "type": "object"
      },
      "MailMxMailboxSettings": {
        "properties": {
          "address": {
            "type": "string"
          },
          "auto_reply": {
            "$ref": "#/components/schemas/MailMxAutoReply"
          },
          "display_name": {
            "type": "string"
          },
          "forward_copy": {
            "description": "Every incoming message is copied to this address (\"\" none).",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "last_login_at": {
            "format": "date-time",
            "type": "string"
          },
          "quota_mb": {
            "type": "integer"
          },
          "sending_stopped": {
            "type": "boolean"
          },
          "signature": {
            "description": "Plain text; lines become \u003cbr\u003e.",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "used_mb": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "address",
          "display_name",
          "auto_reply",
          "forward_copy",
          "sending_stopped",
          "signature",
          "status",
          "quota_mb",
          "used_mb"
        ],
        "type": "object"
      },
      "MailMxMailboxSettingsInput": {
        "properties": {
          "auto_reply": {
            "$ref": "#/components/schemas/MailMxAutoReply"
          },
          "display_name": {
            "type": "string"
          },
          "forward_copy": {
            "type": "string"
          },
          "sending_stopped": {
            "type": "boolean"
          },
          "signature": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MailMxMembersInput": {
        "properties": {
          "members": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "members"
        ],
        "type": "object"
      },
      "MailMxMessage": {
        "properties": {
          "attachments": {
            "type": "integer"
          },
          "cc": {
            "items": {
              "$ref": "#/components/schemas/MailMxAddress"
            },
            "type": "array"
          },
          "content": {
            "description": "HTML or text as content_type says; the panel shows HTML in a sandboxed frame.",
            "type": "string"
          },
          "content_type": {
            "enum": [
              "html",
              "text"
            ],
            "type": "string"
          },
          "from": {
            "items": {
              "$ref": "#/components/schemas/MailMxAddress"
            },
            "type": "array"
          },
          "id": {
            "type": "integer"
          },
          "message_id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "time": {
            "format": "date-time",
            "type": "string"
          },
          "to": {
            "items": {
              "$ref": "#/components/schemas/MailMxAddress"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "subject",
          "from",
          "to",
          "cc",
          "time",
          "content_type",
          "content",
          "message_id",
          "attachments"
        ],
        "type": "object"
      },
      "MailMxMessagePage": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MailMxMessageRow"
            },
            "type": "array"
          },
          "start": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "start",
          "count"
        ],
        "type": "object"
      },
      "MailMxMessageRow": {
        "properties": {
          "attachment": {
            "type": "boolean"
          },
          "flagged": {
            "type": "boolean"
          },
          "from": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "preview": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "time": {
            "format": "date-time",
            "type": "string"
          },
          "unread": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "subject",
          "preview",
          "from",
          "from_name",
          "time",
          "size",
          "unread",
          "flagged",
          "attachment"
        ],
        "type": "object"
      },
      "MailMxMove": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "done": {
            "type": "integer"
          },
          "from": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "into": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "host",
          "into",
          "from",
          "status",
          "total",
          "done"
        ],
        "type": "object"
      },
      "MailMxMoveInput": {
        "properties": {
          "host": {
            "type": "string"
          },
          "mailbox_id": {
            "format": "int64",
            "type": "integer"
          },
          "password": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "protocol": {
            "enum": [
              "imap",
              "pop"
            ],
            "type": "string"
          },
          "security": {
            "enum": [
              "ssl",
              "starttls",
              "none"
            ],
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "mailbox_id",
          "host",
          "password"
        ],
        "type": "object"
      },
      "MailMxOffer": {
        "properties": {
          "code": {
            "type": "string"
          },
          "price_minor": {
            "type": "integer"
          },
          "quota_mb": {
            "type": "integer"
          }
        },
        "required": [
          "code",
          "quota_mb",
          "price_minor"
        ],
        "type": "object"
      },
      "MailMxOverview": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "candidate": {
            "type": "string"
          },
          "client_host": {
            "description": "The server name for IMAP, POP3 and SMTP in a phone or a mail program.",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "domain": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MailMxDomain"
              }
            ]
          },
          "free_available": {
            "type": "boolean"
          },
          "free_quota_mb": {
            "type": "integer"
          },
          "house": {
            "description": "NeroCart's own store (a plan that is not billed): mailboxes and quotas are applied at once, with no price and no month that runs out; every package is offered.",
            "type": "boolean"
          },
          "mailboxes": {
            "items": {
              "$ref": "#/components/schemas/MailMxMailbox"
            },
            "type": "array"
          },
          "packages": {
            "items": {
              "$ref": "#/components/schemas/MailMxOffer"
            },
            "type": "array"
          },
          "paid_plan": {
            "type": "boolean"
          },
          "webmail_url": {
            "type": "string"
          }
        },
        "required": [
          "available",
          "domain",
          "mailboxes",
          "packages",
          "currency",
          "free_quota_mb",
          "free_available",
          "paid_plan",
          "house",
          "client_host",
          "webmail_url"
        ],
        "type": "object"
      },
      "MailMxPasswordInput": {
        "properties": {
          "password": {
            "description": "Empty generates one.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MailMxPasswordResult": {
        "properties": {
          "password": {
            "type": "string"
          }
        },
        "required": [
          "password"
        ],
        "type": "object"
      },
      "MailMxPayInput": {
        "properties": {
          "method": {
            "enum": [
              "card",
              "bank_transfer"
            ],
            "type": "string"
          }
        },
        "required": [
          "method"
        ],
        "type": "object"
      },
      "MailMxPayStart": {
        "properties": {
          "checkout_url": {
            "format": "uri",
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/MailMxRequest"
          }
        },
        "required": [
          "request",
          "checkout_url"
        ],
        "type": "object"
      },
      "MailMxRecord": {
        "properties": {
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "purpose": {
            "enum": [
              "mx",
              "spf",
              "dkim",
              "dmarc"
            ],
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "value",
          "purpose"
        ],
        "type": "object"
      },
      "MailMxRenameInput": {
        "properties": {
          "local_part": {
            "type": "string"
          }
        },
        "required": [
          "local_part"
        ],
        "type": "object"
      },
      "MailMxRequest": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "kind": {
            "enum": [
              "mailbox",
              "upgrade",
              "renewal"
            ],
            "type": "string"
          },
          "mailbox": {
            "description": "The mailbox's address.",
            "type": "string"
          },
          "mailbox_id": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "order_number": {
            "description": "The NeroCart store order that pays it.",
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "payment_method": {
            "description": "How it is (being) paid; absent until chosen.",
            "enum": [
              "card",
              "bank_transfer",
              "manual"
            ],
            "type": "string"
          },
          "price_minor": {
            "type": "integer"
          },
          "quota_mb": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending_payment",
              "awaiting_transfer",
              "applied",
              "cancelled",
              "failed"
            ],
            "type": "string"
          },
          "transfer": {
            "$ref": "#/components/schemas/PaymentInstructions"
          }
        },
        "required": [
          "id",
          "mailbox_id",
          "kind",
          "package",
          "quota_mb",
          "price_minor",
          "currency",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "MailMxSender": {
        "properties": {
          "from": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "allow",
              "block"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "from",
          "kind"
        ],
        "type": "object"
      },
      "MailMxSenderInput": {
        "properties": {
          "from": {
            "description": "An address or a domain.",
            "type": "string"
          },
          "kind": {
            "enum": [
              "allow",
              "block"
            ],
            "type": "string"
          }
        },
        "required": [
          "from",
          "kind"
        ],
        "type": "object"
      },
      "MailMxSignIn": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "protocol": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "ok",
          "ip",
          "location",
          "protocol"
        ],
        "type": "object"
      },
      "MailMxUpgradeInput": {
        "properties": {
          "package": {
            "type": "string"
          }
        },
        "required": [
          "package"
        ],
        "type": "object"
      },
      "MailProvider": {
        "properties": {
          "admin_url": {
            "type": "string"
          },
          "autodiscover": {
            "type": "string"
          },
          "dkim_kind": {
            "enum": [
              "txt",
              "cname"
            ],
            "type": "string"
          },
          "dkim_selectors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "doc_url": {
            "type": "string"
          },
          "id": {
            "enum": [
              "google",
              "microsoft",
              "yandex",
              "zoho_eu",
              "zoho",
              "uzmanposta",
              "other"
            ],
            "type": "string"
          },
          "mx": {
            "items": {
              "$ref": "#/components/schemas/MailMX"
            },
            "type": "array"
          },
          "mx_custom": {
            "description": "The merchant types the MX hosts (Other).",
            "type": "boolean"
          },
          "mx_from_admin": {
            "description": "The MX host is the one the provider's admin console shows (Microsoft 365); the domain's default is microsoft_mx.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "signup_url": {
            "type": "string"
          },
          "spf_include": {
            "type": "string"
          },
          "verification_example": {
            "description": "The shape of the ownership TXT; \"\" when none is asked for.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "signup_url",
          "admin_url",
          "doc_url",
          "mx",
          "mx_from_admin",
          "mx_custom",
          "spf_include",
          "verification_example",
          "dkim_selectors",
          "dkim_kind"
        ],
        "type": "object"
      },
      "MailRecordChange": {
        "properties": {
          "action": {
            "enum": [
              "add",
              "replace",
              "remove",
              "keep"
            ],
            "type": "string"
          },
          "name": {
            "description": "Relative to the domain; @ is the domain itself.",
            "type": "string"
          },
          "old": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "purpose": {
            "enum": [
              "mx",
              "spf",
              "verify",
              "autodiscover",
              "dkim",
              "dmarc"
            ],
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "action",
          "type",
          "name",
          "value",
          "priority",
          "purpose"
        ],
        "type": "object"
      },
      "MailSetupDomain": {
        "properties": {
          "domain": {
            "type": "string"
          },
          "managed": {
            "type": "boolean"
          },
          "microsoft_mx": {
            "type": "string"
          }
        },
        "required": [
          "domain",
          "managed",
          "microsoft_mx"
        ],
        "type": "object"
      },
      "MailSetupInput": {
        "properties": {
          "dkim": {
            "items": {
              "$ref": "#/components/schemas/MailDKIMInput"
            },
            "maxItems": 2,
            "type": "array"
          },
          "dmarc_report": {
            "description": "An address for DMARC aggregate reports (rua); \"\" for none.",
            "type": "string"
          },
          "mx": {
            "description": "Other: the MX hosts.",
            "items": {
              "$ref": "#/components/schemas/MailMX"
            },
            "maxItems": 6,
            "type": "array"
          },
          "mx_host": {
            "description": "Microsoft 365: the MX host its admin centre shows (default: the computed one).",
            "type": "string"
          },
          "no_dmarc": {
            "description": "Leave DMARC out.",
            "type": "boolean"
          },
          "provider": {
            "enum": [
              "google",
              "microsoft",
              "yandex",
              "zoho_eu",
              "zoho",
              "uzmanposta",
              "other"
            ],
            "type": "string"
          },
          "spf_include": {
            "description": "Other: the SPF include host.",
            "type": "string"
          },
          "verification": {
            "description": "The provider's ownership TXT, checked against its shape.",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "MailSetupPage": {
        "properties": {
          "domains": {
            "items": {
              "$ref": "#/components/schemas/MailSetupDomain"
            },
            "type": "array"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/MailProvider"
            },
            "type": "array"
          }
        },
        "required": [
          "providers",
          "domains"
        ],
        "type": "object"
      },
      "MailSetupPlan": {
        "properties": {
          "applied": {
            "type": "boolean"
          },
          "changes": {
            "items": {
              "$ref": "#/components/schemas/MailRecordChange"
            },
            "type": "array"
          },
          "domain": {
            "type": "string"
          },
          "pending": {
            "type": "integer"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "domain",
          "provider",
          "changes",
          "pending",
          "applied"
        ],
        "type": "object"
      },
      "ManualRefundRequest": {
        "description": "A refund the merchant made outside the store.",
        "properties": {
          "amount_minor": {
            "description": "What was sent back, in minor units of the order's currency.",
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "note": {
            "description": "How and why the money went back; recorded as the refund's reason and carried on the event.",
            "maxLength": 500,
            "type": "string"
          },
          "reference": {
            "description": "The bank transfer's or receipt's reference, recorded as provider_reference.",
            "maxLength": 200,
            "type": "string"
          }
        },
        "required": [
          "amount_minor",
          "note"
        ],
        "type": "object"
      },
      "MapsKeyCheck": {
        "properties": {
          "autocomplete": {
            "enum": [
              "ok",
              "invalid",
              "disabled",
              "billing",
              "ip",
              "restricted",
              "quota",
              "denied",
              "unreachable"
            ],
            "type": "string"
          },
          "ok": {
            "description": "Both APIs answered.",
            "type": "boolean"
          },
          "validation": {
            "description": "ok, or what is missing: invalid (not a key), disabled (the API is not enabled), billing (no billing account), ip (this server's IP is not allowed), restricted (limited to other APIs or to websites), quota, denied, unreachable.",
            "enum": [
              "ok",
              "invalid",
              "disabled",
              "billing",
              "ip",
              "restricted",
              "quota",
              "denied",
              "unreachable"
            ],
            "type": "string"
          }
        },
        "required": [
          "ok",
          "autocomplete",
          "validation"
        ],
        "type": "object"
      },
      "MapsKeyInput": {
        "properties": {
          "api_key": {
            "description": "Empty checks the stored key.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "Market": {
        "description": "Where a store sells (M3, ADR-0004): the countries it serves, the currency it charges in and the languages it speaks.",
        "properties": {
          "code": {
            "description": "Lower-case letters, digits and hyphens; unique in the store. Sent as X-Market by a storefront.",
            "example": "eu",
            "type": "string"
          },
          "countries": {
            "description": "ISO 3166-1 alpha-2; empty means every country no other market claims.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "example": "EUR",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_default": {
            "type": "boolean"
          },
          "languages": {
            "description": "BCP 47 tags the market is served in.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "currency",
          "countries",
          "languages",
          "is_default"
        ],
        "type": "object"
      },
      "MarketInput": {
        "properties": {
          "code": {
            "type": "string"
          },
          "countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "currency"
        ],
        "type": "object"
      },
      "MarketPatch": {
        "description": "An absent field is kept.",
        "properties": {
          "countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MarketingAutomation": {
        "properties": {
          "body": {
            "description": "Plain text; {name} (or {ad}) becomes the customer's name.",
            "type": "string"
          },
          "delay_days": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "welcome",
              "win_back",
              "birthday",
              "post_purchase"
            ],
            "type": "string"
          },
          "sent_30d": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "enabled",
          "delay_days",
          "subject",
          "body",
          "sent_30d"
        ],
        "type": "object"
      },
      "MarketingAutomationInput": {
        "properties": {
          "body": {
            "type": "string"
          },
          "delay_days": {
            "maximum": 730,
            "minimum": 0,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "delay_days",
          "subject",
          "body"
        ],
        "type": "object"
      },
      "MarketingConsentInput": {
        "properties": {
          "channel": {
            "enum": [
              "sms",
              "email",
              "call"
            ],
            "type": "string"
          },
          "form_version": {
            "type": "string"
          },
          "granted": {
            "description": "Ticked by the shopper. Unticked by default; an unticked box records nothing.",
            "type": "boolean"
          },
          "recipient_type": {
            "enum": [
              "BIREYSEL",
              "TACIR"
            ],
            "type": "string"
          },
          "text": {
            "description": "The wording shown (proof).",
            "type": "string"
          }
        },
        "required": [
          "channel",
          "granted"
        ],
        "type": "object"
      },
      "MarketplaceAttrAnswer": {
        "additionalProperties": false,
        "properties": {
          "custom": {
            "type": "string"
          },
          "value_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MarketplaceAttribute": {
        "additionalProperties": false,
        "properties": {
          "custom": {
            "description": "Free text allowed.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "multi": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "values": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "variant": {
            "description": "Tells variants apart (size, colour): answered from each variant's options.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "required",
          "custom",
          "variant",
          "multi",
          "values"
        ],
        "type": "object"
      },
      "MarketplaceBrand": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "MarketplaceCard": {
        "additionalProperties": false,
        "properties": {
          "cancel_reasons": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceReason"
            },
            "type": "array"
          },
          "code": {
            "type": "string"
          },
          "connection": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MarketplaceConnection"
              },
              {
                "type": "null"
              }
            ]
          },
          "counts": {
            "additionalProperties": false,
            "properties": {
              "attention": {
                "type": "integer"
              },
              "claims": {
                "type": "integer"
              },
              "live": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "problems": {
                "type": "integer"
              },
              "questions": {
                "type": "integer"
              }
            },
            "required": [
              "live",
              "pending",
              "problems",
              "attention",
              "claims",
              "questions"
            ],
            "type": "object"
          },
          "features": {
            "additionalProperties": false,
            "properties": {
              "claims": {
                "type": "boolean"
              },
              "invoices": {
                "type": "boolean"
              },
              "questions": {
                "type": "boolean"
              }
            },
            "required": [
              "invoices",
              "claims",
              "questions"
            ],
            "type": "object"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceField"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "sandbox_label": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "fields",
          "cancel_reasons",
          "features",
          "connection",
          "counts"
        ],
        "type": "object"
      },
      "MarketplaceCategoryHit": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "description": "With its ancestors, \"Giyim \u003e Kadın \u003e Elbise\".",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "path"
        ],
        "type": "object"
      },
      "MarketplaceCategoryMap": {
        "additionalProperties": false,
        "properties": {
          "attributes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/MarketplaceAttrAnswer"
            },
            "type": "object"
          },
          "category_id": {
            "type": "integer"
          },
          "external_id": {
            "type": "string"
          },
          "external_path": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "products": {
            "type": "integer"
          }
        },
        "required": [
          "category_id",
          "attributes"
        ],
        "type": "object"
      },
      "MarketplaceClaim": {
        "additionalProperties": false,
        "properties": {
          "claimed_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceClaimItem"
            },
            "type": "array"
          },
          "order_id": {
            "type": "integer"
          },
          "order_ref": {
            "type": "string"
          },
          "state": {
            "enum": [
              "waiting",
              "open",
              "accepted",
              "rejected",
              "disputed",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_ref",
          "state",
          "items"
        ],
        "type": "object"
      },
      "MarketplaceClaimItem": {
        "additionalProperties": false,
        "properties": {
          "customer_note": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "reason": {
            "description": "The customer's reason.",
            "type": "string"
          },
          "ref": {
            "description": "The barcode.",
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "ref",
          "title",
          "reason",
          "customer_note",
          "state"
        ],
        "type": "object"
      },
      "MarketplaceClaims": {
        "additionalProperties": false,
        "properties": {
          "claims": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceClaim"
            },
            "type": "array"
          },
          "reasons": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceReason"
            },
            "type": "array"
          }
        },
        "required": [
          "claims",
          "reasons"
        ],
        "type": "object"
      },
      "MarketplaceConnection": {
        "additionalProperties": false,
        "properties": {
          "account_label": {
            "description": "The account the credentials open (Trendyol: the seller id).",
            "type": "string"
          },
          "connected_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_sync_at": {
            "format": "date-time",
            "type": "string"
          },
          "problem": {
            "description": "AUTH (credentials refused; the jobs stop until the store reconnects), UNAVAILABLE or FORBIDDEN; absent when fine.",
            "type": "string"
          },
          "sandbox": {
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/MarketplaceSettings"
          },
          "status": {
            "enum": [
              "connected",
              "failed",
              "disconnected"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "account_label",
          "sandbox",
          "connected_at",
          "settings"
        ],
        "type": "object"
      },
      "MarketplaceField": {
        "additionalProperties": false,
        "properties": {
          "help": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "optional": {
            "type": "boolean"
          },
          "secret": {
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "label",
          "secret"
        ],
        "type": "object"
      },
      "MarketplaceOrder": {
        "additionalProperties": false,
        "properties": {
          "customer": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "lines": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "quantity": {
                  "type": "integer"
                },
                "ref": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "ref",
                "quantity"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "order_id": {
            "type": "integer"
          },
          "placed_at": {
            "format": "date-time",
            "type": "string"
          },
          "problem": {
            "description": "STOCK_SHORT, or UNMATCHED:\u003cline\u003e.",
            "type": "string"
          },
          "reference": {
            "description": "The marketplace's order number.",
            "type": "string"
          },
          "state": {
            "enum": [
              "stock_short",
              "unmatched"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "reference",
          "state",
          "customer",
          "lines"
        ],
        "type": "object"
      },
      "MarketplaceOverview": {
        "additionalProperties": false,
        "properties": {
          "marketplaces": {
            "items": {
              "$ref": "#/components/schemas/MarketplaceCard"
            },
            "type": "array"
          }
        },
        "required": [
          "marketplaces"
        ],
        "type": "object"
      },
      "MarketplaceProduct": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "price_minor": {
            "description": "The product's own price on the marketplace, overriding the rule.",
            "type": "integer"
          },
          "product_id": {
            "type": "integer"
          },
          "reason": {
            "description": "The marketplace's words for a refusal, or one of NO_CATEGORY_MAP, NO_BARCODE, NO_IMAGE, NO_BRAND, NO_PRICE, NO_SITE, INACTIVE, MISSING_ATTRIBUTE:\u003cname\u003e, VARIANT_VALUE:\u003cname\u003e, PUSH_FAILED:\u003cwords\u003e.",
            "type": "string"
          },
          "sale_price_minor": {
            "description": "What the marketplace is asked for the default variant.",
            "type": "integer"
          },
          "status": {
            "description": "The product's one line: its worst variant's state.",
            "enum": [
              "not_listed",
              "queued",
              "sending",
              "pending_approval",
              "live",
              "rejected",
              "paused",
              "error"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "description": "The live listing's page.",
            "type": "string"
          },
          "variants": {
            "type": "integer"
          }
        },
        "required": [
          "product_id",
          "title",
          "variants",
          "status",
          "sale_price_minor",
          "currency"
        ],
        "type": "object"
      },
      "MarketplaceQuestion": {
        "additionalProperties": false,
        "properties": {
          "answer": {
            "type": "string"
          },
          "asked_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "product_name": {
            "type": "string"
          },
          "state": {
            "enum": [
              "waiting",
              "answered",
              "closed"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "product_name",
          "text",
          "state"
        ],
        "type": "object"
      },
      "MarketplaceReason": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "MarketplaceSettings": {
        "additionalProperties": false,
        "properties": {
          "brand_id": {
            "description": "The marketplace brand a product without a matching vendor is listed under.",
            "type": "string"
          },
          "brand_name": {
            "type": "string"
          },
          "carrier": {
            "description": "The marketplace's carrier code listings name; empty is the account's default.",
            "type": "string"
          },
          "delivery_days": {
            "description": "Dispatch promise sent with listings: \"0\" today, \"1\" by tomorrow, empty the marketplace's default.",
            "type": "string"
          },
          "price_add_minor": {
            "description": "Then added, in minor units (kuruş).",
            "type": "integer"
          },
          "price_percent": {
            "description": "Added to the store price, in basis points (1500 = 15 %); may be negative.",
            "type": "integer"
          },
          "stock_buffer": {
            "description": "Held back from every pushed quantity.",
            "type": "integer"
          },
          "untracked_quantity": {
            "description": "Pushed for a variant whose stock is not counted or that sells past zero (default 10).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MeasurementCheck": {
        "properties": {
          "api_secret_set": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "ga4_measurement_id": {
            "type": "string"
          },
          "gtm_container_id": {
            "type": "string"
          },
          "orders": {
            "items": {
              "$ref": "#/components/schemas/MeasurementOrder"
            },
            "type": "array"
          },
          "test_mode": {
            "type": "boolean"
          },
          "tracking_method": {
            "description": "`gtm`, `gtag` or empty (both).",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "ga4_measurement_id",
          "gtm_container_id",
          "tracking_method",
          "api_secret_set",
          "test_mode",
          "orders"
        ],
        "type": "object"
      },
      "MeasurementEvent": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "description": "Why it was skipped or failed: `no_api_secret`, `test order`, `GA4 answered 500`, …",
            "type": "string"
          },
          "ref": {
            "description": "`refund:\u003cid\u003e` or `cancel`.",
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "sent",
              "skipped",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "ref",
          "amount",
          "status",
          "at"
        ],
        "type": "object"
      },
      "MeasurementOrder": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_test": {
            "type": "boolean"
          },
          "number": {
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          },
          "purchase_mark": {
            "description": "When the confirmation served the purchase mark; absent when it never did.",
            "properties": {
              "first_at": {
                "format": "date-time",
                "type": "string"
              },
              "last_at": {
                "format": "date-time",
                "type": "string"
              },
              "seen": {
                "type": "integer"
              }
            },
            "required": [
              "seen",
              "first_at",
              "last_at"
            ],
            "type": "object"
          },
          "refunds": {
            "items": {
              "$ref": "#/components/schemas/MeasurementEvent"
            },
            "type": "array"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "number",
          "created_at",
          "status",
          "payment_status",
          "total",
          "is_test",
          "refunds"
        ],
        "type": "object"
      },
      "Media": {
        "description": "One file in the store-wide library (ADR-0039, ADR-0065). Note what is absent: the storage key and the content hash are internal handles and are never serialized.",
        "properties": {
          "alt": {
            "type": "string"
          },
          "alt_source": {
            "description": "Who wrote alt (migration 0153): absent or empty a person; ai or rules the automatic image SEO (the panel's \"otomatik\" badge). Read only: a person's edit of the text makes it theirs, and the system never writes over it.",
            "enum": [
              "",
              "ai",
              "rules"
            ],
            "type": "string"
          },
          "caption": {
            "description": "A caption (at most 500).",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "description": "A longer description (at most 2000).",
            "type": "string"
          },
          "edited": {
            "description": "Whether the file shown is not the first upload (restore-original is offered).",
            "type": "boolean"
          },
          "filename": {
            "description": "The name it was uploaded under, kept for display only — never used as a path.",
            "type": "string"
          },
          "focal_point": {
            "description": "The point of the image that matters, set by an operator; null means the centre. A storefront that crops keeps it in frame (CSS object-position).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/FocalPoint"
              },
              {
                "type": "null"
              }
            ]
          },
          "folder_id": {
            "description": "The folder it is filed in; null is the top level.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "image",
              "video",
              "model",
              "document"
            ],
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "mime": {
            "type": "string"
          },
          "poster_media_id": {
            "description": "A video's poster picture.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "poster_url": {
            "type": "string"
          },
          "revision": {
            "description": "1 for the upload, one more for each edit, replacement or restore.",
            "type": "integer"
          },
          "seo_slug": {
            "description": "The readable name the picture's public address carries (/media/\u003cseo_slug\u003e--\u003cstored name\u003e, written by the image SEO); the storefront's product and catalogue pictures use it. url stays the stored address.",
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "tags": {
            "description": "At most 20, each 1–40 characters.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "description": "The file's title in the store's default language (at most 160).",
            "type": "string"
          },
          "translations": {
            "additionalProperties": {
              "$ref": "#/components/schemas/MediaText"
            },
            "description": "The texts in languages other than the store's default, by language code (tr, en, de, or another of the store's).",
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "uploaded_by": {
            "description": "Who uploaded it, as the audit trail names them.",
            "type": "string"
          },
          "url": {
            "description": "Where the file is readable. Site-relative for files this store holds.",
            "type": "string"
          },
          "usage_count": {
            "description": "How many places use the file; present when the listing asked for it (with_usage).",
            "type": "integer"
          },
          "variants": {
            "description": "Responsive copies the kernel made of an uploaded JPEG or PNG at the standard widths (320, 640, 960, 1280, 1920) narrower than the image, widest first; empty for everything else (ADR-0039).",
            "items": {
              "$ref": "#/components/schemas/MediaVariant"
            },
            "type": "array"
          },
          "width": {
            "description": "Known for images; absent otherwise.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MediaBulkResult": {
        "properties": {
          "error": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "description": "The refusal in a word: in_use, not_found, validation_failed …",
            "type": "string"
          },
          "uses": {
            "items": {
              "$ref": "#/components/schemas/MediaUse"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "MediaDuplicate": {
        "properties": {
          "duplicate": {
            "type": "boolean"
          },
          "media": {
            "$ref": "#/components/schemas/Media"
          }
        },
        "required": [
          "duplicate",
          "media"
        ],
        "type": "object"
      },
      "MediaFolder": {
        "properties": {
          "files": {
            "description": "Files filed directly in it.",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MediaText": {
        "description": "A file's texts in one language.",
        "properties": {
          "alt": {
            "maxLength": 500,
            "type": "string"
          },
          "alt_source": {
            "description": "Who wrote alt in this language: absent or empty a person; ai or rules the automatic image SEO. Read only: ignored in a request.",
            "enum": [
              "",
              "ai",
              "rules"
            ],
            "type": "string"
          },
          "caption": {
            "maxLength": 500,
            "type": "string"
          },
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "title": {
            "maxLength": 160,
            "type": "string"
          }
        },
        "type": "object"
      },
      "MediaUploadSession": {
        "properties": {
          "chunk_size": {
            "type": "integer"
          },
          "chunks": {
            "type": "integer"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "media_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "received": {
            "description": "The chunks that arrived, ascending.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "open",
              "done"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "MediaUse": {
        "description": "One place a library file is used.",
        "properties": {
          "id": {
            "description": "The place's id in its kind (a product id, a page id …).",
            "type": "string"
          },
          "kind": {
            "enum": [
              "product",
              "collection",
              "category",
              "vendor",
              "media",
              "review",
              "page",
              "theme",
              "theme_instance",
              "store_identity",
              "menu",
              "content_settings",
              "store"
            ],
            "type": "string"
          },
          "label": {
            "description": "How an operator recognises it: a product's title, a page's name (and language), a theme's id.",
            "type": "string"
          },
          "live": {
            "description": "Whether shoppers see it now rather than a draft.",
            "type": "boolean"
          },
          "place": {
            "enum": [
              "gallery",
              "picture",
              "logo",
              "favicon",
              "share_image",
              "section",
              "poster",
              "photo",
              "text"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "label",
          "live"
        ],
        "type": "object"
      },
      "MediaVariant": {
        "description": "One responsive copy of an uploaded image.",
        "properties": {
          "height": {
            "type": "integer"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Membership": {
        "description": "One tenant the signed-in user belongs to.",
        "properties": {
          "current": {
            "description": "Whether this is the tenant the current session belongs to.",
            "type": "boolean"
          },
          "status": {
            "enum": [
              "active",
              "suspended"
            ],
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "tenant_name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MessagingProfile": {
        "properties": {
          "contact": {
            "type": "string"
          },
          "legal_name": {
            "description": "Unvan printed in every commercial message.",
            "type": "string"
          },
          "mersis_no": {
            "description": "16-digit MERSİS number.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "MetaDeletionStatus": {
        "properties": {
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "confirmation_code": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "deletion",
              "deauthorize"
            ],
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "received",
              "deleted"
            ],
            "type": "string"
          }
        },
        "required": [
          "confirmation_code",
          "kind",
          "status",
          "requested_at"
        ],
        "type": "object"
      },
      "MethodPayout": {
        "description": "One payment method's share of the window.",
        "properties": {
          "code": {
            "description": "What the checkout URL speaks. Empty on the totals row.",
            "type": "string"
          },
          "collected": {
            "$ref": "#/components/schemas/Money"
          },
          "installed": {
            "description": "False for a method that took money once and is no longer in this binary. The row still counts — the money was still taken.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "net": {
            "$ref": "#/components/schemas/Money",
            "description": "Collected less refunded — the figure to compare with a bank statement."
          },
          "orders": {
            "description": "Paid sales charged through it.",
            "type": "integer"
          },
          "outstanding": {
            "$ref": "#/components/schemas/Money",
            "description": "Sold and not yet paid. On cash on delivery, money in transit; on a card gateway, usually a failure worth looking at."
          },
          "outstanding_orders": {
            "type": "integer"
          },
          "refunded": {
            "$ref": "#/components/schemas/Money",
            "description": "Refunded on exactly those orders."
          }
        },
        "type": "object"
      },
      "Money": {
        "description": "An integer count of the currency's minor unit, plus the currency. Never a float, because binary floating point cannot represent 0.10; never a formatted string, because the decimal places belong to the currency and the symbol belongs to the reader's locale.",
        "properties": {
          "amount_minor": {
            "example": 1999,
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "example": "USD",
            "type": "string"
          }
        },
        "required": [
          "amount_minor",
          "currency"
        ],
        "type": "object"
      },
      "NeroPayBalance": {
        "properties": {
          "at_provider_minor": {
            "format": "int64",
            "type": "integer"
          },
          "chargebacks_minor": {
            "format": "int64",
            "type": "integer"
          },
          "check_minor": {
            "format": "int64",
            "type": "integer"
          },
          "commission_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "gross_sales_minor": {
            "format": "int64",
            "type": "integer"
          },
          "nerocart_net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "platform_fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "provider_fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "refunds_minor": {
            "format": "int64",
            "type": "integer"
          },
          "sales": {
            "type": "integer"
          },
          "store": {
            "$ref": "#/components/schemas/NeroPayPartyBalance"
          },
          "suppliers": {
            "$ref": "#/components/schemas/NeroPayPartyBalance"
          }
        },
        "required": [
          "currency",
          "sales",
          "gross_sales_minor",
          "refunds_minor",
          "chargebacks_minor",
          "commission_minor",
          "platform_fee_minor",
          "provider_fee_minor",
          "at_provider_minor",
          "nerocart_net_minor",
          "store",
          "suppliers",
          "check_minor"
        ],
        "type": "object"
      },
      "NeroPayCatalogLine": {
        "description": "A catalog line of a NeroPay sale (Model 1, ADR-0141): the supplier is paid its price, NeroCart its commission on the retail, the store the rest.",
        "properties": {
          "commission_minor": {
            "format": "int64",
            "type": "integer"
          },
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "retail_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "order_line_id",
          "supplier_tenant_id",
          "quantity",
          "retail_minor",
          "supplier_minor",
          "commission_minor"
        ],
        "type": "object"
      },
      "NeroPayDue": {
        "description": "A payment waiting for release: delivered at, releasable from (delivery + the return window), and what it waits for.",
        "properties": {
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "payment_ref": {
            "type": "string"
          },
          "waiting": {
            "enum": [
              "delivery",
              "return_window",
              "open_return",
              "open_chargeback"
            ],
            "type": "string"
          }
        },
        "required": [
          "payment_ref",
          "order_id"
        ],
        "type": "object"
      },
      "NeroPayEntry": {
        "description": "One side of a journal: debit positive, credit negative.",
        "properties": {
          "account": {
            "enum": [
              "customer_payment",
              "provider_fee",
              "nerocart_commission",
              "platform_fee",
              "supplier_payable",
              "store_payable",
              "refunds",
              "chargebacks",
              "payouts"
            ],
            "type": "string"
          },
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "counterparty_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "party": {
            "enum": [
              "customer",
              "provider",
              "nerocart",
              "store",
              "supplier"
            ],
            "type": "string"
          },
          "state": {
            "enum": [
              "pending",
              "releasable",
              "held",
              "released"
            ],
            "type": "string"
          }
        },
        "required": [
          "account",
          "party",
          "amount_minor"
        ],
        "type": "object"
      },
      "NeroPayJournal": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/NeroPayEntry"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "sale",
              "refund",
              "chargeback",
              "settlement",
              "payout",
              "reversal"
            ],
            "type": "string"
          },
          "memo": {
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "operation_ref": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "payment_ref": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "reversed_by_journal_id": {
            "format": "int64",
            "type": "integer"
          },
          "reverses_journal_id": {
            "format": "int64",
            "type": "integer"
          },
          "split": {
            "$ref": "#/components/schemas/NeroPaySplit"
          }
        },
        "required": [
          "id",
          "kind",
          "payment_ref",
          "operation_ref",
          "provider",
          "currency",
          "amount_minor",
          "memo",
          "actor",
          "occurred_at",
          "entries"
        ],
        "type": "object"
      },
      "NeroPayMerchantState": {
        "properties": {
          "balances": {
            "items": {
              "$ref": "#/components/schemas/NeroPayBalance"
            },
            "type": "array"
          },
          "catalog_products": {
            "description": "Products this store sells from the shared catalog; their lines are paid only through NeroPay (ADR-0141).",
            "type": "integer"
          },
          "checkout_ready": {
            "type": "boolean"
          },
          "company_state": {
            "type": "string"
          },
          "dues": {
            "items": {
              "$ref": "#/components/schemas/NeroPayDue"
            },
            "type": "array"
          },
          "exempt": {
            "type": "boolean"
          },
          "provider_active": {
            "type": "boolean"
          },
          "rate": {
            "$ref": "#/components/schemas/NeroPayRate"
          },
          "recent": {
            "items": {
              "$ref": "#/components/schemas/NeroPayJournal"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "documents_missing",
              "reviewing",
              "active"
            ],
            "type": "string"
          },
          "sub_merchants": {
            "items": {
              "$ref": "#/components/schemas/NeroPaySubMerchantRow"
            },
            "type": "array"
          }
        },
        "required": [
          "status",
          "company_state",
          "exempt",
          "provider_active",
          "checkout_ready",
          "sub_merchants",
          "rate",
          "balances",
          "recent",
          "catalog_products",
          "dues"
        ],
        "type": "object"
      },
      "NeroPayPartyBalance": {
        "description": "What is owed to a party by settlement state; current is the current account (cari), earned adds what was paid out.",
        "properties": {
          "current_minor": {
            "format": "int64",
            "type": "integer"
          },
          "earned_minor": {
            "format": "int64",
            "type": "integer"
          },
          "held_minor": {
            "format": "int64",
            "type": "integer"
          },
          "paid_minor": {
            "format": "int64",
            "type": "integer"
          },
          "pending_minor": {
            "format": "int64",
            "type": "integer"
          },
          "releasable_minor": {
            "format": "int64",
            "type": "integer"
          },
          "released_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "pending_minor",
          "releasable_minor",
          "held_minor",
          "released_minor",
          "paid_minor",
          "current_minor",
          "earned_minor"
        ],
        "type": "object"
      },
      "NeroPayRate": {
        "properties": {
          "auto_release": {
            "description": "Release at the institution by itself once the window has passed.",
            "type": "boolean"
          },
          "defect_liability": {
            "description": "Who gives a catalog sale's money back for a defect (ADR-0141): the supplier (its price for the units, the line unwound) or the store alone.",
            "enum": [
              "supplier",
              "store"
            ],
            "type": "string"
          },
          "plan_code": {
            "type": "string"
          },
          "pos_cost_bearer": {
            "enum": [
              "store",
              "supplier",
              "shared",
              "nerocart"
            ],
            "type": "string"
          },
          "pos_fee_bp": {
            "type": "integer"
          },
          "pos_fee_from_provider": {
            "type": "boolean"
          },
          "provider": {
            "type": "string"
          },
          "provider_rate_bp": {
            "type": "integer"
          },
          "return_window_days": {
            "description": "Days after delivery before a payment's shares become releasable.",
            "type": "integer"
          },
          "rule_id": {
            "format": "int64",
            "type": "integer"
          },
          "sales_liability": {
            "description": "Who gives a catalog sale's money back for a sales cause (a change of mind, goodwill, a dispute about the sale).",
            "enum": [
              "supplier",
              "store"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "merchant",
              "plan",
              "default",
              "none"
            ],
            "type": "string"
          },
          "store_commission_bp": {
            "type": "integer"
          },
          "supplier_commission_bp": {
            "type": "integer"
          }
        },
        "required": [
          "source",
          "pos_fee_bp",
          "pos_fee_from_provider",
          "store_commission_bp",
          "supplier_commission_bp",
          "pos_cost_bearer",
          "provider",
          "provider_rate_bp",
          "defect_liability",
          "sales_liability",
          "return_window_days",
          "auto_release"
        ],
        "type": "object"
      },
      "NeroPaySplit": {
        "properties": {
          "auto_release": {
            "type": "boolean"
          },
          "commission_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "defect_liability": {
            "enum": [
              "supplier",
              "store"
            ],
            "type": "string"
          },
          "gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/NeroPayCatalogLine"
            },
            "type": "array"
          },
          "parties": {
            "items": {
              "$ref": "#/components/schemas/NeroPaySplitParty"
            },
            "type": "array"
          },
          "pos_cost_bearer": {
            "type": "string"
          },
          "pos_fee_bp": {
            "type": "integer"
          },
          "pos_fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "provider_fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "provider_rate_bp": {
            "type": "integer"
          },
          "return_window_days": {
            "type": "integer"
          },
          "rule_source": {
            "type": "string"
          },
          "sales_liability": {
            "enum": [
              "supplier",
              "store"
            ],
            "type": "string"
          },
          "store_commission_bp": {
            "type": "integer"
          },
          "supplier_commission_bp": {
            "type": "integer"
          }
        },
        "required": [
          "gross_minor",
          "currency",
          "pos_fee_bp",
          "provider_rate_bp",
          "store_commission_bp",
          "supplier_commission_bp",
          "pos_cost_bearer",
          "rule_source",
          "provider_fee_minor",
          "pos_fee_minor",
          "commission_minor",
          "parties"
        ],
        "type": "object"
      },
      "NeroPaySplitParty": {
        "properties": {
          "commission_minor": {
            "format": "int64",
            "type": "integer"
          },
          "fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "party": {
            "enum": [
              "store",
              "supplier"
            ],
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "party",
          "gross_minor",
          "commission_minor",
          "fee_minor",
          "net_minor"
        ],
        "type": "object"
      },
      "NeroPaySubMerchantRow": {
        "properties": {
          "note": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_ref": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "submitted",
              "active",
              "rejected",
              "suspended"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "status",
          "provider_ref",
          "note",
          "updated_by",
          "updated_at"
        ],
        "type": "object"
      },
      "NewsletterConfirmation": {
        "properties": {
          "confirmed": {
            "type": "boolean"
          },
          "language": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "NewsletterSignup": {
        "properties": {
          "consent_text": {
            "description": "The wording shown next to the box (proof).",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "form_version": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "consent_text"
        ],
        "type": "object"
      },
      "NewsletterSignupResult": {
        "properties": {
          "pending": {
            "description": "Always true: the consent exists only once the address confirms it.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "NextgenStatus": {
        "properties": {
          "avif": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "failed": {
            "type": "integer"
          },
          "formats": {
            "items": {
              "enum": [
                "webp",
                "avif"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "larger": {
            "type": "integer"
          },
          "made": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "quality": {
            "type": "integer"
          },
          "saved_bytes": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "formats",
          "avif",
          "quality",
          "pending",
          "made",
          "larger",
          "skipped",
          "failed",
          "saved_bytes"
        ],
        "type": "object"
      },
      "NodeSync": {
        "description": "\"Düzeni diğer dillere uygula\" (ADR-0085 §14, VB-8): the item's structure was copied from another language. from is that language, src a hash of its texts then, own the hash of the texts this version got then (present while they are still the copied ones: not translated yet). Hashes are the editor's, 8 hex digits.",
        "properties": {
          "from": {
            "enum": [
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "own": {
            "pattern": "^[0-9a-f]{8}$",
            "type": "string"
          },
          "src": {
            "pattern": "^[0-9a-f]{8}$",
            "type": "string"
          }
        },
        "required": [
          "from",
          "src"
        ],
        "type": "object"
      },
      "NotificationRecord": {
        "description": "One message the store sent a shopper, as it remembers sending it.",
        "properties": {
          "backend": {
            "description": "The module that carried it; empty when only the log did.",
            "type": "string"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The template variables, kept so the message can be sent again as it was.",
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "event": {
            "example": "order.created",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          },
          "purpose": {
            "enum": [
              "transactional",
              "commercial"
            ],
            "type": "string"
          },
          "resend_of": {
            "description": "The row this is a resend of.",
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "`logged` is a store with no delivery backend for the channel: the message went to the server log and nowhere else. A backend that sends in the background (the SMTP and İleti Merkezi modules) records the message as `queued` and a notify.send job sends it: `sent` when the server accepted it, `failed` when it refused it or the retries ran out (the error says which), `cancelled` when its time to live ran out, the recipient was suppressed, or the store's monthly sending quota stopped it before it could go, and `unknown` for an SMS whose provider answer was lost after the request went out — it may have been delivered and is never sent again automatically; resend it by hand if it did not arrive.",
            "enum": [
              "queued",
              "sent",
              "logged",
              "failed",
              "cancelled",
              "unknown"
            ],
            "type": "string"
          },
          "title": {
            "description": "What the event's template calls the message; absent for an event with no wording.",
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "NotifierBackend": {
        "description": "One delivery backend registered on a channel.",
        "properties": {
          "delivers": {
            "description": "False for the built-in logger, which writes one line and returns success.",
            "type": "boolean"
          },
          "module": {
            "description": "Which module registered it. \"core\" is the built-in logger.",
            "example": "notify-sendgrid",
            "type": "string"
          },
          "name": {
            "description": "What the backend calls itself when it offers a name, the module that registered it otherwise, and \"log\" for the built-in logger. A notifier has no code the way a payment provider does — nothing addresses one by name — so there is nothing more canonical to fall back to.",
            "example": "SendGrid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "NotifierChannelInfo": {
        "description": "One notification channel and what stands behind it.",
        "properties": {
          "backends": {
            "description": "The registered backends, in registration order. Notifiers append rather than replace, so a store may send an email and mirror it to an audit sink.",
            "items": {
              "$ref": "#/components/schemas/NotifierBackend"
            },
            "type": "array"
          },
          "channel": {
            "description": "The channel. The set is closed in v1 because the dispatcher has to know which recipient field feeds a channel.",
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "delivers": {
            "description": "True when at least one backend on this channel is not the built-in logger. False is the trap: the send succeeds, the outbox marks the event delivered, and the message reached nobody.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "NotifyPreview": {
        "properties": {
          "body": {
            "type": "string"
          },
          "channel": {
            "type": "string"
          },
          "data": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "event": {
            "type": "string"
          },
          "html": {
            "description": "An email as it will arrive: the body in the store's layout (logo, footer), the order summary of a sample order. Absent for an SMS.",
            "type": "string"
          },
          "locale": {
            "description": "The language rendered; absent for the every-language wording.",
            "type": "string"
          },
          "preheader": {
            "description": "The email's preview line as a mail app shows it.",
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "channel",
          "event",
          "subject",
          "body",
          "data"
        ],
        "type": "object"
      },
      "NotifyTemplate": {
        "description": "The wording of one message on one channel: the default from code, or the operator's own. Wording is per language: for a message in language L the text is the store's wording in L, else the store's wording for every language, else the default in L (the engine ships Turkish, English and German), else English. Email is sent as plain text and as HTML in a platform layout, with every value escaped.",
        "properties": {
          "audience": {
            "description": "Who reads it: a shopper (in their order's or account's language) or the store's own team (in the panel's languages).",
            "enum": [
              "customer",
              "store"
            ],
            "type": "string"
          },
          "body": {
            "description": "Go text/template over the event's flat string data.",
            "type": "string"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "commercial": {
            "description": "A message that sells (a basket reminder, a campaign, an automatic marketing e-mail): it carries the sender's details and an unsubscribe link. A transactional message never does.",
            "type": "boolean"
          },
          "customized": {
            "description": "Whether a stored row overrides the default.",
            "type": "boolean"
          },
          "description": {
            "description": "When it goes out.",
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "locale": {
            "description": "The language this wording is for (tr, en, de); absent for the store's wording for every language, which is also where the English default is listed.",
            "type": "string"
          },
          "preheader": {
            "description": "An email's preview line: what a mail app shows after the subject (Go text/template like the subject). Empty for SMS; empty on an email means its first line is used.",
            "type": "string"
          },
          "source": {
            "description": "Where the effective wording comes from: `default` (the platform's, in this language), `store_all` (the store's wording for every language) or `store_locale` (the store's wording for this language). Resetting a language falls back to `store_all` when the store has one.",
            "enum": [
              "default",
              "store_all",
              "store_locale"
            ],
            "type": "string"
          },
          "subject": {
            "description": "Go text/template; empty for SMS.",
            "type": "string"
          },
          "title": {
            "description": "What the message is called on the screen.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variables": {
            "description": "The data keys the event carries, for the editor.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "NotifyUsage": {
        "properties": {
          "blocked": {
            "type": "integer"
          },
          "ceiling": {
            "description": "Where transactional messages stop.",
            "type": "integer"
          },
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "over_quota": {
            "type": "integer"
          },
          "per_minute": {
            "description": "The burst cap.",
            "type": "integer"
          },
          "quota": {
            "description": "The monthly quota.",
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "state": {
            "description": "`over_quota`: marketing stopped, transactional still going; `ceiling`: only security messages go.",
            "enum": [
              "ok",
              "over_quota",
              "ceiling"
            ],
            "type": "string"
          }
        },
        "required": [
          "channel",
          "sent",
          "over_quota",
          "blocked",
          "quota",
          "ceiling",
          "per_minute",
          "state"
        ],
        "type": "object"
      },
      "NotifyUsageReport": {
        "properties": {
          "channels": {
            "items": {
              "$ref": "#/components/schemas/NotifyUsage"
            },
            "type": "array"
          },
          "period": {
            "description": "The month, YYYY-MM (UTC).",
            "example": "2026-10",
            "type": "string"
          }
        },
        "required": [
          "period",
          "channels"
        ],
        "type": "object"
      },
      "OAuthApp": {
        "properties": {
          "client_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "developer": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "listed": {
            "type": "boolean"
          },
          "logo_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "redirect_uris": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "website_url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "client_id",
          "name",
          "developer",
          "description",
          "website_url",
          "logo_url",
          "redirect_uris",
          "scopes",
          "listed",
          "created_at"
        ],
        "type": "object"
      },
      "OAuthApproval": {
        "properties": {
          "client_id": {
            "type": "string"
          },
          "code_challenge": {
            "type": "string"
          },
          "code_challenge_method": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "client_id",
          "redirect_uri"
        ],
        "type": "object"
      },
      "OAuthConsent": {
        "properties": {
          "app": {
            "$ref": "#/components/schemas/OAuthApp"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "app",
          "scopes"
        ],
        "type": "object"
      },
      "OAuthError": {
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "OAuthInstall": {
        "properties": {
          "app_id": {
            "format": "int64",
            "type": "integer"
          },
          "app_name": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "app_id",
          "app_name",
          "scopes",
          "created_at"
        ],
        "type": "object"
      },
      "OAuthToken": {
        "properties": {
          "access_token": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "token_type": {
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "scope"
        ],
        "type": "object"
      },
      "Offer": {
        "description": "One seller’s price and stock for one variant. Several sellers may offer the same variant — that is what the table is for — and the variant keeps its own price and stock, which are the store’s own first-party offer. Nothing sells from an offer yet: checkout still prices and reserves against the variant.",
        "properties": {
          "available": {
            "description": "stock_on_hand minus stock_reserved.",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "status": {
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "stock_on_hand": {
            "type": "integer"
          },
          "stock_reserved": {
            "type": "integer"
          },
          "track_inventory": {
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "vendor_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OfferInput": {
        "description": "Setting an offer that already exists replaces it: one seller cannot hold two prices for one variant.",
        "properties": {
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "price_minor": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "enum": [
              "active",
              "paused"
            ],
            "type": "string"
          },
          "stock_on_hand": {
            "minimum": 0,
            "type": "integer"
          },
          "track_inventory": {
            "type": "boolean"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "price_minor"
        ],
        "type": "object"
      },
      "OpenedCheckoutLink": {
        "properties": {
          "cart_token": {
            "type": "string"
          },
          "skipped": {
            "type": "integer"
          }
        },
        "required": [
          "cart_token",
          "skipped"
        ],
        "type": "object"
      },
      "OptOutView": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "recipient": {
            "description": "Masked.",
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OptionChange": {
        "description": "What replacing the matrix actually did, so an operator is told rather than left to discover it.",
        "properties": {
          "axes_added": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "axes_removed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "axes_renamed": {
            "description": "\"Size → Größe\".",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "values_added": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "values_removed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "values_renamed": {
            "description": "\"Colour: Red → Crimson\". Apart from added and removed on purpose: a rename keeps every variant that held the value, and reporting it as a removal plus an addition describes a destruction that did not happen.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "variants_created": {
            "description": "SKUs.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "variants_removed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OptionTranslation": {
        "description": "One option axis keyed by its default-language name; translations are keyed by the default-language text, so they survive an edit of the option matrix and lapse when that text changes.",
        "properties": {
          "name": {
            "type": "string"
          },
          "translation": {
            "type": "string"
          },
          "values": {
            "items": {
              "properties": {
                "translation": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OrchestrationSettings": {
        "properties": {
          "fraud": {
            "$ref": "#/components/schemas/FraudRules"
          },
          "health": {
            "$ref": "#/components/schemas/HealthRules"
          }
        },
        "required": [
          "fraud",
          "health"
        ],
        "type": "object"
      },
      "Order": {
        "description": "An immutable record of a sale. Its lines and customer details are snapshots, so a historical order stays readable after the catalog moves on.",
        "properties": {
          "access_token": {
            "description": "How a guest reads their own order back. Returned at checkout and by POST /api/admin/orders/{id}/access-token; absent from every order read, guest or admin.",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "The invoice address the shopper gave apart from `address`; absent when they gave none."
          },
          "buyer_tax": {
            "$ref": "#/components/schemas/BuyerTax"
          },
          "channel": {
            "description": "The storefront channel that sold it; absent on a store with no channels.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "discount": {
            "$ref": "#/components/schemas/Money"
          },
          "discounts": {
            "description": "One summary per promotion the order was given.",
            "items": {
              "$ref": "#/components/schemas/AppliedDiscount"
            },
            "type": "array"
          },
          "duties": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What a duties-inclusive (DDP) order charged for customs duty and import taxes, part of total (ADR-0123). Absent otherwise."
          },
          "email": {
            "type": "string"
          },
          "fulfillment_status": {
            "description": "The order's fulfillment axis, derived from its lines and parcels.",
            "enum": [
              "unfulfilled",
              "partially_fulfilled",
              "fulfilled",
              "partially_delivered",
              "delivered"
            ],
            "type": "string"
          },
          "fulfillments": {
            "items": {
              "$ref": "#/components/schemas/Fulfillment"
            },
            "type": "array"
          },
          "gift": {
            "description": "The order is sent as a present (PUT /api/admin/orders/{id}/gift): its customs invoice says GIFT, and automatic invoicing leaves it out when the store's gift settings say so. Absent for every other order.",
            "type": "boolean"
          },
          "gift_card": {
            "$ref": "#/components/schemas/Money",
            "description": "What gift cards paid of total: tender, not a discount. The payment method was asked for the rest. Absent when no card paid."
          },
          "gift_kind": {
            "description": "On a gift order, which: a present (GIFT on the customs invoice) or a free sample (SAMPLE).",
            "enum": [
              "gift",
              "sample"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "invoice": {
            "description": "The order's latest e-invoice in brief; absent when none was made.",
            "properties": {
              "kind": {
                "enum": [
                  "",
                  "e_arsiv",
                  "e_fatura"
                ],
                "type": "string"
              },
              "number": {
                "type": "string"
              },
              "status": {
                "enum": [
                  "pending",
                  "sent",
                  "issued",
                  "failed",
                  "rejected",
                  "cancelled"
                ],
                "type": "string"
              }
            },
            "required": [
              "status"
            ],
            "type": "object"
          },
          "is_test": {
            "description": "Placed while the store's test mode was on (ADR-0137): paid only with the test card or a gateway in its test environment, out of every report, never invoiced or booked with a carrier, and sends nothing to analytics.",
            "type": "boolean"
          },
          "landed_cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LandedCost"
              }
            ],
            "description": "The duties estimate's breakdown and assumptions as at checkout. Absent when no duties were charged."
          },
          "language": {
            "type": "string"
          },
          "legal_acceptances": {
            "description": "Legal texts accepted at checkout: version, hash of the rendered text, time.",
            "items": {
              "$ref": "#/components/schemas/LegalAcceptance"
            },
            "type": "array"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/OrderLine"
            },
            "type": "array"
          },
          "marketplace": {
            "description": "The marketplace that sold the order (ADR-0094) and its own id for it; absent for an order the store sold itself. The marketplace's customer is not written to by the store.",
            "properties": {
              "code": {
                "description": "The marketplace's code, e.g. trendyol.",
                "example": "trendyol",
                "type": "string"
              },
              "order_id": {
                "description": "The marketplace's own id for the order (Trendyol: the shipment package id).",
                "type": "string"
              }
            },
            "required": [
              "code",
              "order_id"
            ],
            "type": "object"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Where a module attaches its own data, under its own key. The reserved key `notes` is the shop's own note on the order and is absent from GET /api/orders/{number}.",
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "number": {
            "example": "GC-000042",
            "type": "string"
          },
          "pay_url": {
            "description": "The order's pay page, answered once to the till that made a QR sale (POST /api/admin/pos/sales, tender qr); never stored.",
            "type": "string"
          },
          "payment_decline": {
            "description": "Why the bank turned the unpaid order's last card payment down — the category, and the store's own sentence for it in the reader's language when it wrote one (ADR-0135). On the shopper's read of their own order only.",
            "properties": {
              "code": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "code"
            ],
            "type": "object"
          },
          "payment_instructions": {
            "$ref": "#/components/schemas/PaymentInstructions"
          },
          "payment_provider": {
            "type": "string"
          },
          "payment_reference": {
            "type": "string"
          },
          "payment_status": {
            "enum": [
              "pending",
              "paid",
              "failed",
              "refunded"
            ],
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "refunded": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What has gone back to the customer. payment_status stays paid while any of the money is still the store's, and becomes refunded only once this reaches the total."
          },
          "refunds": {
            "description": "Every refund on this order, oldest first.",
            "items": {
              "$ref": "#/components/schemas/Refund"
            },
            "type": "array"
          },
          "requires_shipping": {
            "description": "Whether anything on the order is sent. False: a digital order — no delivery address was asked (address is the billing address), nothing ships, and it is delivered digitally once paid (ADR-0045).",
            "type": "boolean"
          },
          "return_requests": {
            "description": "On GET /api/orders/{number} only: the returns the shopper asked for with this order's link, and where each stands. The store's own records of returns (`returns`) are not in the shopper's read.",
            "items": {
              "$ref": "#/components/schemas/GuestReturn"
            },
            "type": "array"
          },
          "returns": {
            "description": "What has come back off this order, oldest first, including returns that were later withdrawn. Empty on a guest's copy: it is the store's operational record rather than a fact about what the shopper bought.",
            "items": {
              "$ref": "#/components/schemas/OrderReturn"
            },
            "type": "array"
          },
          "shipping": {
            "$ref": "#/components/schemas/Money"
          },
          "shipping_adjustments": {
            "description": "What promotions took off the shipping; `shipping` is already net of it.",
            "items": {
              "$ref": "#/components/schemas/LineAdjustment"
            },
            "type": "array"
          },
          "shipping_method": {
            "description": "The name of the delivery option chosen, snapshotted; absent when no rate was involved (a store on the flat shipping amount).",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/OrderSource"
          },
          "state": {
            "description": "The order's lifecycle (DOMAIN_MODEL §4.1): pending until accepted, open while it is being fulfilled, completed when delivered, cancelled. Derived from status; fulfillment progress is fulfillment_status.",
            "enum": [
              "pending",
              "open",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "status": {
            "description": "partial means some of what was ordered has gone out and some has not; shipped still means all of it. It is derived from the shipments and never set directly.",
            "enum": [
              "pending",
              "confirmed",
              "partial",
              "shipped",
              "delivered",
              "cancelled"
            ],
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          },
          "tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "The tax charged across every line and the shipping."
          },
          "tax_inclusive": {
            "description": "Whether the prices contained the tax: then `tax` is part of `subtotal` and `total` rather than added to them.",
            "type": "boolean"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "trashed_at": {
            "description": "When an operator moved the order to the trash (POST /api/admin/orders/bulk, action trash); absent for every other order and from the guest's read. A trashed order is cancelled, left out of the orders list unless in_trash=true, and deleted for good after 30 days when no money moved for it.",
            "format": "date-time",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "withdrawal_acknowledgement": {
            "$ref": "#/components/schemas/WithdrawalAcknowledgement"
          },
          "withdrawal_deadline": {
            "description": "On GET /api/orders/{number} only: the end of the withdrawal period — the last parcel's `delivered_at` plus the store's withdrawal days (legal settings). Absent until a parcel is delivered. Shown, not enforced: a return request after it is still a request the store decides on.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderBulkOutcome": {
        "description": "A bulk action's answer (POST /api/admin/orders/bulk): how many orders it changed, how many it could not, and each order's outcome.",
        "properties": {
          "action": {
            "type": "string"
          },
          "failed": {
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/OrderBulkResult"
            },
            "type": "array"
          },
          "succeeded": {
            "type": "integer"
          }
        },
        "required": [
          "action",
          "succeeded",
          "failed",
          "results"
        ],
        "type": "object"
      },
      "OrderBulkResult": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "message": {
            "description": "The engine's own words for a refusal; may be reworded at any time.",
            "type": "string"
          },
          "number": {
            "description": "The order's number; absent when no such order was found.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "description": "Why it was refused, a stable code (see the route); absent when the engine gave none.",
            "enum": [
              "order_shipped",
              "order_paid",
              "order_returned",
              "order_cancelled",
              "order_refunded",
              "order_not_confirmed",
              "order_not_shipped",
              "order_in_trash",
              "order_not_in_trash",
              "order_keeps_records",
              "not_found"
            ],
            "type": "string"
          },
          "status": {
            "description": "The order's status afterwards; absent when it was deleted for good or refused.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "ok"
        ],
        "type": "object"
      },
      "OrderChange": {
        "description": "What an edit did to an order's lines, and the totals either side of it. Also carried by an `order.edited` event and by the `change` on that event's timeline entry.",
        "properties": {
          "balance_minor": {
            "description": "What the edit moved the total by: positive is owed by the customer, negative is owed to them.",
            "format": "int64",
            "type": "integer"
          },
          "lines_added": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "lines_changed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "lines_removed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "total_after": {
            "$ref": "#/components/schemas/Money"
          },
          "total_before": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "type": "object"
      },
      "OrderChangeAction": {
        "description": "A stored action of an order change.",
        "properties": {
          "action": {
            "description": "Medusa's order-change action type.",
            "enum": [
              "ITEM_ADD",
              "ITEM_REMOVE",
              "ITEM_UPDATE",
              "RETURN_ITEM",
              "RECEIVE_RETURN_ITEM",
              "RECEIVE_DAMAGED_RETURN_ITEM",
              "SHIPPING_ADD",
              "SHIPPING_REMOVE",
              "CREDIT_LINE_ADD"
            ],
            "type": "string"
          },
          "amount_minor": {
            "description": "The amount of a SHIPPING_ADD or CREDIT_LINE_ADD. On the way out, every action's amount as the engine computed it — positive, with the action's type saying whether it adds or deducts. A RETURN_ITEM is priced net of the line's own promotions and with its tax share; a receipt moves nothing, because the value left the order when the return was asked for.",
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "line_id": {
            "description": "The order line an item, return or receive action is about.",
            "format": "int64",
            "type": "integer"
          },
          "location_id": {
            "description": "On RECEIVE_RETURN_ITEM: the shelf. Absent means the one the line was picked from.",
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "reason": {
            "description": "On RETURN_ITEM: why the goods are coming back.",
            "type": "string"
          },
          "reference": {
            "description": "What a credit line refers to.",
            "type": "string"
          },
          "reference_id": {
            "description": "The shipping charge a SHIPPING_ADD creates or a SHIPPING_REMOVE takes back; required on SHIPPING_ADD.",
            "type": "string"
          },
          "restock": {
            "description": "On RECEIVE_RETURN_ITEM: whether the units go back on sale.",
            "type": "boolean"
          },
          "unit_price_minor": {
            "description": "The price of a new line on an exchange or a claim (0 for a replacement sent for nothing). Absent means the store's price for the variant in the order's currency. Refused on an edit, which prices new lines as EditLines does.",
            "format": "int64",
            "type": "integer"
          },
          "variant_id": {
            "description": "What ITEM_ADD adds as a new line.",
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OrderChangeActionInput": {
        "description": "One action of an order change, in Medusa's vocabulary. An edit takes ITEM_ADD, ITEM_REMOVE, ITEM_UPDATE, SHIPPING_ADD, SHIPPING_REMOVE and CREDIT_LINE_ADD; an exchange or a claim takes RETURN_ITEM, RECEIVE_RETURN_ITEM, RECEIVE_DAMAGED_RETURN_ITEM, ITEM_ADD (new lines only), SHIPPING_ADD, SHIPPING_REMOVE and CREDIT_LINE_ADD. A change that receives goods receives all of what it returns.",
        "properties": {
          "action": {
            "description": "Medusa's order-change action type.",
            "enum": [
              "ITEM_ADD",
              "ITEM_REMOVE",
              "ITEM_UPDATE",
              "RETURN_ITEM",
              "RECEIVE_RETURN_ITEM",
              "RECEIVE_DAMAGED_RETURN_ITEM",
              "SHIPPING_ADD",
              "SHIPPING_REMOVE",
              "CREDIT_LINE_ADD"
            ],
            "type": "string"
          },
          "amount_minor": {
            "description": "The amount of a SHIPPING_ADD or CREDIT_LINE_ADD. On the way out, every action's amount as the engine computed it — positive, with the action's type saying whether it adds or deducts. A RETURN_ITEM is priced net of the line's own promotions and with its tax share; a receipt moves nothing, because the value left the order when the return was asked for.",
            "format": "int64",
            "type": "integer"
          },
          "line_id": {
            "description": "The order line an item, return or receive action is about.",
            "format": "int64",
            "type": "integer"
          },
          "location_id": {
            "description": "On RECEIVE_RETURN_ITEM: the shelf. Absent means the one the line was picked from.",
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "reason": {
            "description": "On RETURN_ITEM: why the goods are coming back.",
            "type": "string"
          },
          "reference": {
            "description": "What a credit line refers to.",
            "type": "string"
          },
          "reference_id": {
            "description": "The shipping charge a SHIPPING_ADD creates or a SHIPPING_REMOVE takes back; required on SHIPPING_ADD.",
            "type": "string"
          },
          "restock": {
            "description": "On RECEIVE_RETURN_ITEM: whether the units go back on sale.",
            "type": "boolean"
          },
          "unit_price_minor": {
            "description": "The price of a new line on an exchange or a claim (0 for a replacement sent for nothing). Absent means the store's price for the variant in the order's currency. Refused on an edit, which prices new lines as EditLines does.",
            "format": "int64",
            "type": "integer"
          },
          "variant_id": {
            "description": "What ITEM_ADD adds as a new line.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "OrderChangeSet": {
        "description": "An order change (Medusa's order-change engine): an edit, an exchange or a claim, pending until it is confirmed or cancelled. original_total and new_total are what the order comes to either side of it — its total less credit lines less the value of returns that still stand — and pending_difference is new_total less what payments less refunds already cover: positive is owed by the customer, negative is owed to them. A pending change carries its last preview's figures; a confirmed one the figures it was applied with. Money moves in neither: settling the difference is a refund or a payment.",
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/OrderChangeAction"
            },
            "type": "array"
          },
          "actor": {
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "confirmed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "edit",
              "exchange",
              "claim"
            ],
            "type": "string"
          },
          "new_total": {
            "$ref": "#/components/schemas/Money"
          },
          "note": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "original_total": {
            "$ref": "#/components/schemas/Money"
          },
          "pending_difference": {
            "$ref": "#/components/schemas/Money"
          },
          "return_ids": {
            "description": "The returns the change created.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "pending",
              "confirmed",
              "cancelled"
            ],
            "type": "string"
          },
          "total_delta": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What confirming moved the order's own total by: new lines and shipping charges, not returns or credit."
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderDownload": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "left": {
            "type": "integer"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "filename",
          "size_bytes",
          "token",
          "expires_at",
          "left"
        ],
        "type": "object"
      },
      "OrderEmail": {
        "properties": {
          "audience": {
            "enum": [
              "store",
              "customer"
            ],
            "type": "string"
          },
          "custom_recipients": {
            "description": "Whether the store set its own list.",
            "type": "boolean"
          },
          "customized": {
            "description": "Whether the store changed anything about the message.",
            "type": "boolean"
          },
          "default_recipients": {
            "description": "Where a message to the store goes with no list of its own.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "event": {
            "description": "The message's event, as the templates name it.",
            "type": "string"
          },
          "recipients": {
            "description": "Where a message to the store goes: the store's own list, else default_recipients. Empty for a message to the customer (it goes to the order's address).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "event",
          "audience",
          "title",
          "enabled",
          "recipients",
          "default_recipients",
          "custom_recipients",
          "customized"
        ],
        "type": "object"
      },
      "OrderEmailInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "recipients": {
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          }
        },
        "type": "object"
      },
      "OrderExport": {
        "properties": {
          "buyer_tax_id": {
            "type": "string"
          },
          "customs_office": {
            "type": "string"
          },
          "delivery_place": {
            "type": "string"
          },
          "etgb_number": {
            "type": "string"
          },
          "gtb_number": {
            "type": "string"
          },
          "incoterm": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "transport_mode": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "incoterm",
          "transport_mode",
          "updated_at"
        ],
        "type": "object"
      },
      "OrderExportInput": {
        "properties": {
          "buyer_tax_id": {
            "description": "The foreign buyer's own tax or passport number; replaces the store's foreign-buyer default on the invoice.",
            "type": "string"
          },
          "customs_office": {
            "type": "string"
          },
          "delivery_place": {
            "description": "The named place of the term.",
            "type": "string"
          },
          "etgb_number": {
            "description": "The ETGB (Elektronik Ticaret Gümrük Beyannamesi) number, when the goods leave by e-commerce customs declaration.",
            "type": "string"
          },
          "gtb_number": {
            "description": "The GTB customs declaration number, for a regular export declaration.",
            "type": "string"
          },
          "incoterm": {
            "description": "The Incoterms 2020 delivery term (case does not matter).",
            "enum": [
              "EXW",
              "FCA",
              "FAS",
              "FOB",
              "CFR",
              "CIF",
              "CPT",
              "CIP",
              "DAP",
              "DPU",
              "DDP"
            ],
            "type": "string"
          },
          "transport_mode": {
            "enum": [
              "sea",
              "rail",
              "road",
              "air",
              "post",
              "multimodal",
              "inland_water"
            ],
            "type": "string"
          }
        },
        "required": [
          "incoterm",
          "transport_mode"
        ],
        "type": "object"
      },
      "OrderLine": {
        "properties": {
          "adjustments": {
            "description": "What each promotion took off this line. `total` less their sum is what the line was charged before tax; a return refunds the line net of its own adjustments.",
            "items": {
              "$ref": "#/components/schemas/LineAdjustment"
            },
            "type": "array"
          },
          "delivery_note": {
            "description": "On a line never sent, the product's delivery note as sold (ADR-0045).",
            "type": "string"
          },
          "display_title": {
            "description": "The product in the language of the read (the store's order page), from the catalogue's published translations; filled on the way out, never stored, absent where that language has no translation. `title` stays the snapshot taken at checkout.",
            "type": "string"
          },
          "display_variant_label": {
            "description": "The variant in the language of the read, like display_title; `variant_label` stays the snapshot.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "description": "What the product looks like now, filled in on the way out and never stored (the rest of the line is a snapshot). Absent when the product was deleted or never had a picture.",
            "type": "string"
          },
          "licence_keys": {
            "$ref": "#/components/schemas/LineLicenceKeys"
          },
          "location_id": {
            "description": "Where these units were taken from, decided once at checkout so that cancelling puts them back on the shelf they left. Absent on a line placed before locations existed, or one whose location has since been closed.",
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "personalisation": {
            "description": "What the shopper asked for on this line, as sold (a snapshot: catalogue edits never reach it; ADR-0089), in the read's language. Absent for a plain line.",
            "items": {
              "$ref": "#/components/schemas/LinePersonalisation"
            },
            "type": "array"
          },
          "preorder": {
            "$ref": "#/components/schemas/LinePreorder"
          },
          "product_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "production_days": {
            "description": "How long the product took to make before it could be sent, as promised at checkout; absent when nothing.",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "requires_shipping": {
            "description": "Whether the line was a parcel when sold (snapshot); lines sold before migration 0092 read true.",
            "type": "boolean"
          },
          "return_requested_quantity": {
            "description": "Units on returns requested or authorized and not yet here: spoken for, so no longer returnable, but not back either.",
            "type": "integer"
          },
          "returned_quantity": {
            "description": "How many of this line have come back on returns that still stand. Summed on the way out, never stored, and absent when nothing has.",
            "type": "integer"
          },
          "shipped_quantity": {
            "description": "How many of this line have gone out, summed across the order's shipments. Derived on the way out, never stored.",
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/LineSource"
          },
          "subscription_days": {
            "description": "The shopper subscribed to this line on the product page, every so many days; absent for a one-off.",
            "maximum": 365,
            "minimum": 7,
            "type": "integer"
          },
          "tax": {
            "$ref": "#/components/schemas/LineTax"
          },
          "title": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money"
          },
          "variant_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "variant_label": {
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "The exception to the right of withdrawal the line was sold under (a snapshot, ADR-0088 §1); absent for an ordinary line. A shopper's return request for such a line is refused unless it is a defect claim (except hygiene_opened, mixed_inseparable and sealed_media_opened, which the store judges).",
            "enum": [
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderMinimumsBody": {
        "properties": {
          "minimums": {
            "items": {
              "$ref": "#/components/schemas/Money"
            },
            "type": "array"
          }
        },
        "required": [
          "minimums"
        ],
        "type": "object"
      },
      "OrderNote": {
        "properties": {
          "author_email": {
            "description": "Who wrote it; absent for the static admin token.",
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "visibility": {
            "enum": [
              "internal",
              "customer"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderNoteInput": {
        "properties": {
          "body": {
            "maxLength": 4000,
            "type": "string"
          },
          "visibility": {
            "default": "internal",
            "enum": [
              "internal",
              "customer"
            ],
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "OrderPatch": {
        "description": "Corrects what was recorded about an order: who it is for, and how it was paid for. Only the keys present are written.\n\nIt deliberately cannot reach status, payment status, totals or line items. Each of those is a state change with consequences — stock, events, money — and each already has an operation that performs them properly. This is for the fields somebody typed.",
        "properties": {
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "The country cannot change (400): the order's tax and shipping were priced for it."
          },
          "billing_address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Address"
              }
            ],
            "description": "The invoice address. Its country cannot change, like the shipping address's: tax and shipping were priced for it."
          },
          "email": {
            "description": "Required to be non-empty: it is how the customer hears about the order.",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Replaced whole, not merged: send the keys you want the order to end up with. The reserved key `notes` is the operator's note on this order — it must be a string, it is absent from the shopper's own read of the order, and it cannot be set at checkout. A patch that carries only `metadata` and changes nothing but `notes` emits no event and is accepted on a cancelled order, because a note is not a state change; a metadata patch that also alters another key is an ordinary edit and announces itself.",
            "type": "object"
          },
          "name": {
            "description": "Empty clears it.",
            "type": "string"
          },
          "payment_provider": {
            "description": "A method installed in this build. It may be changed while nothing has been refunded — an order taken as cash on delivery and actually settled by transfer should say so — but not after, where the money went out through the provider currently on the order.",
            "type": "string"
          },
          "payment_reference": {
            "description": "The transaction or receipt number the money is reconciled against.",
            "type": "string"
          },
          "phone": {
            "description": "Empty clears it.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderPresence": {
        "properties": {
          "editing": {
            "description": "Whether the caller holds the edit claim.",
            "type": "boolean"
          },
          "editor": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrderViewer"
              },
              {
                "type": "null"
              }
            ]
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "ttl_seconds": {
            "type": "integer"
          },
          "viewers": {
            "items": {
              "$ref": "#/components/schemas/OrderViewer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OrderPresenceInput": {
        "properties": {
          "editing": {
            "type": "boolean"
          },
          "take_over": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "OrderReturn": {
        "description": "Goods coming back off an order, along the return lifecycle: requested → authorized → received → inspected → closed, or rejected / cancelled before anything arrived; a received return recorded in error is withdrawn. It moves no money: refundable is what the goods were worth — unit price times quantity, less the line's own promotion adjustments, plus its share of the tax where prices exclude it — and proposed_refund adds the shipping offered back. Refunding is its own operation, POST /api/admin/orders/{id}/returns/{returnId}/refund.",
        "properties": {
          "authorized_at": {
            "format": "date-time",
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "closed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "inspected_at": {
            "format": "date-time",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/OrderReturnLine"
            },
            "type": "array"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "note": {
            "description": "Why the return was rejected, or what its inspection found.",
            "type": "string"
          },
          "order_change_id": {
            "description": "The exchange or claim that asked for this return.",
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "proposed_refund": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "refundable plus shipping_refund: what the refund route sends back when it is not told an amount."
          },
          "reason": {
            "type": "string"
          },
          "received_at": {
            "format": "date-time",
            "type": "string"
          },
          "refundable": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What the goods were worth. NOT a refund amount: no money moved on this record."
          },
          "refunded": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What has actually gone back for this return."
          },
          "requested_by": {
            "description": "Whose request the return was: the store's own, or the customer's, asked with the order's link (POST /api/orders/{number}/returns).",
            "enum": [
              "store",
              "customer"
            ],
            "type": "string"
          },
          "restocked_units": {
            "description": "How many of them went back on sale. Less than units whenever something came back damaged.",
            "type": "integer"
          },
          "shipping_refund": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "How much of the order's shipping the store offered back with this return, decided when it was requested."
          },
          "status": {
            "description": "requested, authorized, received, inspected and closed still stand: they count against what may come back off each line. rejected and cancelled ended before anything arrived; withdrawn means a received return was taken back and its units came off the shelf again.",
            "enum": [
              "requested",
              "authorized",
              "received",
              "inspected",
              "closed",
              "rejected",
              "cancelled",
              "withdrawn"
            ],
            "type": "string"
          },
          "units": {
            "description": "What the return counts against the order: requested units until the goods arrive, received units after.",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderReturnLine": {
        "description": "How much of one order line came back. The sku, title and label are joined in on the way out, because the row itself stores an id and a count.",
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "location_id": {
            "description": "The shelf they went back on. Absent when nothing moved.",
            "format": "int64",
            "type": "integer"
          },
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "description": "What this line counts against the order line: the request until the goods arrive, what arrived after — which may be none.",
            "type": "integer"
          },
          "reason": {
            "description": "The reason's label when the line named it.",
            "type": "string"
          },
          "reason_id": {
            "description": "The return reason the line named, while it exists.",
            "format": "int64",
            "type": "integer"
          },
          "refundable": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What these units were worth, snapshotted when the return was recorded."
          },
          "requested_quantity": {
            "description": "What was asked to come back.",
            "type": "integer"
          },
          "restocked": {
            "description": "Whether these units went back on sale. It records what happened rather than what was asked: a line whose variant has since been deleted stores false, because there is no shelf left to put it back on.",
            "type": "boolean"
          },
          "restocked_quantity": {
            "description": "How many of `quantity` went back on sale; the rest came back damaged.",
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderRisk": {
        "properties": {
          "level": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "reasons": {
            "items": {
              "$ref": "#/components/schemas/RiskReason"
            },
            "type": "array"
          },
          "score": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "score",
          "level",
          "reasons"
        ],
        "type": "object"
      },
      "OrderSource": {
        "description": "The channel an order came from, from the store's own visits.",
        "properties": {
          "campaign": {
            "type": "string"
          },
          "click_id": {
            "description": "Which ad click id the landing page carried (gclid, fbclid, ttclid, msclkid, …), never its value.",
            "type": "string"
          },
          "landing_path": {
            "type": "string"
          },
          "medium": {
            "description": "organic, cpc, social, paid_social, email, ai, video, referral or direct; utm_medium when the link set one.",
            "type": "string"
          },
          "referrer": {
            "type": "string"
          },
          "source": {
            "description": "google, facebook, instagram, tiktok, email, direct, or the referring site's host; utm_source when the link set one.",
            "type": "string"
          }
        },
        "required": [
          "source",
          "medium"
        ],
        "type": "object"
      },
      "OrderSummary": {
        "description": "An order's money position in its currency's minor units (Medusa's order summary). current_order_total_minor is the order total less the credit it was given, less the value of returns that still stand (requested ones included) and the shipping offered back with them. paid_total_minor is what gateway payments captured, or for an order paid outside a gateway its total as it stood when it was paid. pending_difference_minor is current less paid less refunded: positive is owed by the customer, negative is owed to them.",
        "properties": {
          "credit_line_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "current_order_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "order_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "paid_offline": {
            "description": "The order was marked paid by hand (no gateway capture): money taken outside the store, or a payment recorded without one. Nothing at a gateway can give it back: a manual refund is recorded, or the order is marked unpaid when no money was taken.",
            "type": "boolean"
          },
          "paid_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "pending_difference_minor": {
            "format": "int64",
            "type": "integer"
          },
          "refunded_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "return_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "transaction_total_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OrderTagCount": {
        "properties": {
          "orders": {
            "type": "integer"
          },
          "tag": {
            "type": "string"
          }
        },
        "required": [
          "tag",
          "orders"
        ],
        "type": "object"
      },
      "OrderTagging": {
        "properties": {
          "assignee": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "order_id",
          "tags",
          "assignee"
        ],
        "type": "object"
      },
      "OrderTimelineEntry": {
        "description": "One thing that happened to an order, merged from the outbox and the audit trail. A transition caused by an operator writes into both in one transaction and renders here once, carrying the actor from the trail and the delivery state from the outbox.",
        "properties": {
          "action": {
            "description": "The operator's verb, absent on an entry with no audit row behind it. Deliberately not the event name: `order.edit_lines` and `order.update` both announce `order.edited`.",
            "type": "string"
          },
          "actor_email": {
            "description": "The operator's email as it was then. Absent for a token and for the system — a credential is not a person.",
            "type": "string"
          },
          "actor_kind": {
            "description": "A person, a script holding a static admin token, or the engine's own background work.",
            "enum": [
              "operator",
              "token",
              "system"
            ],
            "type": "string"
          },
          "actor_label": {
            "description": "A name for a caller that is not a person: a sweeper, a cron job, a module.",
            "type": "string"
          },
          "actor_role": {
            "description": "The role they held at the time, which may not be the one they hold now.",
            "type": "string"
          },
          "after": {
            "additionalProperties": true,
            "description": "The same fields, as they became.",
            "type": "object"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "attempts": {
            "description": "Delivery attempts so far. Absent means none.",
            "type": "integer"
          },
          "before": {
            "additionalProperties": true,
            "description": "The fields this act moved, as they were. Money keys are the same `*_minor` integers the API uses. Absent means the previous value was not recorded, never that it was empty.",
            "type": "object"
          },
          "change": {
            "$ref": "#/components/schemas/OrderChange"
          },
          "dead": {
            "description": "The engine has given up delivering it.",
            "type": "boolean"
          },
          "event_id": {
            "description": "The event's own id, stable across redeliveries.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "`action` where somebody was recorded doing this, `event` where all that survives is the announcement — a transition from before the trail existed, or one whose record names no event.",
            "enum": [
              "action",
              "event"
            ],
            "type": "string"
          },
          "last_error": {
            "description": "What the failing handler said. Returned only to a caller holding `store.operate`, and absent otherwise: it is a raw error string and can carry an upstream URL or a fragment of a key.",
            "type": "string"
          },
          "name": {
            "description": "The event this announced, absent where it announced nothing. Writing a note is the one order write that is deliberately quiet.",
            "enum": [
              "order.created",
              "order.paid",
              "order.shipped",
              "order.delivered",
              "order.cancelled",
              "order.refunded",
              "order.edited",
              "order.returned",
              "order.authorized",
              "order.note_added",
              "order.unpaid",
              "order.undelivered",
              "order.unshipped",
              "order.unreturned",
              "return.requested",
              "return.authorized",
              "return.rejected",
              "return.inspected",
              "return.closed",
              "return.cancelled",
              "order_change.requested",
              "order_change.confirmed",
              "order_change.cancelled"
            ],
            "type": "string"
          },
          "payment_status": {
            "type": "string"
          },
          "published_at": {
            "description": "When every subscribed handler accepted it. Absent means it is still queued — or, with `dead`, that nobody could be told at all.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "description": "The order's status as the event left it.",
            "type": "string"
          },
          "summary": {
            "description": "What the act was, in a sentence.",
            "type": "string"
          },
          "tracking": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderViewer": {
        "properties": {
          "editing": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "since": {
            "format": "date-time",
            "type": "string"
          },
          "superuser_id": {
            "format": "int64",
            "type": "integer"
          },
          "you": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "OutboxEvent": {
        "description": "One row of the transactional outbox: the delivery facts around an event, not the event as a handler received it — hence `payload` rather than `data`.",
        "properties": {
          "aggregate_id": {
            "format": "int64",
            "type": "integer"
          },
          "aggregate_type": {
            "example": "order",
            "type": "string"
          },
          "attempts": {
            "description": "Incremented on claim. At 12 the row is parked dead. A retry resets it only on a dead row.",
            "type": "integer"
          },
          "available_at": {
            "description": "When the dispatcher may next take it. In the future means either backed off or claimed by a worker; nothing in the row tells those apart.",
            "format": "date-time",
            "type": "string"
          },
          "correlation_id": {
            "description": "The id of the request that caused the event (its X-Request-Id). Subscribers run under it, so the jobs they queue and the provider calls they make carry it too. Absent for work no request caused.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The event uuid, which is what every route here takes and every log line prints.",
            "format": "uuid",
            "type": "string"
          },
          "last_error": {
            "description": "Why the last attempt failed. A retry does not clear it — the diagnosis outlives the repair.",
            "type": "string"
          },
          "name": {
            "example": "order.paid",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "description": "Omitted from list responses; returned by the detail route.",
            "type": "object"
          },
          "published_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "seq": {
            "description": "The table's row number. Ordering only — the list sorts on it because it is the dispatcher's own ordering key. An event's identity is `id`.",
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "description": "Derived. `published` wins over `dead`: a row can hold both flags when a slow batch outlives its visibility window, and the delivery is the fact that matters.",
            "enum": [
              "pending",
              "dead",
              "published"
            ],
            "type": "string"
          },
          "v": {
            "description": "The payload's schema version.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OverviewBucket": {
        "properties": {
          "orders": {
            "type": "integer"
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "start",
          "orders",
          "total"
        ],
        "type": "object"
      },
      "OverviewSales": {
        "properties": {
          "average_order": {
            "$ref": "#/components/schemas/Money"
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/OverviewBucket"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "prev_average_order": {
            "$ref": "#/components/schemas/Money"
          },
          "prev_orders": {
            "type": "integer"
          },
          "prev_refunded": {
            "$ref": "#/components/schemas/Money"
          },
          "prev_refunds": {
            "type": "integer"
          },
          "prev_total": {
            "$ref": "#/components/schemas/Money"
          },
          "refunded": {
            "$ref": "#/components/schemas/Money"
          },
          "refunds": {
            "description": "Succeeded refunds in the period, by the day they went out.",
            "type": "integer"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "units": {
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "orders",
          "prev_orders",
          "units",
          "total",
          "prev_total",
          "average_order",
          "prev_average_order",
          "refunds",
          "prev_refunds",
          "refunded",
          "prev_refunded",
          "buckets"
        ],
        "type": "object"
      },
      "OwnerRequest": {
        "description": "A store's suggestion or request to the platform (the panel's \"Öneri gönder\"). Every text is plain text as typed: render it as text, never as markup.",
        "properties": {
          "actor_email": {
            "description": "Who sent it (empty for the static token).",
            "type": "string"
          },
          "body": {
            "maxLength": 5000,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "has_image": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "description": "The screenshot as a data: URL (image/png, image/jpeg or image/webp); on a single request's read only.",
            "type": "string"
          },
          "notify_status": {
            "description": "The platform's email about it: sent by the platform mailer, queued on the store's email backend, skipped (no address or no way to send).",
            "enum": [
              "pending",
              "sent",
              "queued",
              "skipped",
              "failed"
            ],
            "type": "string"
          },
          "page_path": {
            "description": "The panel page it was sent from.",
            "type": "string"
          },
          "page_title": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "normal",
              "urgent"
            ],
            "type": "string"
          },
          "replied_at": {
            "format": "date-time",
            "type": "string"
          },
          "reply": {
            "description": "The platform's answer; empty until there is one.",
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_progress",
              "done",
              "declined"
            ],
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "store_name": {
            "description": "Control plane only.",
            "type": "string"
          },
          "tenant_id": {
            "description": "Control plane only.",
            "format": "int64",
            "type": "integer"
          },
          "tenant_name": {
            "description": "Control plane only.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "store_id",
          "actor_email",
          "page_path",
          "page_title",
          "body",
          "priority",
          "status",
          "reply",
          "has_image",
          "notify_status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "OwnerRequestInput": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "maxLength": 5000,
            "minLength": 1,
            "type": "string"
          },
          "image": {
            "description": "Optional screenshot: data:image/png|jpeg|webp;base64,… (at most 2 MB of image).",
            "type": "string"
          },
          "page_path": {
            "maxLength": 500,
            "type": "string"
          },
          "page_title": {
            "maxLength": 200,
            "type": "string"
          },
          "priority": {
            "default": "normal",
            "enum": [
              "normal",
              "urgent"
            ],
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "POSSaleInput": {
        "properties": {
          "discount_code": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "quantity": {
                  "minimum": 1,
                  "type": "integer"
                },
                "variant_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "variant_id",
                "quantity"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "location_id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "tender": {
            "description": "cash or card at the till; qr: the customer pays by card from their phone on the order's pay page (the answer's pay_url), and the sale is handed over once paid",
            "enum": [
              "cash",
              "card",
              "qr"
            ],
            "type": "string"
          }
        },
        "required": [
          "lines",
          "tender"
        ],
        "type": "object"
      },
      "POSSummary": {
        "properties": {
          "after_fees": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Net less the estimated commission."
          },
          "attention": {
            "type": "integer"
          },
          "captured": {
            "$ref": "#/components/schemas/Money"
          },
          "commission": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Estimated over the payments whose POS has a rate."
          },
          "currency": {
            "type": "string"
          },
          "installment_payments": {
            "type": "integer"
          },
          "net": {
            "$ref": "#/components/schemas/Money"
          },
          "payments": {
            "type": "integer"
          },
          "provider": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "refunded": {
            "$ref": "#/components/schemas/Money"
          },
          "unrated": {
            "description": "Captured payments with no rate to price.",
            "type": "integer"
          }
        },
        "required": [
          "provider",
          "provider_name",
          "currency",
          "payments",
          "captured",
          "refunded",
          "net",
          "attention",
          "installment_payments"
        ],
        "type": "object"
      },
      "PTTTestResult": {
        "properties": {
          "error": {
            "description": "PTT Kargo's reason when the test failed.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "PackItem": {
        "properties": {
          "available": {
            "description": "Whether that many of it can be sold now.",
            "type": "boolean"
          },
          "image_url": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "product_id",
          "variant_id",
          "quantity",
          "title",
          "slug",
          "available"
        ],
        "type": "object"
      },
      "PageCheckpoint": {
        "properties": {
          "area": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "save",
              "auto"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version_id",
          "revision",
          "kind",
          "area",
          "label",
          "created_by_label",
          "created_at"
        ],
        "type": "object"
      },
      "PageCheckpointInput": {
        "properties": {
          "area": {
            "description": "'' the whole page, meta, sections or sections/\u003csection id\u003e.",
            "maxLength": 120,
            "type": "string"
          },
          "label": {
            "maxLength": 120,
            "type": "string"
          },
          "revision": {
            "description": "The draft revision the save point is of.",
            "type": "integer"
          }
        },
        "required": [
          "revision"
        ],
        "type": "object"
      },
      "PageDocument": {
        "description": "A page document in the section model (ADR-0069): the sections a theme template holds — {id, type, settings, blocks, disabled} — with the box every section has (hide, space_top, space_bottom, heading_size and text_size per device), a colour scheme and custom_css. Texts are plain strings (a version is one language's). Only page section types.",
        "properties": {
          "free_design": {
            "$ref": "#/components/schemas/FreeDesign"
          },
          "root": {
            "properties": {
              "props": {
                "additionalProperties": true,
                "type": "object"
              }
            },
            "type": "object"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "maxItems": 60,
            "type": "array"
          },
          "version": {
            "enum": [
              2
            ],
            "type": "integer"
          }
        },
        "required": [
          "version",
          "root",
          "sections"
        ],
        "type": "object"
      },
      "PageEditor": {
        "properties": {
          "box_fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionFieldSchema"
            },
            "type": "object"
          },
          "can_edit_css": {
            "description": "Whether this operator may change a section's own CSS (theme.publish).",
            "type": "boolean"
          },
          "changes": {
            "description": "Areas the working copy changes against the live version: meta, sections (order, added or removed sections), sections/\u003cid\u003e.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "color_schemes": {
            "items": {
              "$ref": "#/components/schemas/ThemeColorScheme"
            },
            "type": "array"
          },
          "converted": {
            "description": "The stored document was in the older Puck form; the first save stores it in the section model.",
            "type": "boolean"
          },
          "css": {
            "properties": {
              "field": {
                "$ref": "#/components/schemas/SectionFieldSchema"
              },
              "section_max": {
                "type": "integer"
              }
            },
            "required": [
              "field",
              "section_max"
            ],
            "type": "object"
          },
          "devices": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "document": {
            "$ref": "#/components/schemas/PageDocument"
          },
          "language": {
            "enum": [
              "tr",
              "en",
              "de",
              "fr",
              "it",
              "es",
              "nl",
              "da",
              "sv",
              "pl",
              "ru",
              "ar"
            ],
            "type": "string"
          },
          "max_sections": {
            "type": "integer"
          },
          "page": {
            "$ref": "#/components/schemas/ContentPage"
          },
          "popup": {
            "$ref": "#/components/schemas/PopupRules",
            "description": "A popup's rules with every default filled in (ADR-0085 §9); absent on other pages."
          },
          "published": {
            "$ref": "#/components/schemas/ContentVersion"
          },
          "revision": {
            "description": "The working copy's revision; 0 while there is none.",
            "type": "integer"
          },
          "sections": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionSchemaV2"
            },
            "description": "The page section types a page may hold, by type.",
            "type": "object"
          },
          "theme_id": {
            "type": "string"
          },
          "working": {
            "$ref": "#/components/schemas/ContentVersion"
          }
        },
        "required": [
          "page",
          "language",
          "document",
          "converted",
          "revision",
          "sections",
          "box_fields",
          "devices",
          "max_sections",
          "css",
          "can_edit_css",
          "color_schemes",
          "theme_id",
          "changes"
        ],
        "type": "object"
      },
      "PageRevertInput": {
        "properties": {
          "area": {
            "description": "'' the whole page, meta, sections or sections/\u003csection id\u003e.",
            "maxLength": 120,
            "type": "string"
          },
          "revision": {
            "type": "integer"
          }
        },
        "required": [
          "revision"
        ],
        "type": "object"
      },
      "PageSize": {
        "description": "A page document's use of the budgets a save is checked against (ADR-0085 §8, the editor's page size meter, VB-8): the free layouts' DOM nodes and generated CSS bytes, the most nodes in one free layout, the sections and the document's bytes, each with its limit.",
        "properties": {
          "bytes": {
            "description": "The document's bytes.",
            "type": "integer"
          },
          "bytes_max": {
            "type": "integer"
          },
          "css": {
            "description": "Generated CSS of the free layouts, bytes (an estimate).",
            "type": "integer"
          },
          "css_max": {
            "type": "integer"
          },
          "dom": {
            "description": "DOM nodes the free layouts print (an upper bound).",
            "type": "integer"
          },
          "dom_max": {
            "type": "integer"
          },
          "nodes": {
            "description": "The most items in one free layout.",
            "type": "integer"
          },
          "nodes_max": {
            "type": "integer"
          },
          "sections": {
            "type": "integer"
          },
          "sections_max": {
            "type": "integer"
          }
        },
        "required": [
          "dom",
          "dom_max",
          "css",
          "css_max",
          "nodes",
          "nodes_max",
          "sections",
          "sections_max",
          "bytes",
          "bytes_max"
        ],
        "type": "object"
      },
      "PaidSales": {
        "description": "The settled slice. Partiality is a number and not a status (D36), so an order that has had some of its money sent back is still `paid` and its whole total is here — `refunded` and `net_collected` are what say how much of it the store still holds.",
        "properties": {
          "net_collected": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "total less refunded — what the store actually still holds."
          },
          "orders": {
            "type": "integer"
          },
          "refunded": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "refunded_minor summed over exactly these orders: money that has gone back out of orders still recorded as paid."
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "orders",
          "total",
          "refunded",
          "net_collected"
        ],
        "type": "object"
      },
      "PanelAttempt": {
        "description": "One call made to the payment provider, with who made it.",
        "properties": {
          "actor": {
            "description": "The operator's e-mail, \"token\" for the static token, empty for the engine itself.",
            "type": "string"
          },
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "decline_code": {
            "description": "The refusal's category, one of the decline codes.",
            "type": "string"
          },
          "detail": {
            "description": "The provider's own words, anything like a card number masked.",
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "operation": {
            "enum": [
              "initiate",
              "complete",
              "capture",
              "void",
              "refund",
              "status"
            ],
            "type": "string"
          },
          "outcome": {
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "unknown"
            ],
            "type": "string"
          },
          "provider_code": {
            "description": "The provider's own code for the refusal.",
            "type": "string"
          },
          "receipt": {
            "$ref": "#/components/schemas/PaymentReceipt"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "operation",
          "outcome",
          "started_at"
        ],
        "type": "object"
      },
      "PanelCaps": {
        "description": "What the payment's gateway can do.",
        "properties": {
          "capture": {
            "type": "boolean"
          },
          "partial_capture": {
            "type": "boolean"
          },
          "partial_refund": {
            "type": "boolean"
          },
          "refund": {
            "type": "boolean"
          },
          "status_query": {
            "type": "boolean"
          },
          "void": {
            "type": "boolean"
          },
          "void_captured": {
            "type": "boolean"
          },
          "void_same_day": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PanelPayment": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Payment"
          },
          {
            "properties": {
              "attempts": {
                "items": {
                  "$ref": "#/components/schemas/PanelAttempt"
                },
                "type": "array"
              },
              "caps": {
                "$ref": "#/components/schemas/PanelCaps"
              },
              "capturable": {
                "$ref": "#/components/schemas/Money"
              },
              "commission": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Money"
                  }
                ],
                "description": "The estimate from the commissions typed in payment routing; the bank's statement is the record."
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "end_of_day": {
                "description": "open: the bank's day is still open, a void is possible; closed: money goes back by refund; none: the gateway has no such window.",
                "enum": [
                  "open",
                  "closed",
                  "none"
                ],
                "type": "string"
              },
              "kind": {
                "description": "sale: taken at once; preauth: authorised and captured later.",
                "enum": [
                  "sale",
                  "preauth"
                ],
                "type": "string"
              },
              "net": {
                "$ref": "#/components/schemas/Money"
              },
              "provider_name": {
                "type": "string"
              },
              "receipt": {
                "$ref": "#/components/schemas/PaymentReceipt"
              },
              "refundable": {
                "$ref": "#/components/schemas/Money"
              }
            },
            "required": [
              "provider_name",
              "kind",
              "caps",
              "end_of_day",
              "refundable",
              "capturable",
              "net",
              "created_at",
              "attempts"
            ],
            "type": "object"
          }
        ]
      },
      "ParasutCollectionAccount": {
        "properties": {
          "account": {
            "description": "The account's name in Paraşüt.",
            "type": "string"
          },
          "accounts": {
            "description": "The names of the cash and bank accounts in this currency.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "enum": [
              "TRY",
              "EUR",
              "USD",
              "GBP"
            ],
            "type": "string"
          },
          "why": {
            "description": "Why there is no account: the one named under Settings is not found in this currency, there is no bank account in it, or several.",
            "enum": [
              "named",
              "no_bank",
              "several_banks"
            ],
            "type": "string"
          }
        },
        "required": [
          "currency"
        ],
        "type": "object"
      },
      "ParasutTestResult": {
        "properties": {
          "collections": {
            "description": "Per currency, the cash or bank account a paid order's collection would be recorded in, or why none.",
            "items": {
              "$ref": "#/components/schemas/ParasutCollectionAccount"
            },
            "type": "array"
          },
          "company_id": {
            "type": "string"
          },
          "company_name": {
            "type": "string"
          },
          "environment": {
            "enum": [
              "sandbox",
              "production"
            ],
            "type": "string"
          },
          "error": {
            "description": "Paraşüt's answer when it refused (sanitised: no credential or token), or why the company did not match.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "user": {
            "description": "The signed-in Paraşüt user's e-mail.",
            "type": "string"
          }
        },
        "required": [
          "ok",
          "environment"
        ],
        "type": "object"
      },
      "PasswordResetAccepted": {
        "description": "The answer to a reset request. `accepted` is always true: the route will not say whether the address belongs to an operator.",
        "properties": {
          "accepted": {
            "type": "boolean"
          },
          "delivery": {
            "description": "How this store delivers a link. `none` means no email backend is installed, nothing will arrive, and no token was written — a fact about configuration, the same for every caller.",
            "enum": [
              "email",
              "none"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PasswordResetTarget": {
        "description": "Everything a lookup will say about a live link. The account behind it is deliberately not named.",
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PayAgainInput": {
        "description": "The payment half of CheckoutInput, for paying an existing order again (POST /api/orders/{number}/pay/{code}, ADR-0134). A card never travels here for a gateway that takes it on its own page or form.",
        "properties": {
          "card_bin": {
            "description": "The card's first 6–8 digits, for the one card choice (card_router) of a store that routes card payments: it picks the POS. Never stored.",
            "pattern": "^[0-9]{6,8}$",
            "type": "string"
          },
          "card_last4": {
            "description": "The card's last four digits, for the store's fraud rules (ADR-0140): with the BIN it is kept only as a hash. Omitted checks the BIN alone.",
            "pattern": "^[0-9]{4}$",
            "type": "string"
          },
          "installments": {
            "description": "The installment count (taksit), for a method that takes installments; omitted, 0 or 1 is a single payment.",
            "maximum": 36,
            "minimum": 0,
            "type": "integer"
          },
          "payment_data": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Passed through to the payment provider, so a gateway can receive what it needs without this body growing a field per integration. Keys a gateway reads are listed with the gateway; `identity_number` (the buyer's Turkish national id, TCKN) is passed to gateways that ask for it and never stored.",
            "type": "object"
          },
          "return_url": {
            "description": "Where the provider sends the shopper back after a hosted page or a 3-D Secure challenge.",
            "maxLength": 2048,
            "type": "string"
          }
        },
        "type": "object"
      },
      "Payment": {
        "description": "A provider payment for an order (M5): what the provider authorized, captured and refunded, in minor units.",
        "properties": {
          "amount": {
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "amount_mismatch": {
            "description": "The provider reported a different amount or currency; nothing was applied and an operator must look.",
            "type": "boolean"
          },
          "authorized": {
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "captured": {
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "decline": {
            "description": "The bank's last reason for turning the payment down, while it is not paid; absent when none is known.",
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "code": {
                "enum": [
                  "insufficient_funds",
                  "limit_exceeded",
                  "3ds_failed",
                  "3ds_unavailable",
                  "not_permitted",
                  "expired_card",
                  "invalid_card",
                  "wrong_cvv",
                  "do_not_honor",
                  "call_bank",
                  "lost_stolen",
                  "restricted_card",
                  "bank_unavailable",
                  "other"
                ],
                "type": "string"
              },
              "detail": {
                "description": "The provider's own words: codes and message, never card data.",
                "type": "string"
              },
              "provider_code": {
                "description": "The provider's own code for the refusal (\"51\", \"131131\", \"md:0\").",
                "type": "string"
              }
            },
            "required": [
              "code",
              "at"
            ],
            "type": "object"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "installments": {
            "description": "The installment count the provider charged; absent when it reported none.",
            "type": "integer"
          },
          "items": {
            "description": "The provider's transaction id for each basket item, and what has been refunded against it (iyzico's per-item refunds).",
            "items": {
              "properties": {
                "amount_minor": {
                  "format": "int64",
                  "type": "integer"
                },
                "item_id": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "refunded_minor": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "paid": {
            "description": "What the shopper was charged, present only when it differs from amount: the installment charge a provider added when the shopper pays it (ADR-0023). The order amount is still what the provider confirmed.",
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "provider": {
            "type": "string"
          },
          "reference": {
            "description": "The provider's own id for the payment.",
            "type": "string"
          },
          "refunded": {
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "status": {
            "enum": [
              "created",
              "requires_action",
              "authorized",
              "partially_captured",
              "captured",
              "voided",
              "failed",
              "canceled"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentBadge": {
        "description": "A payment mark of the catalogue (kernel/core/payment_marks.json): a card scheme, wallet, buy-now-pay-later, bank or gateway brand, or a generic mark.",
        "enum": [
          "visa",
          "mastercard",
          "troy",
          "amex",
          "iyzico",
          "iyzico_band",
          "paytr",
          "param",
          "sipay",
          "masterpass",
          "bank_transfer",
          "cash_on_delivery",
          "maestro",
          "visa_electron",
          "discover",
          "diners_club",
          "jcb",
          "unionpay",
          "cartes_bancaires",
          "dankort",
          "paypal",
          "apple_pay",
          "google_pay",
          "samsung_pay",
          "amazon_pay",
          "alipay",
          "wechat_pay",
          "revolut",
          "wise",
          "skrill",
          "neteller",
          "paysafecard",
          "venmo",
          "cash_app_pay",
          "satispay",
          "bizum",
          "mb_way",
          "mobilepay",
          "vipps",
          "swish",
          "twint",
          "lydia",
          "payconiq",
          "klarna",
          "afterpay",
          "clearpay",
          "affirm",
          "riverty",
          "scalapay",
          "alma",
          "oney",
          "sequra",
          "zip",
          "sezzle",
          "tabby",
          "tamara",
          "billie",
          "sepa_transfer",
          "sepa_direct_debit",
          "ideal",
          "ideal_wero",
          "wero",
          "bancontact",
          "sofort",
          "eps",
          "przelewy24",
          "blik",
          "trustly",
          "stripe",
          "adyen",
          "braintree",
          "gift_card"
        ],
        "type": "string"
      },
      "PaymentInstructions": {
        "description": "What the shopper was told to do to pay an order placed with bank transfer (W24): the accounts in the order's currency as they were at checkout, the amount owed (the order's total), the reference to quote and when the order is cancelled if the money has not arrived.",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/BankTransferAccount"
            },
            "type": "array"
          },
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "method": {
            "examples": [
              "bank_transfer"
            ],
            "type": "string"
          },
          "reference": {
            "description": "The payment description to write on the transfer (the store's reference format, by default the order number).",
            "type": "string"
          }
        },
        "required": [
          "method",
          "reference",
          "amount",
          "due_at",
          "accounts"
        ],
        "type": "object"
      },
      "PaymentIntent": {
        "properties": {
          "client_data": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "What the client needs, by provider. A redirect carries `url`. A direct-post card form (PayTR Direkt API, ZiraatPay Direct POST — ADR-0023 §6) carries `flow` = `direct`, `form_action` and `method`: the provider's URL the browser posts to; `fields`: the hidden fields as a JSON object of strings (for PayTR the signed `paytr_token` among them); `card_fields`: the comma-separated names of the card inputs the storefront adds; `card_check` = `luhn`: check the number before posting. The card is posted by the browser straight to the provider and must never be sent to this API.",
            "example": {
              "client_secret": "pi_..."
            },
            "type": "object"
          },
          "kind": {
            "description": "`none` means nothing further is needed — cash on delivery. `client_action`: the page completes payment (`client_data`); `redirect`: send the shopper to `client_data.url`; `failed`: the provider declined — the order waits, unpaid, and the same checkout (same Idempotency-Key) may be retried until the order expires.",
            "enum": [
              "none",
              "client_action",
              "redirect",
              "failed"
            ],
            "type": "string"
          },
          "payment_id": {
            "description": "The engine's payment behind a gateway checkout: the id a storefront completes a redirect or 3-D Secure return with (POST /api/payments/{id}/complete). Absent for a method that is not a gateway (cash on delivery).",
            "format": "int64",
            "type": "integer"
          },
          "provider": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentLinkResult": {
        "properties": {
          "channel": {
            "enum": [
              "email",
              "sms"
            ],
            "type": "string"
          },
          "to": {
            "description": "The address, partly masked.",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "channel",
          "to",
          "url"
        ],
        "type": "object"
      },
      "PaymentOrder": {
        "description": "The order a store offers its payment methods in.",
        "properties": {
          "codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "codes"
        ],
        "type": "object"
      },
      "PaymentPanel": {
        "description": "The order's payment panel.",
        "properties": {
          "approval_threshold": {
            "$ref": "#/components/schemas/Money"
          },
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/RefundApproval"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "pay_link": {
            "description": "The channels an unpaid order's payment link can go out on; empty when the order cannot be paid again.",
            "items": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "payments": {
            "items": {
              "$ref": "#/components/schemas/PanelPayment"
            },
            "type": "array"
          },
          "refund_remaining": {
            "$ref": "#/components/schemas/Money"
          },
          "shipping": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "order_id",
          "currency",
          "payments",
          "refund_remaining",
          "shipping",
          "approvals",
          "pay_link"
        ],
        "type": "object"
      },
      "PaymentReceipt": {
        "description": "What the provider said about one call: approval code, its ids, the card masked to its first six and last four digits, the card's brand and bank, and the 3-D Secure result. Never more card data than that.",
        "properties": {
          "auth_code": {
            "type": "string"
          },
          "card_brand": {
            "type": "string"
          },
          "card_family": {
            "type": "string"
          },
          "card_issuer": {
            "type": "string"
          },
          "card_masked": {
            "type": "string"
          },
          "host_reference": {
            "type": "string"
          },
          "three_d": {
            "description": "The 3-D Secure result.",
            "enum": [
              "full",
              "half",
              "failed"
            ],
            "type": "string"
          },
          "transaction_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentRouting": {
        "properties": {
          "catalog_neropay": {
            "description": "A basket holding a supplier's (catalog) goods pays through NeroPay only. Refused (400) until NeroPay is ready for the store.",
            "type": "boolean"
          },
          "cheapest": {
            "description": "The lowest single-payment commission next.",
            "type": "boolean"
          },
          "currency_fallback": {
            "description": "The POS (one of members) that takes a payment in a currency no member takes.",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "failover": {
            "description": "A POS whose last three payment starts failed rests five minutes.",
            "type": "boolean"
          },
          "family_pos": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Card programme (bonus, world, axess, wings, maximum, cardfinans, bankkart, paraf, advantage, saglam) → the POS that takes its installments when the store has no POS of the programme's bank.",
            "type": "object"
          },
          "members": {
            "description": "The POS in the owner's priority order.",
            "items": {
              "$ref": "#/components/schemas/RoutingMember"
            },
            "maxItems": 32,
            "type": "array"
          },
          "on_us": {
            "description": "The card's own bank's POS first, the bank read from its BIN.",
            "type": "boolean"
          },
          "volume": {
            "$ref": "#/components/schemas/VolumeSplit"
          }
        },
        "required": [
          "enabled",
          "on_us",
          "cheapest",
          "failover",
          "members"
        ],
        "type": "object"
      },
      "PaymentRoutingView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentRouting"
          },
          {
            "properties": {
              "active": {
                "description": "On with at least two set-up POS: the storefront shows the one card choice.",
                "type": "boolean"
              },
              "available": {
                "description": "Set-up POS whose card form posts to the bank: the ones routing can use.",
                "items": {
                  "$ref": "#/components/schemas/RoutingPOS"
                },
                "type": "array"
              },
              "banks": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Bank keys and names a POS may stand for.",
                "type": "object"
              },
              "catalog_ready": {
                "description": "NeroPay can take a supplier's goods for this store, so catalog_neropay may be switched on.",
                "type": "boolean"
              },
              "families": {
                "description": "The card programmes the installment rules know (ADR-0140).",
                "items": {
                  "$ref": "#/components/schemas/CardFamily"
                },
                "type": "array"
              }
            },
            "required": [
              "available",
              "banks",
              "active",
              "families",
              "catalog_ready"
            ],
            "type": "object"
          }
        ]
      },
      "PaymentsSummary": {
        "properties": {
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "pos": {
            "items": {
              "$ref": "#/components/schemas/POSSummary"
            },
            "type": "array"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "pos"
        ],
        "type": "object"
      },
      "PayoutsReport": {
        "description": "What each payment method collected, refunded and is owed over a window.",
        "properties": {
          "currencies": {
            "items": {
              "$ref": "#/components/schemas/CurrencyPayouts"
            },
            "type": "array"
          },
          "from": {
            "description": "Inclusive.",
            "format": "date-time",
            "type": "string"
          },
          "time_zone": {
            "description": "The zone the window's edges were cut in.",
            "type": "string"
          },
          "to": {
            "description": "Exclusive.",
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PersonalisationField": {
        "description": "One thing a product asks the shopper for (ADR-0089). On write the kernel makes a missing key from the label, trims the labels and clears what the type does not use.",
        "properties": {
          "charset": {
            "description": "What a text may contain; letters takes spaces, ' - . too.",
            "enum": [
              "any",
              "letters",
              "letters_digits",
              "digits"
            ],
            "type": "string"
          },
          "fonts": {
            "description": "The lettering a text may be made in; the shopper picks one (the first by default).",
            "items": {
              "maxLength": 40,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          },
          "help": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language code (\"tr\", \"en\", \"de\", …); a reader takes its own language, else English, else Turkish, else any.",
            "type": "object"
          },
          "image_types": {
            "items": {
              "enum": [
                "image/jpeg",
                "image/png",
                "image/webp"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "key": {
            "description": "Names the field on the cart line and the order line; made from the label when empty; kept when the label changes.",
            "pattern": "^[a-z0-9_]{1,40}$",
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language code (\"tr\", \"en\", \"de\", …); a reader takes its own language, else English, else Turkish, else any.",
            "type": "object"
          },
          "max_bytes": {
            "description": "An image field's byte limit (10 MiB by default).",
            "format": "int64",
            "maximum": 20971520,
            "minimum": 102400,
            "type": "integer"
          },
          "max_length": {
            "description": "A text's limit in characters (text: 50 unless given, at most 500; textarea: 500, at most 2000).",
            "maximum": 2000,
            "minimum": 1,
            "type": "integer"
          },
          "min_height": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "min_width": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/PersonalisationOption"
            },
            "maxItems": 50,
            "type": "array"
          },
          "price_add_minor": {
            "description": "What a filled field adds to one unit, in the store's base currency's minor unit; part of the line's unit price (taxed like it). A basket in another currency cannot take a priced personalisation.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "required": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "text",
              "textarea",
              "choice",
              "checkbox",
              "image",
              "date"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "type",
          "label",
          "required"
        ],
        "type": "object"
      },
      "PersonalisationImage": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "thumb_url": {
            "description": "A smaller variant, when one was made.",
            "type": "string"
          },
          "upload_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "description": "The stored picture (its name carries 128 random bits).",
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "upload_id",
          "url",
          "mime",
          "width",
          "height",
          "size_bytes"
        ],
        "type": "object"
      },
      "PersonalisationOption": {
        "properties": {
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language code (\"tr\", \"en\", \"de\", …); a reader takes its own language, else English, else Turkish, else any.",
            "type": "object"
          },
          "price_add_minor": {
            "description": "Added on top of the field's own addition when chosen.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "value": {
            "description": "Made from the label when empty.",
            "pattern": "^[a-z0-9_-]{1,40}$",
            "type": "string"
          }
        },
        "required": [
          "value",
          "label"
        ],
        "type": "object"
      },
      "PersonalisationUpload": {
        "properties": {
          "field": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "height": {
            "type": "integer"
          },
          "id": {
            "description": "The upload_id a line's value names.",
            "format": "int64",
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "thumb_url": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "product_id",
          "field",
          "url",
          "mime",
          "width",
          "height",
          "size_bytes"
        ],
        "type": "object"
      },
      "PersonalisationValue": {
        "description": "What the shopper gave for one field: the text (with `font` when the field has fonts), the option's value, \"true\" for a ticked box, a date YYYY-MM-DD, or an `upload_id` from POST /api/v1/store/carts/{cartId}/uploads (this basket's only).",
        "properties": {
          "font": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "upload_id": {
            "format": "int64",
            "type": "integer"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "Pickup": {
        "properties": {
          "reference": {
            "type": "string"
          },
          "window": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PickupInput": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "fulfillment_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "note": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "ready_from": {
            "type": "string"
          },
          "ready_until": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "fulfillment_ids",
          "date"
        ],
        "type": "object"
      },
      "PlatformAccess": {
        "properties": {
          "control_url": {
            "type": "string"
          },
          "google_cloud": {
            "type": "boolean"
          }
        },
        "required": [
          "google_cloud"
        ],
        "type": "object"
      },
      "PlatformAccount": {
        "description": "What the platform's own store shows a customer about NeroCart.",
        "properties": {
          "stores": {
            "items": {
              "$ref": "#/components/schemas/CustomerStoreRef"
            },
            "type": "array"
          }
        },
        "required": [
          "stores"
        ],
        "type": "object"
      },
      "PlatformAdminAccess": {
        "properties": {
          "available": {
            "description": "Show the menu: the operator's owner, or a member given platform roles.",
            "type": "boolean"
          },
          "linked": {
            "description": "The person has a platform account (always when available).",
            "type": "boolean"
          },
          "operator": {
            "description": "A person in the platform operator's admin.",
            "type": "boolean"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "staff_email": {
            "type": "string"
          },
          "staff_name": {
            "type": "string"
          }
        },
        "required": [
          "operator",
          "available",
          "linked",
          "permissions"
        ],
        "type": "object"
      },
      "Plugin": {
        "description": "A feature an operator switches on from the panel: its descriptor, whether it is on, and its settings with every secret masked.",
        "properties": {
          "builtin": {
            "description": "Shipped by core: settings a storefront reads, with no code behind them.",
            "type": "boolean"
          },
          "category": {
            "type": "string"
          },
          "configured": {
            "description": "Every required field has a value.",
            "type": "boolean"
          },
          "consent_category": {
            "description": "The cookie-consent category of the third-party tag a storefront loads for this plugin; absent when it loads none. The tag loads only after the visitor consented to the category (ADR-0038).",
            "enum": [
              "preferences",
              "analytics",
              "marketing"
            ],
            "type": "string"
          },
          "default_enabled": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "docs": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/PluginField"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "module": {
            "description": "The module that registered it, for the rest.",
            "type": "string"
          },
          "settings": {
            "additionalProperties": true,
            "description": "Stored values; a secret reads as `••••••••`, and sending that back keeps it.",
            "type": "object"
          },
          "signup": {
            "description": "The provider's own page where a merchant opens an account, for a plugin that needs one (ADR-0121); the panel links it in a new tab.",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PluginField": {
        "properties": {
          "consent_category": {
            "description": "The cookie-consent category of the tag this field configures, when it differs from its plugin's (ADR-0038).",
            "enum": [
              "preferences",
              "analytics",
              "marketing"
            ],
            "type": "string"
          },
          "default": {},
          "help": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "text",
              "textarea",
              "secret",
              "number",
              "bool",
              "select",
              "multi",
              "url"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "max": {
            "description": "A number field's greatest value; a bounded number is a whole number.",
            "type": "number"
          },
          "min": {
            "description": "A number field's least value; a bounded number is a whole number.",
            "type": "number"
          },
          "options": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "public": {
            "description": "Handed to the storefront through GET /api/plugins. A secret never is.",
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          },
          "source": {
            "description": "A text field the panel shows as a picker: its value is the chosen ids, comma-separated, from products, collections, categories, discounts or product_sets; another field's key takes that field's value as the list (ADR-0157 addendum 2).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PluginPatch": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "settings": {
            "additionalProperties": true,
            "description": "Merged over what is stored. An empty value clears a field; the mask keeps a secret.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "PluginPublic": {
        "properties": {
          "consent_category": {
            "description": "The cookie-consent category of the plugin's third-party tag (ADR-0038). A storefront must not load it before the visitor consented; GET /api/v1/store/cookie-consent hands out the tags by category.",
            "enum": [
              "preferences",
              "analytics",
              "marketing"
            ],
            "type": "string"
          },
          "consent_fields": {
            "additionalProperties": {
              "enum": [
                "preferences",
                "analytics",
                "marketing"
              ],
              "type": "string"
            },
            "description": "Public fields whose tag is in another consent category than the plugin's (the Google plugin's Ads ID is marketing).",
            "type": "object"
          },
          "key": {
            "type": "string"
          },
          "settings": {
            "additionalProperties": true,
            "type": "object"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PopupAB": {
        "description": "An A/B group: its popups share the group's visitors by weight; a visitor keeps the one drawn.",
        "properties": {
          "group": {
            "description": "Lowercase letters, digits and hyphens; empty is no test.",
            "maxLength": 40,
            "type": "string"
          },
          "weight": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "group",
          "weight"
        ],
        "type": "object"
      },
      "PopupCode": {
        "properties": {
          "code": {
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "label"
        ],
        "type": "object"
      },
      "PopupConditions": {
        "properties": {
          "cart": {
            "enum": [
              "any",
              "has_items",
              "empty"
            ],
            "type": "string"
          },
          "cart_items_min": {
            "maximum": 99,
            "minimum": 0,
            "type": "integer"
          },
          "cart_min": {
            "description": "The smallest cart subtotal in minor units of the cart's currency; 0 none.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "countries": {
            "description": "ISO 3166 alpha-2; none is everywhere; an unknown country never matches a list.",
            "items": {
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "customer": {
            "enum": [
              "all",
              "guest",
              "signed_in"
            ],
            "type": "string"
          },
          "days": {
            "description": "Weekdays, 0 Sunday … 6 Saturday, in the store's time zone; none is every day.",
            "items": {
              "maximum": 6,
              "minimum": 0,
              "type": "integer"
            },
            "type": "array"
          },
          "devices": {
            "items": {
              "enum": [
                "d",
                "t",
                "m"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "exclude": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          },
          "from": {
            "description": "RFC 3339; empty is open.",
            "type": "string"
          },
          "hours": {
            "description": "Hours of the day, both included, in the store's time zone; from after to runs over midnight.",
            "properties": {
              "from": {
                "maximum": 23,
                "minimum": 0,
                "type": "integer"
              },
              "to": {
                "maximum": 23,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "type": "object"
          },
          "include": {
            "description": "Store paths without the language; a trailing * takes every page under it.",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          },
          "pages": {
            "items": {
              "enum": [
                "home",
                "products",
                "product",
                "collection",
                "category",
                "cart",
                "blog",
                "page",
                "search",
                "other"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "sources": {
            "description": "Matched against the visit's utm_source or its referrer's host; none is every source.",
            "items": {
              "maxLength": 60,
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          },
          "until": {
            "description": "RFC 3339; empty is open.",
            "type": "string"
          },
          "visitor": {
            "enum": [
              "all",
              "new",
              "returning"
            ],
            "type": "string"
          }
        },
        "required": [
          "pages",
          "include",
          "exclude",
          "devices",
          "visitor",
          "cart",
          "cart_min",
          "from",
          "until",
          "customer",
          "sources",
          "countries",
          "cart_items_min",
          "days",
          "hours"
        ],
        "type": "object"
      },
      "PopupDisplay": {
        "description": "How a popup comes and goes (ADR-0133).",
        "properties": {
          "animation": {
            "enum": [
              "fade",
              "slide",
              "zoom",
              "none"
            ],
            "type": "string"
          },
          "auto_close": {
            "description": "Closes by itself after N seconds; 0 never.",
            "maximum": 600,
            "minimum": 0,
            "type": "integer"
          },
          "step2": {
            "description": "The popup's second free layout is its second step, shown in place of the others after a sign-up (a form sent in the popup).",
            "type": "boolean"
          },
          "teaser": {
            "description": "The tab that stays after the visitor closed it and reopens it.",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "position": {
                "enum": [
                  "bottom_left",
                  "bottom_right",
                  "left",
                  "right"
                ],
                "type": "string"
              },
              "text": {
                "description": "Empty takes the storefront's own words.",
                "maxLength": 40,
                "type": "string"
              }
            },
            "required": [
              "enabled",
              "text",
              "position"
            ],
            "type": "object"
          }
        },
        "required": [
          "auto_close",
          "animation",
          "teaser",
          "step2"
        ],
        "type": "object"
      },
      "PopupFrequency": {
        "properties": {
          "cap": {
            "enum": [
              "every_view",
              "session",
              "days",
              "times"
            ],
            "type": "string"
          },
          "days": {
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          },
          "stop_on_close": {
            "type": "boolean"
          },
          "stop_on_convert": {
            "type": "boolean"
          },
          "times": {
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "cap",
          "days",
          "times",
          "stop_on_close",
          "stop_on_convert"
        ],
        "type": "object"
      },
      "PopupRevenue": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "orders",
          "amount_minor"
        ],
        "type": "object"
      },
      "PopupRules": {
        "description": "A popup's rules (root.props.popup of its document, ADR-0085 §9), stored complete. Unknown keys and values out of range are refused; a rule cannot include the checkout, an order's or the account's pages. ADR-0133 added display, ab, the add_to_cart, time_on_site and element_click triggers and the customer, sources, countries, cart_items_min, days and hours conditions, each with a default that keeps the first popups' behaviour.",
        "properties": {
          "ab": {
            "$ref": "#/components/schemas/PopupAB"
          },
          "click_outside": {
            "type": "boolean"
          },
          "close_button": {
            "enum": [
              "inside",
              "outside"
            ],
            "type": "string"
          },
          "conditions": {
            "$ref": "#/components/schemas/PopupConditions"
          },
          "display": {
            "$ref": "#/components/schemas/PopupDisplay"
          },
          "frequency": {
            "$ref": "#/components/schemas/PopupFrequency"
          },
          "layout": {
            "enum": [
              "modal",
              "slide_in",
              "top_bar",
              "bottom_bar",
              "full_screen"
            ],
            "type": "string"
          },
          "overlay": {
            "maximum": 90,
            "minimum": 0,
            "type": "integer"
          },
          "position": {
            "description": "A slide-in's corner.",
            "enum": [
              "bottom_right",
              "bottom_left",
              "top_right",
              "top_left"
            ],
            "type": "string"
          },
          "priority": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "size": {
            "enum": [
              "s",
              "m",
              "l",
              "custom"
            ],
            "type": "string"
          },
          "trigger": {
            "$ref": "#/components/schemas/PopupTrigger"
          },
          "width": {
            "additionalProperties": {
              "maximum": 960,
              "minimum": 240,
              "type": "integer"
            },
            "description": "A custom size's width per device (d, t, m).",
            "type": "object"
          }
        },
        "required": [
          "layout",
          "position",
          "size",
          "width",
          "overlay",
          "close_button",
          "click_outside",
          "trigger",
          "conditions",
          "frequency",
          "priority",
          "display",
          "ab"
        ],
        "type": "object"
      },
      "PopupSpin": {
        "properties": {
          "code": {
            "description": "The single-use code, for a prize.",
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "prize": {
            "type": "boolean"
          },
          "segment": {
            "description": "The segment it stops at, 0-based.",
            "type": "integer"
          }
        },
        "required": [
          "segment",
          "label",
          "prize"
        ],
        "type": "object"
      },
      "PopupSpinInput": {
        "properties": {
          "consent": {
            "description": "The wheel's permission box ticked.",
            "type": "boolean"
          },
          "email": {
            "description": "Required when the wheel asks for an e-mail.",
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "node": {
            "description": "The wheel's node id.",
            "type": "string"
          },
          "visitor_token": {
            "maxLength": 128,
            "minLength": 20,
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string"
          }
        },
        "required": [
          "node",
          "visitor_token"
        ],
        "type": "object"
      },
      "PopupStats": {
        "properties": {
          "closes": {
            "type": "integer"
          },
          "conversion_rate": {
            "description": "Conversions per view, to four places; 0 without views.",
            "type": "number"
          },
          "conversions": {
            "type": "integer"
          },
          "copies": {
            "type": "integer"
          },
          "days": {
            "type": "integer"
          },
          "revenue": {
            "description": "The sold orders the popup brought, per currency: a code it handed was used, or the order followed a conversion in the same visit.",
            "items": {
              "$ref": "#/components/schemas/PopupRevenue"
            },
            "type": "array"
          },
          "signups": {
            "type": "integer"
          },
          "views": {
            "type": "integer"
          }
        },
        "required": [
          "days",
          "views",
          "closes",
          "conversions",
          "conversion_rate",
          "copies",
          "signups",
          "revenue"
        ],
        "type": "object"
      },
      "PopupTrigger": {
        "properties": {
          "delay": {
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "exit_phone": {
            "enum": [
              "none",
              "scroll_up"
            ],
            "type": "string"
          },
          "inactivity": {
            "maximum": 600,
            "minimum": 5,
            "type": "integer"
          },
          "kind": {
            "enum": [
              "load",
              "scroll",
              "exit",
              "click",
              "inactivity",
              "page_views",
              "add_to_cart",
              "time_on_site",
              "element_click"
            ],
            "type": "string"
          },
          "page_views": {
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "scroll": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "selector": {
            "description": "The element whose click opens it (element_click): #id, .class or [data-popup=\"name\"].",
            "maxLength": 100,
            "type": "string"
          },
          "site_seconds": {
            "description": "Seconds across the visit (time_on_site).",
            "maximum": 1800,
            "minimum": 5,
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "delay",
          "scroll",
          "inactivity",
          "page_views",
          "exit_phone",
          "site_seconds",
          "selector"
        ],
        "type": "object"
      },
      "Preorder": {
        "description": "The variant is on pre-order (ADR-0074): it sells before it is in stock, within its limit, and says so.",
        "properties": {
          "limit": {
            "description": "The most units sold beyond the stock; absent for no limit.",
            "type": "integer"
          },
          "ships_on": {
            "description": "The expected ship date, when given.",
            "format": "date",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PreorderInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "limit": {
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "ships_on": {
            "description": "YYYY-MM-DD, between today and two years ahead; empty for none.",
            "type": "string"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "PriceBreak": {
        "properties": {
          "min_quantity": {
            "type": "integer"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "min_quantity",
          "price"
        ],
        "type": "object"
      },
      "PriceList": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "channel_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "channel_id": {
            "description": "Absent is every channel, for the same reason an absent group is everybody.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "group_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "description": "Absent is everybody — a launch price, a seasonal one. It does not mean nobody.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prices": {
            "description": "How many rows the list holds.",
            "type": "integer"
          },
          "priority": {
            "description": "Breaks a tie when two live lists both cover a line. Higher wins.",
            "type": "integer"
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PriceListInput": {
        "properties": {
          "active": {
            "default": true,
            "type": "boolean"
          },
          "channel_id": {
            "description": "Narrow the list to one storefront. Null is every channel.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "group_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "default": 0,
            "type": "integer"
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "PriceRow": {
        "properties": {
          "amount_minor": {
            "description": "The unit price in the store's currency's minor units, like every other amount here.",
            "format": "int64",
            "type": "integer"
          },
          "min_quantity": {
            "default": 1,
            "description": "The quantity break. 1 is any quantity, and is what an absent field means.",
            "minimum": 1,
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "amount_minor"
        ],
        "type": "object"
      },
      "PrintItem": {
        "description": "One document in the print queue.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "document": {
            "description": "A carrier paper's kind (commercial_invoice, …).",
            "type": "string"
          },
          "file_url": {
            "type": "string"
          },
          "format": {
            "enum": [
              "pdf",
              "zpl",
              "png",
              "svg"
            ],
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "invoice_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "label",
              "document",
              "invoice"
            ],
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "printed_at": {
            "format": "date-time",
            "type": "string"
          },
          "printed_by": {
            "type": "string"
          },
          "ready": {
            "description": "The file can be fetched now.",
            "type": "boolean"
          },
          "status": {
            "enum": [
              "waiting",
              "printed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PrintMarkInput": {
        "properties": {
          "ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "type": "object"
      },
      "PrintMarked": {
        "properties": {
          "marked": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PrivacyRequest": {
        "properties": {
          "actor_email": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "export",
              "erasure"
            ],
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "subject_hash": {
            "description": "hex SHA-256 of the lower-cased email; the address itself is never stored.",
            "type": "string"
          },
          "summary": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          }
        },
        "required": [
          "id",
          "kind",
          "subject_hash",
          "summary",
          "created_at"
        ],
        "type": "object"
      },
      "Product": {
        "description": "The merchandising concept. What a shopper actually buys is a variant.",
        "properties": {
          "category": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProductCategory"
              }
            ],
            "description": "Absent when the product is uncategorised, which is a normal state for a draft rather than an error."
          },
          "collections": {
            "description": "Carried on every product read, so membership renders without a request per product.",
            "items": {
              "$ref": "#/components/schemas/ProductCollection"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "dealer_only": {
            "description": "The product's prices and its add to basket are for approved dealers only (ADR-0091 §2).",
            "type": "boolean"
          },
          "delivery_note": {
            "description": "What the shopper is told about delivering a product that is never sent (e.g. \"Kurulum bilgileri e-posta ile gönderilecektir\"); shown on the order page and in the delivery email (ADR-0045).",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "description_doc": {
            "description": "The description as rich text (TipTap JSON, cleaned on write). `description` is then its plain-text reading. Null for a plain-text description.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/RichTextDocument"
              },
              {
                "type": "null"
              }
            ]
          },
          "extra_category_ids": {
            "description": "The other categories whose listings show the product; absent when none.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "gift_card": {
            "description": "The product sells gift cards (0176): once its order is paid, a card per unit is issued for the line's price and its code e-mailed to the buyer.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "description": "The product's lead picture — the first image in its media list — filled in on every read so a listing needs no request per row. Absent when the product has no image.",
            "type": "string"
          },
          "images": {
            "description": "The product's own gallery in the merchant's order — every picture and video, alt text in the request's language. A variant that names none of them (Variant.images) shows them all. On a single product's read only; a list carries image_url.",
            "items": {
              "$ref": "#/components/schemas/VariantImage"
            },
            "type": "array"
          },
          "labels": {
            "description": "The merchant's labels that apply, best priority first; store reads only (ADR-0074).",
            "items": {
              "$ref": "#/components/schemas/StoreLabel"
            },
            "type": "array"
          },
          "localization": {
            "$ref": "#/components/schemas/Localization"
          },
          "media_count": {
            "description": "How many images the product has; absent when none.",
            "type": "integer"
          },
          "metadata": {
            "additionalProperties": true,
            "description": "Where a module attaches its own data, under its own key.",
            "type": "object"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/ProductOption"
            },
            "type": "array"
          },
          "personalisation": {
            "description": "What the product asks the shopper for — a text to engrave, a card message, an option, a photo, a date — each of which may add to the price (ADR-0089). Empty for an ordinary product.",
            "items": {
              "$ref": "#/components/schemas/PersonalisationField"
            },
            "maxItems": 20,
            "type": "array"
          },
          "prices_hidden": {
            "description": "Storefront reads only: this visitor sees no price for the product — it is sold to dealers only (its own choice or the store's) — and its variants carry none (price zero, for_sale false, price_hidden).",
            "type": "boolean"
          },
          "product_type": {
            "description": "Free text an operator groups and filters by, such as \"Shirt\".",
            "example": "Shirt",
            "type": "string"
          },
          "production_days": {
            "description": "How many days the product takes to make before it can be sent (made to order); 0 is none.",
            "maximum": 365,
            "minimum": 0,
            "type": "integer"
          },
          "rating": {
            "$ref": "#/components/schemas/ProductRating"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "description": "The storefront's \u003ctitle\u003e. Empty means derive it from the title — whether and how is the storefront's call.",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "subtitle": {
            "description": "A short line under the title; empty is normal.",
            "type": "string"
          },
          "tags": {
            "description": "Normalised on write: trimmed, de-duplicated case-insensitively, and sorted. Case is preserved, but two spellings of one tag are one tag.",
            "example": [
              "cotton",
              "Linen",
              "summer"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tax_class_id": {
            "description": "The product's tax class; it wins over the category's and the store's rates. Null uses those. Set with PUT /products/{id}/tax-class.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/Variant"
            },
            "type": "array"
          },
          "vendor": {
            "example": "Acme",
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "The exception of Mesafeli Sözleşmeler Yönetmeliği m.15/1 the product is sold under (ADR-0088 §1): none (the ordinary 14-day right of withdrawal), price_fluctuating (a), personalised (b), perishable (c), hygiene_opened (ç: once its seal is opened), mixed_inseparable (d), sealed_media_opened (e: once opened), periodicals (f), dated_leisure (g), instant_digital (ğ: delivered instantly by electronic means), instant_service (h: performed at once with the buyer's consent).",
            "enum": [
              "none",
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service"
            ],
            "type": "string"
          },
          "works_with": {
            "description": "What the product works with and how it is protected — platform, region, system requirements, activation (MSY m.5/1-i, j) — printed in the pre-contractual information form as {{products.works_with}}; empty is normal.",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductBulkInput": {
        "properties": {
          "action": {
            "enum": [
              "publish",
              "unpublish",
              "add_to_collection",
              "delete"
            ],
            "type": "string"
          },
          "collection_id": {
            "description": "add_to_collection's target.",
            "format": "int64",
            "type": "integer"
          },
          "confirm": {
            "description": "Must be true for delete.",
            "type": "boolean"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 500,
            "type": "array"
          }
        },
        "required": [
          "action",
          "product_ids"
        ],
        "type": "object"
      },
      "ProductBulkResult": {
        "properties": {
          "action": {
            "type": "string"
          },
          "done": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "failed": {
            "items": {
              "properties": {
                "id": {
                  "format": "int64",
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ProductCategory": {
        "description": "The trimmed category carried on a product: enough to render a breadcrumb and link to it.",
        "properties": {
          "full_name": {
            "example": "Apparel / Clothing / Shirts",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductCollection": {
        "description": "The trimmed collection carried on a product: enough to render a chip and link to it, and no more.",
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductExport": {
        "properties": {
          "customs_description": {
            "type": "string"
          },
          "customs_name": {
            "description": "Ticari tanım: the invoice item's name.",
            "type": "string"
          },
          "duties_mode": {
            "enum": [
              "",
              "ddp",
              "dap"
            ],
            "type": "string"
          },
          "hs_code": {
            "type": "string"
          },
          "incoterm": {
            "type": "string"
          },
          "item_id": {
            "format": "int64",
            "type": "integer"
          },
          "origin_country": {
            "type": "string"
          },
          "shared_with": {
            "type": "integer"
          }
        },
        "required": [
          "customs_name",
          "customs_description",
          "hs_code",
          "origin_country",
          "incoterm",
          "duties_mode",
          "shared_with"
        ],
        "type": "object"
      },
      "ProductExportInput": {
        "properties": {
          "customs_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "customs_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "duties_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "hs_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "incoterm": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ProductFieldDef": {
        "properties": {
          "key": {
            "pattern": "^[a-z][a-z0-9_]{0,39}$",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "shown": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "text",
              "number",
              "boolean",
              "date",
              "url"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "shown"
        ],
        "type": "object"
      },
      "ProductFieldValue": {
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "enum": [
              "text",
              "number",
              "boolean",
              "date",
              "url"
            ],
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "value"
        ],
        "type": "object"
      },
      "ProductFile": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_days": {
            "type": "integer"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "max_downloads": {
            "type": "integer"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "product_id",
          "filename",
          "content_type",
          "size_bytes",
          "expires_days",
          "max_downloads",
          "created_at"
        ],
        "type": "object"
      },
      "ProductGroupPrices": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/CustomerGroup"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/GroupPriceRow"
            },
            "type": "array"
          }
        },
        "required": [
          "currency",
          "groups",
          "rows"
        ],
        "type": "object"
      },
      "ProductGroupPricesInput": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/GroupPriceRow"
            },
            "type": "array"
          }
        },
        "required": [
          "rows"
        ],
        "type": "object"
      },
      "ProductInput": {
        "properties": {
          "category_id": {
            "description": "The category to file the product under. Omit for uncategorised.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "dealer_only": {
            "description": "Prices and add to basket for approved dealers only (ADR-0091 §2).",
            "type": "boolean"
          },
          "delivery_note": {
            "description": "The digital delivery note (Product.delivery_note).",
            "maxLength": 2000,
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "description_doc": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RichTextDocument"
              }
            ],
            "description": "The description as rich text; when given, `description` becomes its plain text."
          },
          "extra_category_ids": {
            "description": "More categories whose listings show the product besides its own (category_id). Its own category, repeats and zeros are dropped; at most 20.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "gift_card": {
            "description": "The product sells gift cards (0176): once its order is paid, a card per unit is issued for the line's price and its code e-mailed to the buyer.",
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "options": {
            "items": {
              "properties": {
                "colors": {
                  "additionalProperties": {
                    "pattern": "^#[0-9a-fA-F]{6}$",
                    "type": "string"
                  },
                  "description": "Swatch colours by value, as written in `values`; stored lower-case. A key that is not one of the values is refused.",
                  "example": {
                    "Lacivert": "#1f2a44",
                    "Siyah": "#111111"
                  },
                  "type": "object"
                },
                "display": {
                  "description": "How a storefront shows the option: `color` (colour swatches), `image` (each variant's own picture), `button` or `select`. Absent is automatic: the option is recognised by its name (Renk/Color/Farbe is a colour), as before. Omitted, empty or `auto` is automatic.",
                  "enum": [
                    "color",
                    "image",
                    "button",
                    "select",
                    "auto"
                  ],
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "values": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "personalisation": {
            "description": "Product.personalisation. A product created with fields and no withdrawal_exception of its own is \"personalised\" (MSY 15/1-b).",
            "items": {
              "$ref": "#/components/schemas/PersonalisationField"
            },
            "maxItems": 20,
            "type": "array"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "product_type": {
            "type": "string"
          },
          "production_days": {
            "description": "Product.production_days.",
            "maximum": 365,
            "minimum": 0,
            "type": "integer"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "sku": {
            "description": "Shorthand for a product with no options; send with price_minor instead of variants. Optional. Left out, the variant is named after its product — the slug, then its option values, upper-cased and hyphenated, which is the rule the option matrix has always used for the variants it generates. A derived code that is already taken is numbered rather than refused, since nobody chose it. A SKU sent here is used exactly as given, and a collision with one of those is a conflict.",
            "type": "string"
          },
          "slug": {
            "description": "Derived from the title when omitted.",
            "type": "string"
          },
          "status": {
            "default": "draft",
            "enum": [
              "draft",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "stock": {
            "type": "integer"
          },
          "subtitle": {
            "type": "string"
          },
          "tags": {
            "description": "Stored normalised — trimmed, de-duplicated case-insensitively and sorted — so the order they arrive in does not become part of the record.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/VariantInput"
            },
            "type": "array"
          },
          "vendor": {
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "Product.withdrawal_exception; omitted is none.",
            "enum": [
              "none",
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service"
            ],
            "type": "string"
          },
          "works_with": {
            "description": "Product.works_with.",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "ProductLabel": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "products": {
            "description": "Products a manual label is on.",
            "type": "integer"
          },
          "rule": {
            "enum": [
              "manual",
              "collection",
              "tag",
              "new",
              "discount",
              "min_price"
            ],
            "type": "string"
          },
          "rule_value": {
            "type": "string"
          },
          "text": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "text_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "text",
          "color",
          "text_color",
          "rule",
          "rule_value",
          "priority",
          "active",
          "products",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ProductLabelInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rule": {
            "enum": [
              "",
              "manual",
              "collection",
              "tag",
              "new",
              "discount",
              "min_price"
            ],
            "type": "string"
          },
          "rule_value": {
            "description": "collection: its id; tag: the tag; new: days; discount: percent; min_price: amount in minor units of the store's currency.",
            "type": "string"
          },
          "text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Words per language, at most 40 characters each.",
            "type": "object"
          },
          "text_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          }
        },
        "required": [
          "name",
          "text"
        ],
        "type": "object"
      },
      "ProductLabelsInput": {
        "properties": {
          "label_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "label_ids"
        ],
        "type": "object"
      },
      "ProductMedia": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Media"
          },
          {
            "properties": {
              "position": {
                "description": "Display order within the product.",
                "type": "integer"
              },
              "variant_ids": {
                "description": "The variants that show this picture — several when the sizes of one colour share its photographs. Absent for a picture only the product shows.",
                "items": {
                  "format": "int64",
                  "type": "integer"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ]
      },
      "ProductOption": {
        "description": "One axis of choice, such as Size.",
        "properties": {
          "display": {
            "description": "How a storefront shows the option: `color` (colour swatches), `image` (each variant's own picture), `button` or `select`. Absent is automatic: the option is recognised by its name (Renk/Color/Farbe is a colour), as before.",
            "enum": [
              "color",
              "image",
              "button",
              "select"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "values": {
            "items": {
              "properties": {
                "color": {
                  "description": "The value's swatch colour, lower-case `#rrggbb`. Absent lets the storefront guess from the value's name.",
                  "example": "#1f2937",
                  "pattern": "^#[0-9a-f]{6}$",
                  "type": "string"
                },
                "id": {
                  "format": "int64",
                  "type": "integer"
                },
                "position": {
                  "type": "integer"
                },
                "value": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ProductPricing": {
        "properties": {
          "member": {
            "description": "A group price list applies to this visitor.",
            "type": "boolean"
          },
          "prices_hidden": {
            "description": "The product is sold to dealers only and this visitor is not one (ADR-0091 §2): no variant, no break, no membership.",
            "type": "boolean"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/VariantPricing"
            },
            "type": "array"
          }
        },
        "required": [
          "member",
          "variants"
        ],
        "type": "object"
      },
      "ProductPricingEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProductPricing"
          },
          {
            "properties": {
              "product_id": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "product_id"
            ],
            "type": "object"
          }
        ]
      },
      "ProductPricingList": {
        "properties": {
          "products": {
            "items": {
              "$ref": "#/components/schemas/ProductPricingEntry"
            },
            "type": "array"
          }
        },
        "required": [
          "products"
        ],
        "type": "object"
      },
      "ProductQuestion": {
        "properties": {
          "answer": {
            "type": "string"
          },
          "answered_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_title": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "published",
              "hidden"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "product_id",
          "product_title",
          "name",
          "email",
          "question",
          "answer",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "ProductQuestionInput": {
        "properties": {
          "email": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "question": {
            "type": "string"
          },
          "started_at": {
            "description": "When the form was rendered (ms since the epoch).",
            "format": "int64",
            "type": "integer"
          },
          "website": {
            "description": "Honeypot: leave empty.",
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "name",
          "question"
        ],
        "type": "object"
      },
      "ProductQuestionPatch": {
        "properties": {
          "answer": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "published",
              "hidden"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductRating": {
        "description": "A product's approved reviews: absent while there are none (ADR-0063).",
        "properties": {
          "average": {
            "description": "To one decimal.",
            "type": "number"
          },
          "count": {
            "type": "integer"
          }
        },
        "required": [
          "average",
          "count"
        ],
        "type": "object"
      },
      "ProductRelations": {
        "properties": {
          "cross_sell": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "related": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "related",
          "cross_sell"
        ],
        "type": "object"
      },
      "ProductReviewsPage": {
        "properties": {
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "reviews": {
            "items": {
              "$ref": "#/components/schemas/PublicReview"
            },
            "type": "array"
          },
          "summary": {
            "$ref": "#/components/schemas/ReviewSummary"
          }
        },
        "required": [
          "product_id",
          "summary",
          "reviews"
        ],
        "type": "object"
      },
      "ProductSales": {
        "description": "One product or variant over the window. Title, SKU and label are the newest snapshot the order lines carry, so a renamed or deleted product still reports under a name somebody recognises.",
        "properties": {
          "orders": {
            "description": "Distinct orders this appeared in.",
            "type": "integer"
          },
          "product_id": {
            "description": "Null once the product has been deleted; the row stays, and two deleted products stay two rows.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "revenue": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Line value excluding tax under either tax mode, and BEFORE any order-level discount: a discount is recorded once per order and never allocated to lines, so these rows exceed the sales report's `net` by exactly the discounts in the window."
          },
          "sku": {
            "type": "string"
          },
          "tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Tax on those lines."
          },
          "title": {
            "type": "string"
          },
          "units": {
            "type": "integer"
          },
          "variant_id": {
            "description": "Only for by=variant.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "variant_label": {
            "type": "string"
          }
        },
        "required": [
          "sku",
          "title",
          "units",
          "orders",
          "revenue",
          "tax"
        ],
        "type": "object"
      },
      "ProductSelling": {
        "properties": {
          "derived": {
            "type": "boolean"
          },
          "export": {
            "$ref": "#/components/schemas/ProductExport"
          },
          "kdv_class": {
            "description": "The product's KDV class (ADR-0147); null: none chosen.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/KDVClass"
              },
              {
                "type": "null"
              }
            ]
          },
          "managed": {
            "type": "boolean"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRow"
            },
            "type": "array"
          },
          "store": {
            "$ref": "#/components/schemas/SellingStore"
          }
        },
        "required": [
          "product_id",
          "managed",
          "derived",
          "rows",
          "export",
          "store",
          "kdv_class"
        ],
        "type": "object"
      },
      "ProductSellingInput": {
        "properties": {
          "export": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProductExportInput"
              }
            ]
          },
          "kdv_class_id": {
            "description": "Puts the product in this KDV class (0: none); a row that gives no KDV takes the class's rate.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRowInput"
            },
            "type": "array"
          }
        },
        "required": [
          "rows"
        ],
        "type": "object"
      },
      "ProductSet": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "discount_id": {
            "description": "The set's promotion (admin only).",
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProductSetItem"
            },
            "type": "array"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed",
              ""
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "value_bp": {
            "type": "integer"
          },
          "value_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "active",
          "kind",
          "value_bp",
          "value_minor",
          "items",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ProductSetInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "product_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer"
                },
                "variant_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "product_id"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "value_bp": {
            "type": "integer"
          },
          "value_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "title",
          "kind",
          "items"
        ],
        "type": "object"
      },
      "ProductSetItem": {
        "properties": {
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "product_id",
          "quantity",
          "slug",
          "title"
        ],
        "type": "object"
      },
      "ProductTranslation": {
        "description": "A product's text in one non-default language. An empty field is not translated and falls back to the default language. Carries its review status; only a published translation is served.",
        "properties": {
          "description": {
            "type": "string"
          },
          "description_doc": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RichTextDocument"
              }
            ],
            "description": "The translated description as rich text (the product description's allow-list); description is its plain text. Null for a plain-text translation."
          },
          "language": {
            "type": "string"
          },
          "missing": {
            "description": "Fields with default-language text and no translation (title, subtitle, description, seo_title, seo_description, options). Empty means complete.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/OptionTranslation"
            },
            "type": "array"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "slug": {
            "description": "Empty means the base slug answers in this language.",
            "type": "string"
          },
          "source": {
            "description": "Translation provenance; default human.",
            "enum": [
              "human",
              "ai",
              "imported",
              "machine"
            ],
            "type": "string"
          },
          "status": {
            "description": "Review status (constitution §13). Only a published translation is served by store reads; empty for a language with nothing stored.",
            "enum": [
              "draft",
              "reviewed",
              "approved",
              "published"
            ],
            "type": "string"
          },
          "status_changed_at": {
            "format": "date-time",
            "type": "string"
          },
          "status_changed_by": {
            "description": "The operator (e-mail) who last moved the status.",
            "type": "string"
          },
          "subtitle": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/VariantTranslation"
            },
            "type": "array"
          },
          "warnings": {
            "description": "The store glossary's rules this text breaks (advisory; nothing is refused).",
            "items": {
              "$ref": "#/components/schemas/GlossaryWarning"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ProductTranslationInput": {
        "description": "The whole new state of one language: an empty field removes that field's translation. An empty slug is derived from the translated title (with a numeric suffix if taken); an explicit slug that collides with another product's slug answers 409. A published write needs source human; ai, machine and imported translations go through review.",
        "properties": {
          "description": {
            "type": "string"
          },
          "description_doc": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RichTextDocument"
              }
            ],
            "description": "The translated description as rich text; when given, the stored description becomes its plain text. Refused (400) with the offending node's path when it leaves the allow-list."
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/OptionTranslation"
            },
            "type": "array"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "description": "Translation provenance; default human.",
            "enum": [
              "human",
              "ai",
              "imported",
              "machine"
            ],
            "type": "string"
          },
          "status": {
            "description": "draft keeps the translation off the storefront; published (human source only) serves it. Omitted: a human translation is published, any other source starts as a draft and is published through review.",
            "enum": [
              "draft",
              "published"
            ],
            "type": "string"
          },
          "subtitle": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variants": {
            "items": {
              "$ref": "#/components/schemas/VariantTranslation"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ProductTranslations": {
        "properties": {
          "default_language": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "translations": {
            "description": "One per non-default store language; blank for a language not started.",
            "items": {
              "$ref": "#/components/schemas/ProductTranslation"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PromotionGoal": {
        "description": "The next automatic promotion whose only condition is the basket's item subtotal, or the highest such one the basket gets once every one is reached (ADR-0157).",
        "properties": {
          "discount_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "percentage",
              "fixed"
            ],
            "type": "string"
          },
          "reached": {
            "type": "boolean"
          },
          "remaining": {
            "$ref": "#/components/schemas/Money"
          },
          "threshold": {
            "$ref": "#/components/schemas/Money"
          },
          "value": {
            "$ref": "#/components/schemas/Money"
          },
          "value_bp": {
            "description": "A percentage in basis points (1500 is 15%).",
            "type": "integer"
          }
        },
        "required": [
          "discount_id",
          "threshold",
          "remaining",
          "reached",
          "kind"
        ],
        "type": "object"
      },
      "ProviderInfo": {
        "description": "An installed provider, as an operator should see it.",
        "properties": {
          "code": {
            "description": "What the API speaks: the code in the checkout URL and on the order.",
            "example": "cod",
            "type": "string"
          },
          "configured": {
            "description": "Whether the provider can be used right now. False for a module installed idle whose key has not been typed into the Plugins screen yet; such a provider is listed here and offered nowhere.",
            "type": "boolean"
          },
          "module": {
            "description": "Which module installed it. \"core\" is a built-in.",
            "example": "core",
            "type": "string"
          },
          "name": {
            "description": "The label to show a person. Falls back to the code when the provider offers no name, because the module that installs a provider is the only thing that knows what it is called.",
            "example": "Cash on delivery",
            "type": "string"
          },
          "refunds": {
            "description": "Payment methods only: provider when the store refunds through the method, manual when the merchant sends the money back outside the store and records it with POST /orders/{id}/manual-refund (cash on delivery, bank transfer).",
            "enum": [
              "provider",
              "manual"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicOffer": {
        "description": "A seller’s price for a variant, without their stock position — how many they are holding is commercial information about them, and a shopper needs one fact from it.",
        "properties": {
          "in_stock": {
            "type": "boolean"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "vendor": {
            "type": "string"
          },
          "vendor_id": {
            "format": "int64",
            "type": "integer"
          },
          "vendor_slug": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublicProductQuestion": {
        "properties": {
          "answer": {
            "type": "string"
          },
          "answered_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "question": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "question",
          "answer",
          "created_at"
        ],
        "type": "object"
      },
      "PublicReview": {
        "properties": {
          "author": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "helpful_count": {
            "description": "How many visitors found it helpful.",
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "locale": {
            "type": "string"
          },
          "photos": {
            "description": "Approved photos only (at most 3).",
            "items": {
              "$ref": "#/components/schemas/ReviewPhoto"
            },
            "type": "array"
          },
          "rating": {
            "type": "integer"
          },
          "reply": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReviewReply"
              }
            ],
            "description": "Absent when the store has not replied."
          },
          "title": {
            "type": "string"
          },
          "verified": {
            "description": "The engine found the writer's paid or shipped order of this product.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "rating",
          "title",
          "body",
          "author",
          "verified",
          "locale",
          "created_at",
          "helpful_count",
          "photos"
        ],
        "type": "object"
      },
      "PublicVendor": {
        "description": "The seller as a shopper sees them. Deliberately narrower than Vendor: commission, the tax id and the contact email are the store’s business with its seller.",
        "properties": {
          "about": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/VendorAddress"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "logo_media_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchasePreview": {
        "properties": {
          "data_layer": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "is_test": {
            "type": "boolean"
          },
          "number": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "is_test",
          "data_layer"
        ],
        "type": "object"
      },
      "PushCampaign": {
        "properties": {
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "failed": {
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "sending",
              "sent"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "body",
          "url",
          "status",
          "sent",
          "failed",
          "created_at"
        ],
        "type": "object"
      },
      "PushCampaignInput": {
        "properties": {
          "body": {
            "maxLength": 200,
            "type": "string"
          },
          "title": {
            "maxLength": 80,
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "PushSettings": {
        "properties": {
          "campaigns": {
            "items": {
              "$ref": "#/components/schemas/PushCampaign"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "subscribers": {
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "subscribers",
          "campaigns"
        ],
        "type": "object"
      },
      "PushSubscriptionInput": {
        "properties": {
          "endpoint": {
            "type": "string"
          },
          "keys": {
            "properties": {
              "auth": {
                "type": "string"
              },
              "p256dh": {
                "type": "string"
              }
            },
            "required": [
              "p256dh",
              "auth"
            ],
            "type": "object"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "endpoint",
          "keys"
        ],
        "type": "object"
      },
      "QuantityOffer": {
        "properties": {
          "available": {
            "description": "False for a set card one of whose products cannot be sold now: shown, not chosen.",
            "type": "boolean"
          },
          "badge": {
            "description": "The store's badge for the card (\"POPULAR\"); empty for none.",
            "type": "string"
          },
          "items": {
            "description": "A set card's products, added to the basket together.",
            "items": {
              "$ref": "#/components/schemas/PackItem"
            },
            "type": "array"
          },
          "label": {
            "description": "The store's name for the card in the request's language; empty for the storefront's default.",
            "type": "string"
          },
          "quantity": {
            "description": "N of the variant; 0 on a set card.",
            "type": "integer"
          },
          "saving": {
            "$ref": "#/components/schemas/Money"
          },
          "set_id": {
            "description": "A set card's product set.",
            "format": "int64",
            "type": "integer"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "unit_total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "quantity",
          "available",
          "label",
          "badge",
          "subtotal",
          "total",
          "unit_total",
          "saving"
        ],
        "type": "object"
      },
      "QuantityOffers": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "default_quantity": {
            "description": "The card chosen first; 0 with no cards.",
            "type": "integer"
          },
          "layout": {
            "description": "How the buy box lays the cards out: side by side, or stacked rows.",
            "enum": [
              "side",
              "stacked"
            ],
            "type": "string"
          },
          "offers": {
            "items": {
              "$ref": "#/components/schemas/QuantityOffer"
            },
            "type": "array"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "currency",
          "default_quantity",
          "layout",
          "offers"
        ],
        "type": "object"
      },
      "QuantityRule": {
        "description": "How many units of a variant a basket may hold (ADR-0091 §1): at least `min`, in multiples of `step` (the pack's size, \"koli içi 12 adet\"); `min` is a multiple of `step`. Absent on a variant sold at any quantity. As input: `step` 0 is 1, `min` 0 is one pack; {\"min\": 1, \"step\": 1} takes the rule off; `unit` \"piece\" is the default.",
        "properties": {
          "min": {
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "pack": {
            "description": "The pack's name for the shopper (\"koli\", \"paket\"); empty for none.",
            "maxLength": 30,
            "type": "string"
          },
          "step": {
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "unit": {
            "description": "What one of the quantity is: piece (adet, the default — never sent), pack (paket), box (kutu), roll (rulo), case (koli), pair (çift), kit (takım), set, kg, m, l. `min`, `step`, the tier table and the refusals count in it (\"1 koli = 20 paket\").",
            "enum": [
              "piece",
              "pack",
              "box",
              "roll",
              "case",
              "pair",
              "kit",
              "set",
              "kg",
              "m",
              "l"
            ],
            "type": "string"
          }
        },
        "required": [
          "min",
          "step"
        ],
        "type": "object"
      },
      "QuoteLine": {
        "properties": {
          "label": {
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "unit": {
            "description": "What `quantity` counts; omitted for pieces.",
            "enum": [
              "pack",
              "box",
              "roll",
              "case",
              "pair",
              "kit",
              "set",
              "kg",
              "m",
              "l"
            ],
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "product_id",
          "sku",
          "title",
          "quantity"
        ],
        "type": "object"
      },
      "QuoteLineInput": {
        "properties": {
          "quantity": {
            "maximum": 1000000,
            "minimum": 1,
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "quantity"
        ],
        "type": "object"
      },
      "QuoteRequestInput": {
        "properties": {
          "cart_id": {
            "description": "Ask about a basket's lines (its token).",
            "type": "string"
          },
          "company": {
            "maxLength": 200,
            "type": "string"
          },
          "consent": {
            "type": "boolean"
          },
          "consent_text": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "lines": {
            "description": "Or about the products named.",
            "items": {
              "$ref": "#/components/schemas/QuoteLineInput"
            },
            "maxItems": 100,
            "type": "array"
          },
          "locale": {
            "type": "string"
          },
          "message": {
            "maxLength": 5000,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "type": "string"
          },
          "page_path": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "started_at": {
            "format": "int64",
            "type": "integer"
          },
          "website": {
            "description": "Honeypot.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "email",
          "consent",
          "consent_text"
        ],
        "type": "object"
      },
      "RFMGroup": {
        "properties": {
          "customers": {
            "type": "integer"
          },
          "group": {
            "enum": [
              "champions",
              "loyal",
              "promising",
              "new",
              "at_risk",
              "hibernating",
              "lost"
            ],
            "type": "string"
          },
          "spent": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "group",
          "customers",
          "spent"
        ],
        "type": "object"
      },
      "RecentPurchase": {
        "properties": {
          "city": {
            "description": "The city the order goes to; no other detail of the buyer.",
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "minutes_ago": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "title",
          "minutes_ago"
        ],
        "type": "object"
      },
      "RecoveryTokenInput": {
        "properties": {
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "type": "object"
      },
      "RecurringJob": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "every_seconds": {
            "type": "integer"
          },
          "last_enqueued_at": {
            "format": "date-time",
            "type": "string"
          },
          "required": {
            "description": "The store may not switch it off.",
            "type": "boolean"
          },
          "required_reason": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "every_seconds",
          "enabled",
          "required"
        ],
        "type": "object"
      },
      "RedirectImportResult": {
        "properties": {
          "applied": {
            "description": "True when the rules were written.",
            "type": "boolean"
          },
          "created": {
            "type": "integer"
          },
          "dry_run": {
            "type": "boolean"
          },
          "errors": {
            "items": {
              "properties": {
                "line": {
                  "description": "The file's line, the header being line 1; 0 for the file as a whole.",
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "unchanged": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          }
        },
        "required": [
          "created",
          "updated",
          "unchanged",
          "errors",
          "dry_run",
          "applied"
        ],
        "type": "object"
      },
      "Refund": {
        "description": "One movement of money back to the customer. A guest reading their own order with its access token sees only refunds that actually moved money, and without reason, by or error — those belong to the operator.",
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "by": {
            "description": "The operator's email as it was then. Empty when a script holding the static admin token did it.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "description": "What the provider said when it refused.",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "method": {
            "description": "provider: the money went back through the payment method. manual: the merchant sent it back outside the store and recorded it.",
            "enum": [
              "provider",
              "manual"
            ],
            "type": "string"
          },
          "provider": {
            "description": "The method the money went out through, as it was at the time.",
            "type": "string"
          },
          "provider_reference": {
            "description": "The gateway's own id for the refund — what a bank statement is reconciled against. Empty when the provider does not report one.",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "return_id": {
            "description": "The return this refund paid for; absent for a refund that was not about goods.",
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "description": "pending only while the provider is being asked: the row is committed before that call, and is what stops a second refund spending the same money.",
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "RefundApproval": {
        "description": "A refund waiting for, or past, its second approval (ADR-0135).",
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "decided_by": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "refund",
              "cancel_refund",
              "return_refund"
            ],
            "type": "string"
          },
          "mine": {
            "description": "The caller asked for it, so cannot decide it.",
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "done",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "kind",
          "amount",
          "status",
          "created_at",
          "mine"
        ],
        "type": "object"
      },
      "RefundApprovalSettings": {
        "properties": {
          "thresholds": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Minor units per currency code; a currency left out is not gated.",
            "type": "object"
          }
        },
        "required": [
          "thresholds"
        ],
        "type": "object"
      },
      "RefundLine": {
        "properties": {
          "line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          }
        },
        "required": [
          "line_id",
          "quantity"
        ],
        "type": "object"
      },
      "RefundQuote": {
        "properties": {
          "lines": {
            "items": {
              "properties": {
                "amount": {
                  "$ref": "#/components/schemas/Money"
                },
                "line_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer"
                },
                "sku": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "line_id",
                "title",
                "quantity",
                "amount"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "shipping": {
            "$ref": "#/components/schemas/Money"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "lines",
          "shipping",
          "total"
        ],
        "type": "object"
      },
      "RefundQuoteInput": {
        "properties": {
          "lines": {
            "items": {
              "$ref": "#/components/schemas/RefundLine"
            },
            "type": "array"
          },
          "shipping": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "RegionPaymentsInput": {
        "properties": {
          "bank_transfer": {
            "type": "boolean"
          },
          "cod": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "RenderedLegalDocument": {
        "properties": {
          "body": {
            "type": "string"
          },
          "body_doc": {
            "additionalProperties": true,
            "description": "The document the storefront's legal page draws (ADR-0086), when the text was written as one: placeholders filled with the store's (and the basket's) values, each numbered heading carrying its clause number in attrs.number. body is the same text read plain; sha256 is body's.",
            "type": "object"
          },
          "document_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "published_at": {
            "description": "When this version went live: the page's \"last updated\".",
            "format": "date-time",
            "type": "string"
          },
          "required_at_checkout": {
            "type": "boolean"
          },
          "sha256": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RequeueResult": {
        "properties": {
          "remaining": {
            "description": "Dead letters still parked after this call, counted in the same transaction. Non-zero means click again.",
            "type": "integer"
          },
          "requeued": {
            "description": "How many dead letters this call moved back to pending. Capped at 500.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ReturnLabel": {
        "properties": {
          "carrier": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "label_url": {
            "description": "Admin route serving the label file, when the carrier issued one.",
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "return_id": {
            "format": "int64",
            "type": "integer"
          },
          "tracking": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReturnReason": {
        "description": "A coded reason goods come back, in at most two levels. A return line names one without sub-reasons and keeps its label.",
        "properties": {
          "children": {
            "description": "How many sub-reasons it has; a reason with any cannot be named on a return line.",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "description": "What the operator and the customer read.",
            "type": "string"
          },
          "parent_id": {
            "description": "The heading this reason sits under.",
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "description": "Stable code: lower-case letters, digits, - and _.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReturnReasonInput": {
        "properties": {
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "label": {
            "maxLength": 200,
            "type": "string"
          },
          "parent_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "value": {
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
            "type": "string"
          }
        },
        "required": [
          "value",
          "label"
        ],
        "type": "object"
      },
      "ReturnReasonPatch": {
        "properties": {
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "label": {
            "maxLength": 200,
            "type": "string"
          },
          "parent_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "value": {
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
            "type": "string"
          }
        },
        "type": "object"
      },
      "RevealedLicenceKey": {
        "properties": {
          "code": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "code"
        ],
        "type": "object"
      },
      "ReviewCounts": {
        "properties": {
          "approved": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          }
        },
        "required": [
          "pending",
          "approved",
          "rejected"
        ],
        "type": "object"
      },
      "ReviewPhoto": {
        "description": "An approved photo the writer attached; the files are the media library's (metadata stripped).",
        "properties": {
          "height": {
            "type": "integer"
          },
          "thumbnail_url": {
            "description": "A small copy for the list (the file itself when none was made).",
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "url",
          "thumbnail_url"
        ],
        "type": "object"
      },
      "ReviewProduct": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "title"
        ],
        "type": "object"
      },
      "ReviewReceipt": {
        "properties": {
          "received": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "pending"
            ],
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "received",
          "status",
          "verified"
        ],
        "type": "object"
      },
      "ReviewReply": {
        "description": "The store's reply under a review. Who on the staff wrote it is never served; show the store's name.",
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "at"
        ],
        "type": "object"
      },
      "ReviewRequestOverview": {
        "properties": {
          "report": {
            "$ref": "#/components/schemas/ReviewRequestReport"
          },
          "settings": {
            "$ref": "#/components/schemas/ReviewRequestSettings"
          }
        },
        "required": [
          "settings",
          "report"
        ],
        "type": "object"
      },
      "ReviewRequestProduct": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "slug"
        ],
        "type": "object"
      },
      "ReviewRequestReceipt": {
        "properties": {
          "received": {
            "type": "boolean"
          },
          "reward_code": {
            "type": "string"
          },
          "reward_until": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        },
        "required": [
          "received",
          "status",
          "verified"
        ],
        "type": "object"
      },
      "ReviewRequestReport": {
        "properties": {
          "days": {
            "type": "integer"
          },
          "reviewed": {
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "waiting": {
            "type": "integer"
          }
        },
        "required": [
          "days",
          "waiting",
          "sent",
          "reviewed",
          "skipped"
        ],
        "type": "object"
      },
      "ReviewRequestSettings": {
        "properties": {
          "can_send": {
            "description": "Read only: an e-mail sender is set up for the store.",
            "type": "boolean"
          },
          "days_after_delivery": {
            "maximum": 60,
            "minimum": 1,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "reward_days": {
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          },
          "reward_discount": {
            "$ref": "#/components/schemas/ReviewRewardDiscount"
          },
          "reward_discount_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "reward_enabled": {
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "days_after_delivery",
          "reward_enabled",
          "reward_discount_id",
          "reward_days",
          "can_send"
        ],
        "type": "object"
      },
      "ReviewRequestView": {
        "properties": {
          "author_name": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          },
          "product": {
            "$ref": "#/components/schemas/ReviewRequestProduct"
          },
          "reward": {
            "type": "boolean"
          },
          "used": {
            "type": "boolean"
          }
        },
        "required": [
          "product",
          "author_name",
          "order_number",
          "used",
          "reward"
        ],
        "type": "object"
      },
      "ReviewRewardDiscount": {
        "properties": {
          "code": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title"
        ],
        "type": "object"
      },
      "ReviewStars": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "stars": {
            "type": "integer"
          }
        },
        "required": [
          "stars",
          "count"
        ],
        "type": "object"
      },
      "ReviewSubmission": {
        "properties": {
          "body": {
            "maxLength": 4000,
            "minLength": 10,
            "type": "string"
          },
          "consent": {
            "type": "boolean"
          },
          "consent_text": {
            "type": "string"
          },
          "email": {
            "description": "Never shown. Ignored for a signed-in shopper (the account's).",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "name": {
            "description": "Shown beside the review. A signed-in shopper may leave it empty: first name and initial.",
            "maxLength": 60,
            "type": "string"
          },
          "order_number": {
            "description": "Optional: with the email, proves the purchase (verified badge).",
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "rating": {
            "maximum": 5,
            "minimum": 1,
            "type": "integer"
          },
          "started_at": {
            "description": "When the form was rendered, Unix ms.",
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "maxLength": 120,
            "type": "string"
          },
          "website": {
            "description": "Honeypot: empty from a person.",
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "rating",
          "body",
          "consent",
          "consent_text",
          "started_at"
        ],
        "type": "object"
      },
      "ReviewSummary": {
        "properties": {
          "average": {
            "type": "number"
          },
          "count": {
            "type": "integer"
          },
          "stars": {
            "description": "5 down to 1.",
            "items": {
              "$ref": "#/components/schemas/ReviewStars"
            },
            "type": "array"
          },
          "with_photos": {
            "description": "How many approved reviews carry an approved photo.",
            "type": "integer"
          }
        },
        "required": [
          "average",
          "count",
          "stars",
          "with_photos"
        ],
        "type": "object"
      },
      "ReviewVote": {
        "properties": {
          "already_voted": {
            "description": "This visitor had voted before; nothing was counted.",
            "type": "boolean"
          },
          "helpful_count": {
            "type": "integer"
          },
          "review_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "review_id",
          "helpful_count",
          "already_voted"
        ],
        "type": "object"
      },
      "RichTextCleanInput": {
        "properties": {
          "document": {
            "additionalProperties": true,
            "description": "A TipTap / ProseMirror JSON document.",
            "type": "object"
          },
          "profile": {
            "enum": [
              "description",
              "section",
              "page",
              "document",
              "legal"
            ],
            "type": "string"
          }
        },
        "required": [
          "profile",
          "document"
        ],
        "type": "object"
      },
      "RichTextCleanResult": {
        "properties": {
          "document": {
            "additionalProperties": true,
            "description": "The document as a save would store it; null when it holds nothing.",
            "type": [
              "object",
              "null"
            ]
          },
          "removed": {
            "items": {
              "$ref": "#/components/schemas/HTMLRemoval"
            },
            "type": "array"
          }
        },
        "required": [
          "document",
          "removed"
        ],
        "type": "object"
      },
      "RichTextDocument": {
        "additionalProperties": true,
        "description": "A TipTap (ProseMirror) JSON document. Allowed nodes: doc, paragraph, heading (level 2–4), blockquote, bulletList, orderedList (start), listItem, codeBlock, horizontalRule, hardBreak, text; marks: bold, italic, strike, underline, code, link (href: http, https, mailto, tel, a path on the site or #anchor; target: _blank). Anything else is refused with the path of the node; unknown attributes are dropped. Stored as the cleaned document, never as HTML; a renderer escapes every text node.",
        "properties": {
          "content": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "doc"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "RiskEvent": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "bin": {
            "type": "string"
          },
          "card_country": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "allow",
              "require_3ds",
              "review",
              "refuse"
            ],
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "review_status": {
            "enum": [
              "",
              "pending",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "reviewed_by": {
            "type": "string"
          },
          "rules": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ship_country": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "amount",
          "outcome",
          "rules",
          "created_at"
        ],
        "type": "object"
      },
      "RiskReason": {
        "properties": {
          "code": {
            "enum": [
              "first_order_large",
              "first_cod_large",
              "earlier_cancelled",
              "many_today",
              "country_mismatch",
              "disposable_email",
              "digits_in_name",
              "failed_payments",
              "large_quantity"
            ],
            "type": "string"
          },
          "points": {
            "type": "integer"
          },
          "value": {
            "type": "integer"
          }
        },
        "required": [
          "code",
          "points"
        ],
        "type": "object"
      },
      "RoleMatrix": {
        "description": "The whole permission model in one response, so a client renders the grid without keeping its own copy of either axis.",
        "properties": {
          "all_rights": {
            "description": "The closed catalogue of rights, in display order.",
            "items": {
              "enum": [
                "catalog.read",
                "catalog.write",
                "inventory.read",
                "inventory.write",
                "discounts.read",
                "discounts.write",
                "taxes.read",
                "taxes.write",
                "locations.read",
                "locations.write",
                "orders.read",
                "orders.write",
                "orders.fulfill",
                "orders.refund",
                "customers.read",
                "team.read",
                "team.write",
                "roles.write",
                "data.export",
                "data.import",
                "store.operate",
                "shipping.read",
                "shipping.write",
                "channels.read",
                "channels.write",
                "plugins.read",
                "plugins.write",
                "notifications.read",
                "notifications.write",
                "collections.read",
                "collections.write",
                "categories.read",
                "categories.write",
                "media.read",
                "media.write",
                "pricing.read",
                "pricing.write",
                "groups.read",
                "groups.write",
                "reports.read",
                "carts.read",
                "payouts.read",
                "store.write",
                "apikeys.read",
                "apikeys.write",
                "reports.write",
                "vendors.read",
                "vendors.write",
                "customers.write",
                "content.read",
                "content.write",
                "content.review",
                "content.publish",
                "theme.read",
                "theme.write",
                "theme.publish",
                "contact.read",
                "contact.write",
                "review.read",
                "review.write",
                "media.delete"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "description": "What no role can be stripped of. A role without catalog.read can sign in and see nothing, which is a removed operator rather than a narrower one.",
            "items": {
              "enum": [
                "catalog.read",
                "catalog.write",
                "inventory.read",
                "inventory.write",
                "discounts.read",
                "discounts.write",
                "taxes.read",
                "taxes.write",
                "locations.read",
                "locations.write",
                "orders.read",
                "orders.write",
                "orders.fulfill",
                "orders.refund",
                "customers.read",
                "team.read",
                "team.write",
                "roles.write",
                "data.export",
                "data.import",
                "store.operate",
                "shipping.read",
                "shipping.write",
                "channels.read",
                "channels.write",
                "plugins.read",
                "plugins.write",
                "notifications.read",
                "notifications.write",
                "collections.read",
                "collections.write",
                "categories.read",
                "categories.write",
                "media.read",
                "media.write",
                "pricing.read",
                "pricing.write",
                "groups.read",
                "groups.write",
                "reports.read",
                "carts.read",
                "payouts.read",
                "store.write",
                "apikeys.read",
                "apikeys.write",
                "reports.write",
                "vendors.read",
                "vendors.write",
                "customers.write",
                "content.read",
                "content.write",
                "content.review",
                "content.publish",
                "theme.read",
                "theme.write",
                "theme.publish",
                "contact.read",
                "contact.write",
                "review.read",
                "review.write",
                "media.delete"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "roles": {
            "items": {
              "$ref": "#/components/schemas/RoleSet"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "RoleSet": {
        "description": "What one role may do in this store, beside what the engine ships for it. A role with no stored override keeps tracking the default, so a right added to a role in a later release reaches every store that never re-cut it. Since M8 a store also defines its own roles beside the engine's; a custom role has no defaults (`default` is empty) and is deleted rather than reset.",
        "properties": {
          "configurable": {
            "description": "False for owner, which always carries every right: it is the way back into a store that has been configured into a corner, so it is not storable.",
            "type": "boolean"
          },
          "customized": {
            "description": "Whether this store has departed from the default.",
            "type": "boolean"
          },
          "default": {
            "description": "What the engine ships for this role, and what a reset returns to.",
            "items": {
              "enum": [
                "catalog.read",
                "catalog.write",
                "inventory.read",
                "inventory.write",
                "discounts.read",
                "discounts.write",
                "taxes.read",
                "taxes.write",
                "locations.read",
                "locations.write",
                "orders.read",
                "orders.write",
                "orders.fulfill",
                "orders.refund",
                "customers.read",
                "team.read",
                "team.write",
                "roles.write",
                "data.export",
                "data.import",
                "store.operate",
                "shipping.read",
                "shipping.write",
                "channels.read",
                "channels.write",
                "plugins.read",
                "plugins.write",
                "notifications.read",
                "notifications.write",
                "collections.read",
                "collections.write",
                "categories.read",
                "categories.write",
                "media.read",
                "media.write",
                "pricing.read",
                "pricing.write",
                "groups.read",
                "groups.write",
                "reports.read",
                "carts.read",
                "payouts.read",
                "store.write",
                "apikeys.read",
                "apikeys.write",
                "reports.write",
                "vendors.read",
                "vendors.write",
                "customers.write",
                "content.read",
                "content.write",
                "content.review",
                "content.publish",
                "theme.read",
                "theme.write",
                "theme.publish",
                "contact.read",
                "contact.write",
                "review.read",
                "review.write",
                "media.delete"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "description": "What the role is for.",
            "type": "string"
          },
          "mfa_required": {
            "description": "Whether members holding this role must enroll a second factor.",
            "type": "boolean"
          },
          "read_only": {
            "description": "A fixed job role (catalog, inventory, orders, marketing, finance, support, viewer; ADR-0041): its rights, title and description are the engine's in every store. It can be assigned and its MFA policy set; editing, renaming, resetting or deleting it is refused with 403.",
            "type": "boolean"
          },
          "rights": {
            "description": "The effective set: what this role may do here.",
            "items": {
              "enum": [
                "catalog.read",
                "catalog.write",
                "inventory.read",
                "inventory.write",
                "discounts.read",
                "discounts.write",
                "taxes.read",
                "taxes.write",
                "locations.read",
                "locations.write",
                "orders.read",
                "orders.write",
                "orders.fulfill",
                "orders.refund",
                "customers.read",
                "team.read",
                "team.write",
                "roles.write",
                "data.export",
                "data.import",
                "store.operate",
                "shipping.read",
                "shipping.write",
                "channels.read",
                "channels.write",
                "plugins.read",
                "plugins.write",
                "notifications.read",
                "notifications.write",
                "collections.read",
                "collections.write",
                "categories.read",
                "categories.write",
                "media.read",
                "media.write",
                "pricing.read",
                "pricing.write",
                "groups.read",
                "groups.write",
                "reports.read",
                "carts.read",
                "payouts.read",
                "store.write",
                "apikeys.read",
                "apikeys.write",
                "reports.write",
                "vendors.read",
                "vendors.write",
                "customers.write",
                "content.read",
                "content.write",
                "content.review",
                "content.publish",
                "theme.read",
                "theme.write",
                "theme.publish",
                "contact.read",
                "contact.write",
                "review.read",
                "review.write",
                "media.delete"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "role": {
            "description": "The role key: one of the engine's (owner, manager, staff, vendor, and the read-only catalog, inventory, orders, marketing, finance, support, viewer) or the store's own.",
            "type": "string"
          },
          "system": {
            "description": "Whether the engine ships this role. A custom role (false) can be deleted; a system role can only be reset — or, when read_only, not changed at all.",
            "type": "boolean"
          },
          "title": {
            "description": "What this store calls the role. The key in `role` never changes.",
            "type": "string"
          },
          "title_customized": {
            "description": "Whether those words are the store's own rather than the engine's.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "RouteCandidate": {
        "properties": {
          "bank": {
            "type": "string"
          },
          "commission_bp": {
            "description": "For the count; -1 unknown.",
            "type": "integer"
          },
          "excluded": {
            "description": "Why it was not eligible: currency, no_installments.",
            "type": "string"
          },
          "healthy": {
            "type": "boolean"
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "commission_bp",
          "healthy"
        ],
        "type": "object"
      },
      "RouteDecision": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "baseline_bp": {
            "type": "integer"
          },
          "baseline_provider": {
            "type": "string"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/RouteCandidate"
            },
            "type": "array"
          },
          "card": {
            "$ref": "#/components/schemas/CardInfo"
          },
          "catalog": {
            "type": "boolean"
          },
          "chosen": {
            "type": "string"
          },
          "chosen_bp": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "failover": {
            "description": "The rules would have picked a resting POS.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "installments": {
            "type": "integer"
          },
          "kind": {
            "enum": [
              "checkout",
              "pay_again"
            ],
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "payment_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "enum": [
              "catalog_neropay",
              "currency_fallback",
              "on_us",
              "family_mapping",
              "family_partner",
              "installment_pos",
              "volume_split",
              "cheapest",
              "priority"
            ],
            "type": "string"
          }
        },
        "required": [
          "chosen",
          "reason",
          "amount",
          "installments",
          "card",
          "chosen_bp",
          "baseline_bp",
          "candidates"
        ],
        "type": "object"
      },
      "RoutingMember": {
        "properties": {
          "bank": {
            "description": "The bank behind the POS (a key of banks), for the card's-own-bank rule. Empty: the POS's own.",
            "type": "string"
          },
          "commission_bp": {
            "additionalProperties": {
              "maximum": 5000,
              "minimum": 0,
              "type": "integer"
            },
            "description": "Commission per installment count (\"1\" a single payment) in basis points: 189 is 1.89%.",
            "type": "object"
          },
          "currencies": {
            "description": "The currencies the POS takes, as the owner typed them; empty: what the gateway reports, else any (ADR-0140).",
            "items": {
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            },
            "type": "array"
          },
          "provider": {
            "description": "The POS's payment method code.",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "RoutingPOS": {
        "properties": {
          "bank": {
            "type": "string"
          },
          "down_until": {
            "format": "date-time",
            "type": "string"
          },
          "failures": {
            "type": "integer"
          },
          "healthy": {
            "type": "boolean"
          },
          "last_error": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "quotes": {
            "description": "It quotes installments, so it can tell a card's bank.",
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "name",
          "quotes",
          "healthy",
          "failures"
        ],
        "type": "object"
      },
      "SEOAutofillInput": {
        "additionalProperties": false,
        "properties": {
          "use_ai": {
            "description": "False fills with the rules alone; omitted uses the AI assistant when it is set up.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SEOAutofillResult": {
        "properties": {
          "ai_calls": {
            "type": "integer"
          },
          "ai_failures": {
            "type": "integer"
          },
          "ai_stopped": {
            "description": "True when the run stopped asking the AI after repeated failures and went on with the rules.",
            "type": "boolean"
          },
          "alts_filled": {
            "type": "integer"
          },
          "categories_updated": {
            "type": "integer"
          },
          "descriptions_filled": {
            "type": "integer"
          },
          "keywords_filled": {
            "type": "integer"
          },
          "pages_updated": {
            "type": "integer"
          },
          "products_updated": {
            "type": "integer"
          },
          "proposals": {
            "description": "Suggestions left for the merchant: their own text with a problem, or a text the health-claim guard stopped.",
            "type": "integer"
          },
          "titles_filled": {
            "type": "integer"
          },
          "translations_updated": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SEOAutofillRun": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "done": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "kinds": {
            "description": "What the run may write, from the asking operator's rights (media: product pictures' alt texts).",
            "items": {
              "enum": [
                "products",
                "categories",
                "media"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "result": {
            "$ref": "#/components/schemas/SEOAutofillResult"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "use_ai": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "status",
          "use_ai",
          "kinds",
          "total",
          "done",
          "result",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SEOAutopilotSettings": {
        "description": "The store's Otopilot switch (on by default).",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "SEOAutopilotView": {
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/AIStatus"
          },
          "changes": {
            "items": {
              "$ref": "#/components/schemas/SEOChange"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "health": {
            "$ref": "#/components/schemas/SEOHealth"
          },
          "proposals": {
            "items": {
              "$ref": "#/components/schemas/SEOProposal"
            },
            "type": "array"
          },
          "proposals_total": {
            "type": "integer"
          },
          "queued": {
            "description": "Records waiting for a pass.",
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "ai",
          "health",
          "changes",
          "proposals",
          "proposals_total",
          "queued"
        ],
        "type": "object"
      },
      "SEOChange": {
        "description": "One SEO text the system wrote (or the merchant, by applying a suggestion or undoing): before and after, for Geri al.",
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          },
          "can_undo": {
            "description": "The newest change of its field, neither undone nor an undo itself.",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "field": {
            "enum": [
              "seo_title",
              "seo_description",
              "focus_keyword",
              "alt"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "reason": {
            "description": "empty (the field was empty), facts_changed (the system's own text, rewritten from new facts), guard_fallback (the AI's text was stopped by the health-claim guard, the rules' was clean), keyword, undo, proposal …",
            "type": "string"
          },
          "record_id": {
            "description": "The product, category, page or post — for a picture's alt text, the media id.",
            "format": "int64",
            "type": "integer"
          },
          "record_kind": {
            "enum": [
              "product",
              "category",
              "page",
              "post",
              "image"
            ],
            "type": "string"
          },
          "record_label": {
            "description": "The record's name when the change was made.",
            "type": "string"
          },
          "source": {
            "description": "autopilot: written by the AI from the fact sheet; rules: the ready-made rules; merchant_accepted: a suggestion the merchant applied; undo: Geri al.",
            "enum": [
              "autopilot",
              "rules",
              "merchant_accepted",
              "undo"
            ],
            "type": "string"
          },
          "undone_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "record_kind",
          "record_id",
          "record_label",
          "language",
          "field",
          "before",
          "after",
          "source",
          "reason",
          "created_at",
          "can_undo"
        ],
        "type": "object"
      },
      "SEOCount": {
        "properties": {
          "language": {
            "type": "string"
          },
          "missing_alt": {
            "type": "integer"
          },
          "missing_description": {
            "type": "integer"
          },
          "missing_title": {
            "type": "integer"
          },
          "total": {
            "description": "Records counted: products not archived, categories, published pages and posts, product pictures; in a non-default language, the records translated into it.",
            "type": "integer"
          },
          "type": {
            "enum": [
              "product",
              "category",
              "page",
              "post",
              "image"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "language",
          "total",
          "missing_title",
          "missing_description",
          "missing_alt"
        ],
        "type": "object"
      },
      "SEOHealth": {
        "description": "0–100, weighted over the signals that apply to the store.",
        "properties": {
          "level": {
            "enum": [
              "good",
              "ok",
              "bad"
            ],
            "type": "string"
          },
          "score": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "signals": {
            "items": {
              "$ref": "#/components/schemas/SEOHealthSignal"
            },
            "type": "array"
          }
        },
        "required": [
          "score",
          "level",
          "signals"
        ],
        "type": "object"
      },
      "SEOHealthSignal": {
        "properties": {
          "id": {
            "enum": [
              "titles",
              "unique_titles",
              "descriptions",
              "alts",
              "brand",
              "gtin",
              "categorised",
              "translations"
            ],
            "type": "string"
          },
          "missing": {
            "type": "integer"
          },
          "score": {
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "weight": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "weight",
          "total",
          "missing",
          "score"
        ],
        "type": "object"
      },
      "SEOKeyword": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "keyword": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "id",
          "language",
          "keyword"
        ],
        "type": "object"
      },
      "SEOKeywordInput": {
        "properties": {
          "keyword": {
            "maxLength": 100,
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "keyword"
        ],
        "type": "object"
      },
      "SEOOverview": {
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/AIStatus"
          },
          "counts": {
            "items": {
              "$ref": "#/components/schemas/SEOCount"
            },
            "type": "array"
          },
          "default_language": {
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "problems": {
            "description": "At most 100.",
            "items": {
              "$ref": "#/components/schemas/SEOProblem"
            },
            "type": "array"
          },
          "problems_total": {
            "type": "integer"
          },
          "run": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SEOAutofillRun"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "ai",
          "default_language",
          "languages",
          "counts",
          "problems",
          "problems_total",
          "run"
        ],
        "type": "object"
      },
      "SEOProblem": {
        "properties": {
          "id": {
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "missing_alt": {
            "description": "The record's pictures without alt text.",
            "type": "integer"
          },
          "problems": {
            "items": {
              "enum": [
                "missing_title",
                "missing_description",
                "title_too_short",
                "title_too_long",
                "description_too_short",
                "description_too_long",
                "missing_alt",
                "duplicate_title"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "product",
              "category",
              "page",
              "post"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "language",
          "title",
          "problems"
        ],
        "type": "object"
      },
      "SEOProposal": {
        "description": "A suggestion for a field the autopilot may not write: the merchant's own text with a problem (far too long or short, a risky health claim), or a generated text the health-claim guard stopped (needs review).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "current_value": {
            "type": "string"
          },
          "field": {
            "enum": [
              "seo_title",
              "seo_description",
              "focus_keyword",
              "alt"
            ],
            "type": "string"
          },
          "flagged": {
            "description": "The risky words the guard found (in the suggestion, or in the merchant's own text).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "proposed_value": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "merchant_text",
              "guard"
            ],
            "type": "string"
          },
          "record_id": {
            "format": "int64",
            "type": "integer"
          },
          "record_kind": {
            "enum": [
              "product",
              "category",
              "page",
              "post",
              "image"
            ],
            "type": "string"
          },
          "record_label": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "applied",
              "dismissed",
              "stale"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "record_kind",
          "record_id",
          "record_label",
          "language",
          "field",
          "current_value",
          "proposed_value",
          "reason",
          "flagged",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "SEOSuggestInput": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "description": "The product's category name, for context.",
            "type": "string"
          },
          "description": {
            "description": "The record's description as edited; markup is dropped.",
            "type": "string"
          },
          "focus_keyword": {
            "description": "The merchant's focus keyword, if any.",
            "type": "string"
          },
          "image_count": {
            "description": "How many alt texts to write, one per picture in display order.",
            "maximum": 20,
            "minimum": 0,
            "type": "integer"
          },
          "kind": {
            "enum": [
              "product",
              "category",
              "page",
              "post"
            ],
            "type": "string"
          },
          "language": {
            "description": "The editing language; empty is the store's default. A language the store does not serve is refused.",
            "type": "string"
          },
          "title": {
            "description": "The record's name as edited (required).",
            "type": "string"
          },
          "use_ai": {
            "description": "False asks for the rules alone; omitted uses the AI assistant when it is set up.",
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "title"
        ],
        "type": "object"
      },
      "SEOSuggestion": {
        "description": "Texts for the SEO box, nothing written. With the AI assistant the title and description are the model's (validated: 60 and 160 characters at most); without it, or when the call fails (ai_error), they come from rules: the name with the store's, the description's first sentences or a sentence from the name, the category and the store.",
        "properties": {
          "ai": {
            "$ref": "#/components/schemas/AIStatus"
          },
          "ai_error": {
            "description": "Why the AI was not used although set up: rate_limited, timeout, network, refused, provider_error or invalid_answer.",
            "type": "string"
          },
          "focus_keyword": {
            "type": "string"
          },
          "image_alts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "source": {
            "enum": [
              "ai",
              "rules"
            ],
            "type": "string"
          }
        },
        "required": [
          "seo_title",
          "seo_description",
          "focus_keyword",
          "image_alts",
          "source",
          "ai"
        ],
        "type": "object"
      },
      "SMTPAutoConfig": {
        "properties": {
          "dkim_selector": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "from_address": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "known": {
            "type": "boolean"
          },
          "mx": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "password_help_url": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "provider": {
            "description": "google, microsoft, yandex, zoho, zoho_eu, icloud; empty when unknown",
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "security": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "domain",
          "provider",
          "host",
          "port",
          "security",
          "username",
          "from_address",
          "known",
          "mx"
        ],
        "type": "object"
      },
      "SMTPDomainCheck": {
        "properties": {
          "code": {
            "description": "The finding, for a translated message: spf_multiple, spf_plus_all, spf_no_include, dmarc_none, dmarc_inherited, dkim_revoked, lookup_failed, no_selector.",
            "type": "string"
          },
          "detail": {
            "description": "Why, in English.",
            "type": "string"
          },
          "found": {
            "description": "The records seen that look like this kind.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "The DNS name looked up.",
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "warn",
              "missing",
              "error",
              "unchecked"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "name",
          "found"
        ],
        "type": "object"
      },
      "SMTPRecordAdvice": {
        "properties": {
          "name": {
            "type": "string"
          },
          "purpose": {
            "enum": [
              "spf",
              "dmarc",
              "dkim"
            ],
            "type": "string"
          },
          "replace": {
            "description": "A record of this kind exists and this value takes its place.",
            "type": "boolean"
          },
          "type": {
            "example": "TXT",
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "value",
          "purpose"
        ],
        "type": "object"
      },
      "SMTPSenderDomainReport": {
        "properties": {
          "blocking": {
            "description": "Always false: the checks never stop a message.",
            "type": "boolean"
          },
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "dkim": {
            "$ref": "#/components/schemas/SMTPDomainCheck"
          },
          "dmarc": {
            "$ref": "#/components/schemas/SMTPDomainCheck"
          },
          "domain": {
            "type": "string"
          },
          "records": {
            "items": {
              "$ref": "#/components/schemas/SMTPRecordAdvice"
            },
            "type": "array"
          },
          "smtp_host": {
            "type": "string"
          },
          "spf": {
            "$ref": "#/components/schemas/SMTPDomainCheck"
          }
        },
        "required": [
          "domain",
          "smtp_host",
          "checked_at",
          "spf",
          "dmarc",
          "dkim",
          "records",
          "blocking"
        ],
        "type": "object"
      },
      "SMTPTestResult": {
        "properties": {
          "error": {
            "description": "What went wrong — the server's answer when it refused (e.g. 535 for a wrong password).",
            "type": "string"
          },
          "reason": {
            "description": "app_password, auth, connect, or empty",
            "type": "string"
          },
          "sent": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "sent",
          "to"
        ],
        "type": "object"
      },
      "SalePrice": {
        "description": "A row's price over the product's active variants, minor units.",
        "properties": {
          "max_minor": {
            "format": "int64",
            "type": "integer"
          },
          "min_minor": {
            "format": "int64",
            "type": "integer"
          },
          "priced": {
            "type": "integer"
          },
          "variants": {
            "type": "integer"
          }
        },
        "required": [
          "min_minor",
          "max_minor",
          "priced",
          "variants"
        ],
        "type": "object"
      },
      "SaleRow": {
        "properties": {
          "abroad": {
            "type": "boolean"
          },
          "countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "inherited": {
            "description": "The row as today's data sells the product, not edited since: it sells exactly as before whatever it lacks (status flagged).",
            "type": "boolean"
          },
          "missing": {
            "items": {
              "enum": [
                "countries",
                "vat",
                "price",
                "origin",
                "hs_code",
                "customs_name",
                "incoterm",
                "payment",
                "company",
                "currency"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "price": {
            "$ref": "#/components/schemas/SalePrice"
          },
          "regions": {
            "description": "The sales regions (market codes) the row follows (ADR-0147): its countries are theirs, kept in step. Empty: the row's own country list.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shipping_included": {
            "type": "boolean"
          },
          "status": {
            "description": "live: complete and offered; draft: incomplete and not offered; flagged: inherited and incomplete — on sale as before, to complete.",
            "enum": [
              "live",
              "draft",
              "flagged"
            ],
            "type": "string"
          },
          "vat_bp": {
            "description": "Basis points (2000 = 20 %); null: not chosen.",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "currency",
          "countries",
          "vat_bp",
          "shipping_included",
          "inherited",
          "price",
          "abroad",
          "status",
          "missing",
          "regions"
        ],
        "type": "object"
      },
      "SaleRowInput": {
        "properties": {
          "countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "price_minor": {
            "description": "Prices every variant in the currency.",
            "format": "int64",
            "type": "integer"
          },
          "regions": {
            "description": "Makes the row follow these sales regions (ADR-0147): its countries become the regions', whatever countries says; a region must sell in the row's currency.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shipping_included": {
            "type": "boolean"
          },
          "vat_bp": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "currency"
        ],
        "type": "object"
      },
      "SalesAreaHealth": {
        "properties": {
          "area": {
            "enum": [
              "domestic",
              "international"
            ],
            "type": "string"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/SalesCheck"
            },
            "type": "array"
          }
        },
        "required": [
          "area",
          "checks"
        ],
        "type": "object"
      },
      "SalesAreaState": {
        "properties": {
          "area": {
            "enum": [
              "domestic",
              "international"
            ],
            "type": "string"
          },
          "enabled": {
            "description": "The store's mode sells in this area.",
            "type": "boolean"
          },
          "in_use": {
            "description": "What the store uses in the area.",
            "items": {
              "enum": [
                "foreign_market",
                "foreign_currency",
                "foreign_payment",
                "foreign_carrier",
                "etgb",
                "foreign_orders",
                "domestic_payment",
                "domestic_carrier"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "visible": {
            "description": "The panel lists the area: the mode sells in it (what is in use in an area the mode does not sell in keeps working; in_use names it).",
            "type": "boolean"
          }
        },
        "required": [
          "area",
          "enabled",
          "visible",
          "in_use"
        ],
        "type": "object"
      },
      "SalesBucket": {
        "description": "One calendar day, ISO week or month of the window, cut in `time_zone`.",
        "properties": {
          "discount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Order-level discount. One per order (D28)."
          },
          "end": {
            "description": "Exclusive, and exactly the next bucket's start.",
            "format": "date-time",
            "type": "string"
          },
          "excluded": {
            "$ref": "#/components/schemas/ExcludedSales"
          },
          "items": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "subtotal_minor summed: what the goods were priced at, before any discount."
          },
          "net": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "items less discount, and less tax when the order's prices contained it — so `total = net + tax + shipping` holds under either tax mode. Refunds are never netted off it."
          },
          "orders": {
            "type": "integer"
          },
          "outstanding": {
            "$ref": "#/components/schemas/SalesSubset"
          },
          "paid": {
            "$ref": "#/components/schemas/PaidSales"
          },
          "partial": {
            "description": "The window clips this bucket, so its figures cover less than a whole day, week or month. What stops \"sales are down today\" being read off three hours of trading.",
            "type": "boolean"
          },
          "refunded": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SalesSubset"
              }
            ],
            "description": "Orders whose every minor unit has come back, so `payment_status` reads refunded. Counted and reported, never netted off `net` — and the money behind a partial refund is in `paid.refunded` instead."
          },
          "shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What was charged for delivery."
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Tax on the order, whether the prices contained it or not."
          },
          "total": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "total_minor summed: what the customer was charged."
          },
          "units": {
            "description": "Line quantities summed over the same orders.",
            "type": "integer"
          }
        },
        "required": [
          "start",
          "end",
          "orders",
          "units",
          "items",
          "discount",
          "shipping",
          "tax",
          "net",
          "total"
        ],
        "type": "object"
      },
      "SalesCheck": {
        "properties": {
          "count": {
            "description": "The number the line states.",
            "type": "integer"
          },
          "detail": {
            "description": "A name the line shows (an integrator, currency codes, an Incoterm).",
            "type": "string"
          },
          "key": {
            "enum": [
              "base_currency",
              "domestic_payment",
              "domestic_carrier",
              "e_invoice",
              "company",
              "export_company",
              "foreign_markets",
              "exchange_rates",
              "foreign_payment",
              "foreign_carrier",
              "hs_codes",
              "export_invoice",
              "export_defaults",
              "etgb_mail",
              "atr_mail",
              "duties"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "ok",
              "todo",
              "info"
            ],
            "type": "string"
          },
          "total": {
            "description": "What the count is out of.",
            "type": "integer"
          }
        },
        "required": [
          "key",
          "status"
        ],
        "type": "object"
      },
      "SalesModeInput": {
        "properties": {
          "mode": {
            "enum": [
              "domestic",
              "international",
              "both"
            ],
            "type": "string"
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "SalesModeState": {
        "properties": {
          "areas": {
            "items": {
              "$ref": "#/components/schemas/SalesAreaState"
            },
            "type": "array"
          },
          "chosen": {
            "description": "The store has said its mode.",
            "type": "boolean"
          },
          "derived": {
            "description": "What the store's set-up says (both or domestic).",
            "enum": [
              "domestic",
              "international",
              "both"
            ],
            "type": "string"
          },
          "home_country": {
            "description": "The store's country (its profile's, else TR).",
            "type": "string"
          },
          "mode": {
            "description": "The effective mode: the store's choice, else derived.",
            "enum": [
              "domestic",
              "international",
              "both"
            ],
            "type": "string"
          },
          "modes": {
            "items": {
              "enum": [
                "domestic",
                "international",
                "both"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "modules": {
            "items": {
              "$ref": "#/components/schemas/SalesModule"
            },
            "type": "array"
          }
        },
        "required": [
          "mode",
          "chosen",
          "derived",
          "home_country",
          "areas",
          "modules",
          "modes"
        ],
        "type": "object"
      },
      "SalesModule": {
        "description": "A payment or carrier module (or cash on delivery, bank transfer) and the area it is offered in.",
        "properties": {
          "area": {
            "enum": [
              "domestic",
              "international",
              "both"
            ],
            "type": "string"
          },
          "key": {
            "description": "The plugin key (payments-stripe, shipping-ups) or the built-in method (cod, bank_transfer).",
            "type": "string"
          },
          "kind": {
            "enum": [
              "payments",
              "shipping"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "kind",
          "area"
        ],
        "type": "object"
      },
      "SalesRegion": {
        "description": "A sales region (ADR-0147): a market with its KDV, delivery term and shipping fee by basket total.",
        "properties": {
          "bank_transfer": {
            "description": "Havale / EFT is offered for addresses in the region (on in the home region, off elsewhere unless switched; on everywhere for a store that sells only abroad).",
            "type": "boolean"
          },
          "brackets": {
            "items": {
              "$ref": "#/components/schemas/ShippingBracket"
            },
            "type": "array"
          },
          "cod": {
            "description": "Cash on delivery is offered for addresses in the region (on in the home region, off elsewhere unless switched).",
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "countries": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "incoterm": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "reach": {
            "description": "The countries the region sells to (the rest resolved).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "rest": {
            "description": "Names no country: sells to every country no other region names.",
            "type": "boolean"
          },
          "vat_bp": {
            "description": "KDV in basis points; null: each product's own KDV class rate.",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "currency",
          "countries",
          "languages",
          "is_default",
          "vat_bp",
          "incoterm",
          "brackets",
          "rest",
          "reach",
          "cod",
          "bank_transfer"
        ],
        "type": "object"
      },
      "SalesRegionInput": {
        "properties": {
          "brackets": {
            "items": {
              "$ref": "#/components/schemas/ShippingBracket"
            },
            "type": "array"
          },
          "countries": {
            "description": "Empty: the rest of the world.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "incoterm": {
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "vat_bp": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "currency"
        ],
        "type": "object"
      },
      "SalesRegionsState": {
        "properties": {
          "base_currency": {
            "type": "string"
          },
          "home_country": {
            "type": "string"
          },
          "regions": {
            "items": {
              "$ref": "#/components/schemas/SalesRegion"
            },
            "type": "array"
          }
        },
        "required": [
          "regions",
          "home_country",
          "base_currency"
        ],
        "type": "object"
      },
      "SalesReport": {
        "properties": {
          "currencies": {
            "description": "One block per currency the window contains, plus the store's configured currency even when it sold nothing. The store's own currency is first; the rest follow alphabetically. Nothing is ever summed across blocks.",
            "items": {
              "$ref": "#/components/schemas/CurrencySales"
            },
            "type": "array"
          },
          "from": {
            "description": "The resolved inclusive lower bound.",
            "format": "date-time",
            "type": "string"
          },
          "group_by": {
            "enum": [
              "day",
              "week",
              "month"
            ],
            "type": "string"
          },
          "time_zone": {
            "description": "The zone the buckets and the window edges were both cut in, canonicalised.",
            "type": "string"
          },
          "to": {
            "description": "The resolved exclusive upper bound.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "group_by",
          "time_zone",
          "currencies"
        ],
        "type": "object"
      },
      "SalesSubset": {
        "description": "One slice of the sale set, cut by payment status.",
        "properties": {
          "orders": {
            "type": "integer"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "orders",
          "total"
        ],
        "type": "object"
      },
      "SalesTotals": {
        "description": "The window, added up from its own buckets — never queried a second time, so a stat card and the chart beneath it cannot disagree.",
        "properties": {
          "average_order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "total / orders, rounded half up: an average in minor units has no fractional part the ledger could show. Zero when nothing sold."
          },
          "discount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Order-level discount. One per order (D28)."
          },
          "excluded": {
            "$ref": "#/components/schemas/ExcludedSales"
          },
          "items": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "subtotal_minor summed: what the goods were priced at, before any discount."
          },
          "net": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "items less discount, and less tax when the order's prices contained it — so `total = net + tax + shipping` holds under either tax mode. Refunds are never netted off it."
          },
          "orders": {
            "type": "integer"
          },
          "outstanding": {
            "$ref": "#/components/schemas/SalesSubset"
          },
          "paid": {
            "$ref": "#/components/schemas/PaidSales"
          },
          "refunded": {
            "$ref": "#/components/schemas/SalesSubset"
          },
          "shipping": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What was charged for delivery."
          },
          "tax": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Tax on the order, whether the prices contained it or not."
          },
          "total": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "total_minor summed: what the customer was charged."
          },
          "units": {
            "type": "integer"
          }
        },
        "required": [
          "orders",
          "units",
          "items",
          "discount",
          "shipping",
          "tax",
          "net",
          "total",
          "average_order"
        ],
        "type": "object"
      },
      "SavedCard": {
        "properties": {
          "bank": {
            "type": "string"
          },
          "brand": {
            "description": "Visa, Mastercard, Troy …",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "exp_month": {
            "type": "integer"
          },
          "exp_year": {
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last4": {
            "type": "string"
          },
          "provider": {
            "description": "The payment method the card is saved with.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "brand",
          "last4",
          "created_at"
        ],
        "type": "object"
      },
      "SavedOptionSet": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "display": {
            "enum": [
              "",
              "color",
              "image",
              "button",
              "select"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "description": "The option's name as products show it (\"Beden\").",
            "type": "string"
          },
          "preset": {
            "description": "The ready-made set it was taken from; empty for the merchant's own.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/SavedOptionValue"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "display",
          "preset",
          "values",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SavedOptionSetInput": {
        "properties": {
          "display": {
            "description": "'' or auto, color, image, button, select.",
            "type": "string"
          },
          "name": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          },
          "preset": {
            "maxLength": 40,
            "type": "string"
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/SavedOptionValue"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "name",
          "values"
        ],
        "type": "object"
      },
      "SavedOptionValue": {
        "properties": {
          "color": {
            "description": "#rrggbb on a colour set, else empty.",
            "type": "string"
          },
          "value": {
            "maxLength": 60,
            "type": "string"
          }
        },
        "required": [
          "value",
          "color"
        ],
        "type": "object"
      },
      "SavedSection": {
        "properties": {
          "available": {
            "description": "Whether the theme being edited has its section type (else the editor greys it out).",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "section": {
            "$ref": "#/components/schemas/TemplateSection"
          },
          "section_type": {
            "type": "string"
          },
          "theme_id": {
            "description": "The theme package it was saved from.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "theme_id",
          "section_type",
          "section",
          "available",
          "created_by_label",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SavedSectionInput": {
        "properties": {
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "section": {
            "$ref": "#/components/schemas/TemplateSection"
          }
        },
        "required": [
          "name",
          "section"
        ],
        "type": "object"
      },
      "SavedSectionRename": {
        "properties": {
          "name": {
            "maxLength": 80,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SavedView": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "list": {
            "enum": [
              "orders",
              "products"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SavedViewInput": {
        "properties": {
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "query": {
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SavingsByMoney": {
        "properties": {
          "baseline": {
            "$ref": "#/components/schemas/Money"
          },
          "cost": {
            "$ref": "#/components/schemas/Money"
          },
          "currency": {
            "type": "string"
          },
          "net": {
            "$ref": "#/components/schemas/Money"
          },
          "saved": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "currency",
          "net",
          "cost",
          "baseline",
          "saved"
        ],
        "type": "object"
      },
      "SavingsReport": {
        "properties": {
          "by_reason": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "payments": {
            "type": "integer"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "totals": {
            "items": {
              "$ref": "#/components/schemas/SavingsByMoney"
            },
            "type": "array"
          },
          "unpriced": {
            "type": "integer"
          }
        },
        "required": [
          "from",
          "to",
          "payments",
          "unpriced",
          "totals",
          "by_reason"
        ],
        "type": "object"
      },
      "Screen": {
        "description": "A screen a module contributes to the admin panel, described as data rather than shipped as code — the panel is compiled once and embedded, so a module cannot put components into it.",
        "properties": {
          "form": {
            "description": "Optional. Without it the screen is a reading.",
            "properties": {
              "create": {
                "type": "string"
              },
              "delete": {
                "type": "string"
              },
              "delete_warning": {
                "description": "The sentence in the confirm dialog. A module knows what deleting one of its rows costs and the panel does not.",
                "type": "string"
              },
              "fields": {
                "items": {
                  "properties": {
                    "help": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "kind": {
                      "enum": [
                        "text",
                        "textarea",
                        "number",
                        "toggle",
                        "select"
                      ],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "options": {
                      "items": {
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "required": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "id_key": {
                "default": "id",
                "type": "string"
              },
              "update": {
                "description": "A PATCH endpoint with {id} where the row's id goes.",
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "group": {
            "description": "The settings-sidebar heading it appears under. Empty puts it under the module's own name.",
            "type": "string"
          },
          "help": {
            "type": "string"
          },
          "icon": {
            "description": "A Remix Icon class, the set the panel already ships.",
            "type": "string"
          },
          "list": {
            "properties": {
              "columns": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "A field of the row. Dots reach into nested objects.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "How the cell is drawn. An unknown kind falls back to text, so a module built against a newer engine degrades rather than breaking.",
                      "enum": [
                        "text",
                        "code",
                        "number",
                        "date",
                        "relative",
                        "badge",
                        "bool"
                      ],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "narrow": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "empty": {
                "description": "What the table says with no rows. A sentence about this screen rather than \"No data\".",
                "type": "string"
              },
              "endpoint": {
                "description": "A GET answering {\"data\": [...]}.",
                "type": "string"
              },
              "paged": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "module": {
            "description": "Stamped by the engine, so a descriptor cannot claim to come from somewhere it does not.",
            "type": "string"
          },
          "right": {
            "description": "The right that gates both the nav entry and the screen. Required — a screen with no right would be visible to everyone with a session.",
            "type": "string"
          },
          "slug": {
            "description": "The URL segment the panel serves it at, under /x/. Unique across modules; the engine refuses a collision at boot.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SearchEnginesAuthorization": {
        "properties": {
          "authorization_url": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "authorization_url",
          "expires_at"
        ],
        "type": "object"
      },
      "SearchEnginesOverview": {
        "properties": {
          "bing": {
            "properties": {
              "adopted": {
                "description": "The engine already listed the site; it was adopted, not added.",
                "type": "boolean"
              },
              "has_key": {
                "type": "boolean"
              },
              "last_checked_at": {
                "format": "date-time",
                "type": "string"
              },
              "problem": {
                "description": "A code the screen turns into a sentence (NO_KEY, INVALID_KEY, REAUTH_REQUIRED, NO_SITE, VERIFICATION_FAILED, RATE_LIMITED, UNAVAILABLE, …).",
                "type": "string"
              },
              "site_url": {
                "type": "string"
              },
              "sitemap_submitted_at": {
                "format": "date-time",
                "type": "string"
              },
              "sitemap_url": {
                "type": "string"
              },
              "state": {
                "enum": [
                  "not_connected",
                  "verifying",
                  "verified",
                  "failed"
                ],
                "type": "string"
              },
              "submit_sitemap": {
                "type": "boolean"
              },
              "summary": {
                "additionalProperties": true,
                "description": "indexed_pages, crawled_pages, crawl_errors, excluded_pages, site_problems, date — as the engine reports them.",
                "type": "object"
              },
              "verified_by_us": {
                "type": "boolean"
              }
            },
            "required": [
              "state",
              "site_url",
              "adopted",
              "verified_by_us",
              "submit_sitemap",
              "summary",
              "has_key"
            ],
            "type": "object"
          },
          "indexnow": {
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "key_url": {
                "type": "string"
              },
              "last_count": {
                "type": "integer"
              },
              "last_outcome": {
                "enum": [
                  "accepted",
                  "refused",
                  "waiting"
                ],
                "type": "string"
              },
              "last_submitted_at": {
                "format": "date-time",
                "type": "string"
              },
              "pending": {
                "type": "integer"
              }
            },
            "required": [
              "enabled",
              "pending"
            ],
            "type": "object"
          },
          "site_url": {
            "type": "string"
          },
          "yandex": {
            "properties": {
              "adopted": {
                "description": "The engine already listed the site; it was adopted, not added.",
                "type": "boolean"
              },
              "configured": {
                "type": "boolean"
              },
              "connected": {
                "type": "boolean"
              },
              "last_checked_at": {
                "format": "date-time",
                "type": "string"
              },
              "problem": {
                "description": "A code the screen turns into a sentence (NO_KEY, INVALID_KEY, REAUTH_REQUIRED, NO_SITE, VERIFICATION_FAILED, RATE_LIMITED, UNAVAILABLE, …).",
                "type": "string"
              },
              "reauth_required": {
                "type": "boolean"
              },
              "site_url": {
                "type": "string"
              },
              "sitemap_submitted_at": {
                "format": "date-time",
                "type": "string"
              },
              "sitemap_url": {
                "type": "string"
              },
              "state": {
                "enum": [
                  "not_connected",
                  "verifying",
                  "verified",
                  "failed"
                ],
                "type": "string"
              },
              "submit_sitemap": {
                "type": "boolean"
              },
              "summary": {
                "additionalProperties": true,
                "description": "indexed_pages, crawled_pages, crawl_errors, excluded_pages, site_problems, date — as the engine reports them.",
                "type": "object"
              },
              "verified_by_us": {
                "type": "boolean"
              }
            },
            "required": [
              "state",
              "site_url",
              "adopted",
              "verified_by_us",
              "submit_sitemap",
              "summary",
              "configured",
              "connected",
              "reauth_required"
            ],
            "type": "object"
          }
        },
        "required": [
          "site_url",
          "indexnow",
          "bing",
          "yandex"
        ],
        "type": "object"
      },
      "SearchTermReport": {
        "properties": {
          "days": {
            "type": "integer"
          },
          "no_results": {
            "items": {
              "$ref": "#/components/schemas/SearchTermRow"
            },
            "type": "array"
          },
          "searches": {
            "type": "integer"
          },
          "top": {
            "items": {
              "$ref": "#/components/schemas/SearchTermRow"
            },
            "type": "array"
          }
        },
        "required": [
          "days",
          "searches",
          "top",
          "no_results"
        ],
        "type": "object"
      },
      "SearchTermRow": {
        "properties": {
          "last_day": {
            "format": "date-time",
            "type": "string"
          },
          "last_results": {
            "type": "integer"
          },
          "searches": {
            "type": "integer"
          },
          "term": {
            "type": "string"
          }
        },
        "required": [
          "term",
          "searches",
          "last_results",
          "last_day"
        ],
        "type": "object"
      },
      "SectionBlockSchema": {
        "properties": {
          "category": {
            "description": "The widget panel's group the node type is offered in.",
            "enum": [
              "commerce",
              "layout",
              "basic",
              "structure",
              "media",
              "content",
              "advanced",
              "marketing"
            ],
            "type": "string"
          },
          "container": {
            "description": "The node type holds other nodes (a free layout's container).",
            "type": "boolean"
          },
          "drop": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The field a picture (\"image\") or a video (\"video\") dropped on the widget fills; \"items.image\" appends a list item.",
            "type": "object"
          },
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionFieldSchema"
            },
            "type": "object"
          },
          "flag": {
            "description": "The feature flag a new node of the type needs (ADR-0085 §15; vb_media_drop for VB-3's widgets). A stored one stays and renders with the flag off.",
            "type": "string"
          },
          "inline": {
            "description": "The text of the node edited on the canvas: its field, and plain text or the inline rich-text profile.",
            "properties": {
              "field": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "plain",
                  "rich"
                ],
                "type": "string"
              }
            },
            "required": [
              "field",
              "kind"
            ],
            "type": "object"
          },
          "interactive": {
            "description": "The widget holds controls or links (a player, tabs, a carousel): never inside a container that is a link.",
            "type": "boolean"
          },
          "limit": {
            "type": "integer"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "v": {
            "description": "A free layout node type's schema version (ADR-0085 §1.3).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SectionField": {
        "properties": {
          "default": {},
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionField"
            },
            "type": "object"
          },
          "flag": {
            "description": "The feature a free layout node's value of this field needs (ADR-0085 §15): with it off a node keeps a stored value but sets or changes none (text_style needs vb_kits, VB-7).",
            "type": "string"
          },
          "group": {
            "description": "A free layout node's style field's inspector group (ADR-0085 §1.4).",
            "enum": [
              "spacing",
              "size",
              "background",
              "border",
              "typography",
              "visibility"
            ],
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "max": {
            "type": "integer"
          },
          "min": {
            "type": "integer"
          },
          "profile": {
            "description": "A richtext field's profile (ADR-0073): \"page\" adds tables, YouTube/Vimeo embeds, pictures and alignment. \"document\" is the block document editor's (ADR-0086): headings 2–6, notices, checklists, FAQ, columns, a table of contents, buttons, HTML blocks, library videos and pictures with captions. \"inline\" is a free layout's text widget, typed on the canvas: paragraphs, line breaks, bold, italic, underline, link (ADR-0085).",
            "enum": [
              "page",
              "document",
              "inline"
            ],
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "responsive": {
            "description": "The value may differ per device: {d, t, m} (ADR-0068); a block's field may too (ADR-0073).",
            "type": "boolean"
          },
          "role": {
            "enum": [
              "content",
              "style"
            ],
            "type": "string"
          },
          "step": {
            "type": "integer"
          },
          "type": {
            "description": "The field type; menu (a store menu by handle, ADR-0071) is offered by the page section \"Menü\". color_token is a free layout node's colour: a theme colour by name (background, surface, text, muted, accent, accent_text, tint, sale) a global colour of the global styles (global-1 … global-8, VB-7) or #rrggbb[aa] (ADR-0085). product_ref and variant_ref are a product's and a variant's id, promotion a countdown's \"discount:\u003cid\u003e\" or \"price_list:\u003cid\u003e\" (the free layout's commerce widgets, ADR-0085 §12). layers is a slide's layers (ADR-0085 §11): a list of at most max typed items (heading, text, button, image, video) whose fields are `fields`; their place, size and visibility may differ per device.",
            "enum": [
              "product_ref",
              "variant_ref",
              "promotion",
              "text",
              "textarea",
              "url",
              "image",
              "video",
              "slug",
              "enum",
              "int",
              "bool",
              "datetime",
              "color",
              "richtext",
              "list",
              "select",
              "checkbox",
              "range",
              "menu",
              "collection",
              "product",
              "product_list",
              "color_scheme",
              "font",
              "css",
              "html",
              "embed_url",
              "color_token",
              "layers"
            ],
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "SectionFieldSchema": {
        "properties": {
          "default": {},
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionFieldSchema"
            },
            "type": "object"
          },
          "flag": {
            "description": "The feature a free layout node's value of this field needs (ADR-0085 §15): with it off a node keeps a stored value but sets or changes none (text_style needs vb_kits, VB-7).",
            "type": "string"
          },
          "group": {
            "description": "A free layout node's style field's inspector group (ADR-0085 §1.4).",
            "enum": [
              "spacing",
              "size",
              "background",
              "border",
              "typography",
              "visibility"
            ],
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "max": {
            "type": "integer"
          },
          "min": {
            "type": "integer"
          },
          "profile": {
            "description": "A richtext field's rich-text profile: absent the light section profile, \"page\" the widgets' and articles' (tables, YouTube/Vimeo embeds, pictures, alignment; ADR-0073). \"document\" is the block document editor's (ADR-0086): headings 2–6, notices, checklists, FAQ, columns, a table of contents, buttons, HTML blocks, library videos and pictures with captions. \"inline\": a free layout's text widget typed on the canvas (paragraphs, line breaks, bold, italic, underline, link; ADR-0085).",
            "enum": [
              "page",
              "document",
              "inline"
            ],
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "responsive": {
            "description": "The value may differ per device in a template or group: {d, t, m} (computer, tablet, phone); a plain value is every device's (ADR-0068). A block's field may too (ADR-0073).",
            "type": "boolean"
          },
          "role": {
            "type": "string"
          },
          "step": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "SectionPresetSchema": {
        "properties": {
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/TemplateBlock"
            },
            "type": "array"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "settings": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "type": "object"
      },
      "SectionSchemaSet": {
        "description": "The registered section types and their props, in display order.",
        "properties": {
          "comment": {
            "type": "string"
          },
          "sections": {
            "additionalProperties": {
              "properties": {
                "blocks": {
                  "description": "The blocks the section holds (the columns section's widgets, the slider's slides; ADR-0073): {max, types: {\u003ctype\u003e: {name, fields}}}. The free layout's (ADR-0085) name their registry and are the nodes of a tree.",
                  "properties": {
                    "max": {
                      "type": "integer"
                    },
                    "registry": {
                      "description": "The registry the block types come from (content_widgets.json for the free layout).",
                      "type": "string"
                    },
                    "types": {
                      "additionalProperties": {
                        "properties": {
                          "category": {
                            "description": "The widget panel's group.",
                            "enum": [
                              "commerce",
                              "layout",
                              "basic",
                              "structure",
                              "advanced",
                              "marketing"
                            ],
                            "type": "string"
                          },
                          "container": {
                            "description": "The node type holds other nodes.",
                            "type": "boolean"
                          },
                          "fields": {
                            "additionalProperties": {
                              "$ref": "#/components/schemas/SectionField"
                            },
                            "type": "object"
                          },
                          "inline": {
                            "description": "The text edited on the canvas.",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "kind": {
                                "enum": [
                                  "plain",
                                  "rich"
                                ],
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "kind"
                            ],
                            "type": "object"
                          },
                          "limit": {
                            "type": "integer"
                          },
                          "name": {
                            "additionalProperties": {
                              "type": "string"
                            },
                            "type": "object"
                          },
                          "v": {
                            "description": "A free layout node type's schema version.",
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "fields": {
                  "additionalProperties": {
                    "$ref": "#/components/schemas/SectionField"
                  },
                  "type": "object"
                },
                "name": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "The section's name per language.",
                  "type": "object"
                },
                "presets": {
                  "description": "Ready-made configurations the add-section gallery offers.",
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "object"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SectionSchemaV2": {
        "description": "A section type: its fields, name per language, blocks, presets, where it may be used and how often per template or group.",
        "properties": {
          "blocks": {
            "properties": {
              "max": {
                "type": "integer"
              },
              "registry": {
                "description": "The registry the block types come from (content_widgets.json for the free layout, ADR-0085): its blocks are the nodes of a tree, each naming its container in parent.",
                "type": "string"
              },
              "types": {
                "additionalProperties": {
                  "$ref": "#/components/schemas/SectionBlockSchema"
                },
                "type": "object"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "disabled_on": {
            "$ref": "#/components/schemas/SectionScope"
          },
          "enabled_on": {
            "$ref": "#/components/schemas/SectionScope"
          },
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionFieldSchema"
            },
            "type": "object"
          },
          "limit": {
            "type": "integer"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "presets": {
            "items": {
              "$ref": "#/components/schemas/SectionPresetSchema"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SectionScope": {
        "properties": {
          "groups": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "templates": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Segment": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "members": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "rules": {
            "$ref": "#/components/schemas/SegmentRules"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "rules",
          "members",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SegmentInput": {
        "properties": {
          "name": {
            "type": "string"
          },
          "rules": {
            "$ref": "#/components/schemas/SegmentRules"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SegmentMember": {
        "properties": {
          "accepts_marketing": {
            "type": "boolean"
          },
          "customer_id": {
            "format": "int64",
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "last_order_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "phone": {
            "type": "string"
          },
          "spent_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "customer_id",
          "email",
          "name",
          "orders",
          "spent_minor",
          "accepts_marketing"
        ],
        "type": "object"
      },
      "SegmentPreview": {
        "properties": {
          "members": {
            "items": {
              "$ref": "#/components/schemas/SegmentMember"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "members"
        ],
        "type": "object"
      },
      "SegmentRules": {
        "description": "Every condition set must hold. Spent is paid orders less refunds, in the store's base currency; cancelled orders do not count.",
        "properties": {
          "accepts_marketing": {
            "type": "boolean"
          },
          "email_contains": {
            "type": "string"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "joined_within_days": {
            "type": "integer"
          },
          "max_orders": {
            "type": "integer"
          },
          "max_spent_minor": {
            "format": "int64",
            "type": "integer"
          },
          "min_orders": {
            "type": "integer"
          },
          "min_spent_minor": {
            "format": "int64",
            "type": "integer"
          },
          "no_order_for_days": {
            "type": "integer"
          },
          "ordered_within_days": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SellingApplyInput": {
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "source": {
            "$ref": "#/components/schemas/SellingSource"
          }
        },
        "required": [
          "product_ids",
          "source"
        ],
        "type": "object"
      },
      "SellingBulkResult": {
        "properties": {
          "draft": {
            "type": "integer"
          },
          "dry_run": {
            "type": "boolean"
          },
          "live": {
            "type": "integer"
          },
          "products": {
            "items": {
              "$ref": "#/components/schemas/SellingOutcome"
            },
            "type": "array"
          },
          "withdrawn": {
            "type": "integer"
          }
        },
        "required": [
          "dry_run",
          "products",
          "live",
          "draft",
          "withdrawn"
        ],
        "type": "object"
      },
      "SellingMigrateInput": {
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SellingMigrateResult": {
        "properties": {
          "dry_run": {
            "type": "boolean"
          },
          "flagged": {
            "type": "integer"
          },
          "live": {
            "type": "integer"
          },
          "moved": {
            "items": {
              "$ref": "#/components/schemas/SellingOutcome"
            },
            "type": "array"
          },
          "skipped": {
            "type": "integer"
          }
        },
        "required": [
          "dry_run",
          "moved",
          "live",
          "flagged",
          "skipped"
        ],
        "type": "object"
      },
      "SellingOutcome": {
        "properties": {
          "managed": {
            "type": "boolean"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRow"
            },
            "type": "array"
          }
        },
        "required": [
          "product_id",
          "managed",
          "rows"
        ],
        "type": "object"
      },
      "SellingSource": {
        "properties": {
          "export": {
            "$ref": "#/components/schemas/ProductExportInput"
          },
          "from_product_id": {
            "format": "int64",
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRowInput"
            },
            "type": "array"
          },
          "template_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SellingStore": {
        "properties": {
          "base_currency": {
            "type": "string"
          },
          "chargeable": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "company_missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currencies": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "default_incoterm": {
            "type": "string"
          },
          "foreign_payment": {
            "type": "boolean"
          },
          "home_country": {
            "type": "string"
          },
          "origin_country": {
            "type": "string"
          },
          "prices_include_tax": {
            "type": "boolean"
          }
        },
        "required": [
          "base_currency",
          "home_country",
          "origin_country",
          "company_missing",
          "chargeable",
          "foreign_payment",
          "currencies",
          "default_incoterm",
          "prices_include_tax"
        ],
        "type": "object"
      },
      "SellingTemplate": {
        "properties": {
          "export": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProductExportInput"
              }
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRowInput"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "rows",
          "export"
        ],
        "type": "object"
      },
      "SellingTemplateInput": {
        "properties": {
          "export": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ProductExportInput"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SaleRowInput"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SettingsPatch": {
        "description": "An absent field is kept. The base currency is not here on purpose.",
        "properties": {
          "default_language": {
            "description": "Must be one of `languages`.",
            "type": "string"
          },
          "flat_shipping_minor": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "hidden_languages": {
            "description": "Replaces the languages kept from shoppers (WPML's hidden languages): each one of the store's languages, never the default. Omitted: kept, less any language leaving the store or becoming the default.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "languages": {
            "description": "At least one BCP 47 tag.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "market_geo_detect": {
            "description": "Turns the shopper's country picking the market on or off.",
            "type": "boolean"
          },
          "order_prefix": {
            "description": "Up to 12 letters, digits or hyphens; may be empty.",
            "type": "string"
          },
          "price_always_decimals": {
            "description": "Shows every price with its decimals, or (false) drops a whole amount's.",
            "type": "boolean"
          },
          "prices_include_tax": {
            "type": "boolean"
          },
          "sale_badge": {
            "description": "A \"%15\" badge beside a discounted price, or none (0242).",
            "enum": [
              "percent",
              "none"
            ],
            "type": "string"
          },
          "sale_old_price": {
            "description": "How a discount's old price shows: struck through beside the new one, or hidden (0242).",
            "enum": [
              "strike",
              "hidden"
            ],
            "type": "string"
          },
          "sale_old_side": {
            "description": "The old price after the new one (right) or before it (left) (0242).",
            "enum": [
              "right",
              "left"
            ],
            "type": "string"
          },
          "shipping_tax": {
            "enum": [
              "none",
              "highest_line_rate"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShareLink": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "last_opened_at": {
            "format": "date-time",
            "type": "string"
          },
          "opened_count": {
            "description": "How often it was opened (a visit counts once per half hour).",
            "type": "integer"
          },
          "token": {
            "description": "The link's secret: only when the link is made. The storefront opens it as ?preview=\u003ctoken\u003e.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "created_by_label",
          "created_at",
          "expires_at",
          "opened_count"
        ],
        "type": "object"
      },
      "ShareLinkInput": {
        "properties": {
          "days": {
            "description": "How many days it opens (1–14; 0 or absent: 7).",
            "maximum": 14,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "maxLength": 80,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShippingBracket": {
        "properties": {
          "fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "min_total_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "min_total_minor",
          "fee_minor"
        ],
        "type": "object"
      },
      "ShippingBrackets": {
        "properties": {
          "brackets": {
            "items": {
              "$ref": "#/components/schemas/ShippingBracket"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "brackets"
        ],
        "type": "object"
      },
      "ShippingBracketsInput": {
        "properties": {
          "currencies": {
            "items": {
              "$ref": "#/components/schemas/ShippingBrackets"
            },
            "type": "array"
          }
        },
        "required": [
          "currencies"
        ],
        "type": "object"
      },
      "ShippingOffers": {
        "properties": {
          "configured": {
            "description": "False while the store has no active rate (flat shipping): nothing is listed.",
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "destinations": {
            "items": {
              "properties": {
                "country": {
                  "type": "string"
                },
                "rates": {
                  "items": {
                    "$ref": "#/components/schemas/ShippingQuote"
                  },
                  "type": "array"
                }
              },
              "required": [
                "country",
                "rates"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "currency",
          "configured",
          "destinations"
        ],
        "type": "object"
      },
      "ShippingQuote": {
        "properties": {
          "carbon_mode": {
            "description": "The transport mode the estimate assumed (the merchant's choice for the rate, else guessed from its name).",
            "enum": [
              "road",
              "van",
              "air"
            ],
            "type": "string"
          },
          "co2e_grams": {
            "description": "The option's estimated CO2e in grams when the store shows the carbon estimate and every line's weight is known: great-circle distance × parcel weight × the DESNZ 2025 freight factor of carbon_mode.",
            "format": "int64",
            "type": "integer"
          },
          "delivery_max_days": {
            "description": "Working days to the door at the most.",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "delivery_min_days": {
            "description": "Working days to the door at the least, for an estimated delivery date (0192).",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "landed_cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/LandedCost"
              }
            ],
            "description": "The duties and import taxes a duties-inclusive (DDP) market adds to the total with this option (ADR-0123): the checkout charges `total` as the order's duties. Absent when nothing is added (another market mode, no border crossed)."
          },
          "lowest_emission": {
            "description": "The lowest estimate among the options, when the store tags it.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "pickup": {
            "description": "Where the order is collected, for a pickup rate (0190).",
            "properties": {
              "address": {
                "$ref": "#/components/schemas/Address"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "In the basket's currency: only rates written in it are quoted."
          },
          "rate_id": {
            "description": "Send this back as shipping_rate_id on checkout.",
            "format": "int64",
            "type": "integer"
          },
          "zone_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ShippingRate": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "carrier_provider": {
            "description": "A fulfillment provider that prices this rate live; empty for a table rate.",
            "type": "string"
          },
          "carrier_service": {
            "type": "string"
          },
          "currency": {
            "description": "What `price` and the subtotal band are in. A basket is offered only the rates in its own currency — nothing is converted — so a store selling in a second currency writes rates in it.",
            "example": "EUR",
            "type": "string"
          },
          "delivery_max_days": {
            "description": "Working days to the door at the most.",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "delivery_min_days": {
            "description": "Working days to the door at the least, for an estimated delivery date (0192).",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "max_subtotal_minor": {
            "description": "Exclusive. Absent means no ceiling.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "max_weight_grams": {
            "description": "The band's end in grams (exclusive).",
            "minimum": 1,
            "type": "integer"
          },
          "min_subtotal_minor": {
            "description": "Inclusive.",
            "format": "int64",
            "type": "integer"
          },
          "min_weight_grams": {
            "description": "The basket weight band's start in grams (inclusive), 0190; absent is any weight.",
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "description": "What the shopper sees, such as Standard or Express.",
            "type": "string"
          },
          "name_translations": {
            "additionalProperties": {
              "maxLength": 120,
              "type": "string"
            },
            "description": "The name in the store's other languages, keyed by language code (0201); a language missing here is shown `name`. On a write, a language given empty has its name removed.",
            "type": "object"
          },
          "pickup_location_id": {
            "description": "A pickup rate: the location the order is collected from (0190).",
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "zone_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ShippingRateInput": {
        "properties": {
          "active": {
            "default": true,
            "type": "boolean"
          },
          "carrier_provider": {
            "description": "A fulfillment provider that prices this rate live; empty for a table rate.",
            "type": "string"
          },
          "carrier_service": {
            "type": "string"
          },
          "currency": {
            "description": "The currency the price and band are in; omitted is the store's base currency. An unknown code is a 400. Bands of one method must not overlap within one currency; the same method may have a band in each currency.",
            "example": "EUR",
            "type": "string"
          },
          "delivery_max_days": {
            "description": "Working days to the door at the most.",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "delivery_min_days": {
            "description": "Working days to the door at the least, for an estimated delivery date (0192).",
            "maximum": 120,
            "minimum": 0,
            "type": "integer"
          },
          "max_subtotal_minor": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "max_weight_grams": {
            "description": "The band's end in grams (exclusive).",
            "minimum": 1,
            "type": "integer"
          },
          "min_subtotal_minor": {
            "default": 0,
            "format": "int64",
            "type": "integer"
          },
          "min_weight_grams": {
            "description": "The basket weight band's start in grams (inclusive), 0190; absent is any weight.",
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "example": "Standard",
            "type": "string"
          },
          "name_translations": {
            "additionalProperties": {
              "maxLength": 120,
              "type": "string"
            },
            "description": "The name in the store's other languages, keyed by language code (0201); a language missing here is shown `name`. On a write, a language given empty has its name removed.",
            "type": "object"
          },
          "pickup_location_id": {
            "description": "A pickup rate: the location the order is collected from (0190).",
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "default": 0,
            "type": "integer"
          },
          "price_minor": {
            "example": 4900,
            "format": "int64",
            "type": "integer"
          },
          "zone_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "zone_id",
          "name",
          "price_minor"
        ],
        "type": "object"
      },
      "ShippingZone": {
        "properties": {
          "countries": {
            "description": "ISO country codes. Empty means anywhere.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "states": {
            "description": "ISO state codes. Empty means anywhere within the countries above.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShippingZoneInput": {
        "properties": {
          "countries": {
            "example": [
              "IN"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "example": "India",
            "type": "string"
          },
          "states": {
            "example": [
              "KA"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "ShopperSubscription": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "interval_days": {
            "type": "integer"
          },
          "items": {
            "description": "The lines in words: \"Title × 2, …\".",
            "type": "string"
          },
          "last_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/CheckoutLinkLine"
            },
            "type": "array"
          },
          "next_run_at": {
            "format": "date-time",
            "type": "string"
          },
          "origin": {
            "description": "Where it started: the product page's subscribe choice (checkout) or an old order repeated from the account.",
            "enum": [
              "checkout",
              "account"
            ],
            "type": "string"
          },
          "runs": {
            "type": "integer"
          },
          "source_order_id": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "lines",
          "items",
          "interval_days",
          "status",
          "next_run_at",
          "runs",
          "created_at",
          "origin"
        ],
        "type": "object"
      },
      "ShopperSubscriptionPatch": {
        "properties": {
          "interval_days": {
            "maximum": 365,
            "minimum": 7,
            "type": "integer"
          },
          "skip": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShoppingAssistantAdmin": {
        "properties": {
          "ai_provider": {
            "type": "string"
          },
          "ai_ready": {
            "description": "Whether the store's own AI key is set up.",
            "type": "boolean"
          },
          "conversations": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "fallbacks": {
            "description": "Answers given without the AI.",
            "type": "integer"
          },
          "greetings": {
            "additionalProperties": {
              "maxLength": 300,
              "type": "string"
            },
            "description": "The greeting per storefront language (tr, en, de, fr, it, es, nl, da, sv, pl), at most 300 characters each; a language left out uses the storefront's own greeting.",
            "type": "object"
          },
          "messages": {
            "type": "integer"
          },
          "month": {
            "description": "The counters' month, 2026-10 (UTC).",
            "type": "string"
          },
          "tone": {
            "enum": [
              "friendly",
              "professional",
              "concise"
            ],
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "greetings",
          "tone",
          "ai_ready",
          "month",
          "conversations",
          "messages",
          "fallbacks"
        ],
        "type": "object"
      },
      "ShoppingAssistantSettings": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "greetings": {
            "additionalProperties": {
              "maxLength": 300,
              "type": "string"
            },
            "description": "The greeting per storefront language (tr, en, de, fr, it, es, nl, da, sv, pl), at most 300 characters each; a language left out uses the storefront's own greeting.",
            "type": "object"
          },
          "tone": {
            "enum": [
              "friendly",
              "professional",
              "concise"
            ],
            "type": "string"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "SiteFile": {
        "properties": {
          "body": {
            "description": "The file's contents (the storefront's read only).",
            "type": "string"
          },
          "code": {
            "description": "The verification code the file carries (BingSiteAuth.xml's user, an HTML file's token), for the panel.",
            "type": "string"
          },
          "content_type": {
            "enum": [
              "text/html; charset=utf-8",
              "application/xml; charset=utf-8",
              "text/plain; charset=utf-8"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "description": "Where the storefront serves it: /{name}, or /.well-known/{name} for Apple Pay's.",
            "type": "string"
          },
          "provider": {
            "description": "The provider the name belongs to (google, bing, yandex, baidu, naver, pinterest, tiktok, applepay).",
            "type": "string"
          },
          "size": {
            "description": "Bytes.",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "name",
          "path",
          "provider",
          "content_type",
          "size",
          "updated_at"
        ],
        "type": "object"
      },
      "SiteFileInput": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "The file's contents as text.",
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "SiteVerification": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/SiteFile"
            },
            "type": "array"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/SiteVerificationProvider"
            },
            "type": "array"
          }
        },
        "required": [
          "providers",
          "files"
        ],
        "type": "object"
      },
      "SiteVerificationProvider": {
        "properties": {
          "files": {
            "description": "The provider also checks a file at the domain's root.",
            "type": "boolean"
          },
          "group": {
            "enum": [
              "search",
              "social",
              "trust"
            ],
            "type": "string"
          },
          "key": {
            "enum": [
              "google",
              "bing",
              "yandex",
              "baidu",
              "naver",
              "seznam",
              "facebook",
              "pinterest",
              "tiktok",
              "norton",
              "ahrefs",
              "etbis",
              "applepay"
            ],
            "type": "string"
          },
          "meta": {
            "description": "The meta tag's name the storefront renders; absent for Apple Pay (a file only) and ETBİS (a footer link).",
            "type": "string"
          },
          "name": {
            "description": "The provider's own name.",
            "type": "string"
          },
          "token": {
            "description": "What the storefront publishes now; \"\" when nothing.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "The provider's page where the code or the file is made.",
            "type": "string"
          }
        },
        "required": [
          "key",
          "name",
          "group",
          "files",
          "url",
          "token"
        ],
        "type": "object"
      },
      "SiteVerificationTagInput": {
        "additionalProperties": false,
        "properties": {
          "value": {
            "maxLength": 4096,
            "type": "string"
          }
        },
        "required": [
          "value"
        ],
        "type": "object"
      },
      "SizeGuide": {
        "properties": {
          "collection_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "columns": {
            "description": "Headings, each per language.",
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Per language (tr, en, de).",
              "type": "object"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_default": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language (tr, en, de).",
            "type": "object"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language (tr, en, de).",
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "title",
          "columns",
          "rows",
          "note",
          "product_ids",
          "collection_ids",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SizeGuideInput": {
        "description": "Name 1–80; title per language (≤ 80, at least one); 1–12 columns (≤ 40 each); 1–40 rows with one cell per column (≤ 40, not all empty); note per language (≤ 1000); up to 500 products and 100 collections that exist; is_default takes the store's default from any other guide.",
        "properties": {
          "collection_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "columns": {
            "items": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Per language (tr, en, de).",
              "type": "object"
            },
            "type": "array"
          },
          "is_default": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language (tr, en, de).",
            "type": "object"
          },
          "product_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "rows": {
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language (tr, en, de).",
            "type": "object"
          }
        },
        "required": [
          "name",
          "title",
          "columns",
          "rows"
        ],
        "type": "object"
      },
      "SocialConnectInput": {
        "properties": {
          "return_url": {
            "description": "The admin page to come back to: https, under /admin, on one of this store's hosts.",
            "type": "string"
          }
        },
        "required": [
          "return_url"
        ],
        "type": "object"
      },
      "SocialConnectStart": {
        "properties": {
          "authorization_url": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "redirect_uri": {
            "description": "The platform redirect URI the provider returns to.",
            "type": "string"
          }
        },
        "required": [
          "authorization_url",
          "expires_at",
          "redirect_uri"
        ],
        "type": "object"
      },
      "SocialFeed": {
        "properties": {
          "account": {
            "type": "string"
          },
          "display": {
            "$ref": "#/components/schemas/SocialFeedDisplay"
          },
          "enabled": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SocialFeedItem"
            },
            "type": "array"
          },
          "platform": {
            "enum": [
              "instagram",
              "youtube",
              "tiktok",
              "x",
              "facebook",
              "linkedin",
              "pinterest"
            ],
            "type": "string"
          },
          "profile_url": {
            "description": "The \"Follow\" button's link.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "platform",
          "enabled",
          "items",
          "display"
        ],
        "type": "object"
      },
      "SocialFeedDisplay": {
        "description": "The feed's look as its plugin's sheet chose it (\"Görünüm\"), every value resolved with the defaults (a grid of 8 posts in 4 columns, the endless row 40 seconds per loop and pausing under the pointer, the Follow button shown). chosen names the values the merchant set; those win over a theme section's or live component's own values unless the section sets use_plugin_display false.",
        "properties": {
          "all": {
            "description": "Every post the feed holds (up to 50).",
            "type": "boolean"
          },
          "chosen": {
            "items": {
              "enum": [
                "layout",
                "count",
                "columns",
                "speed",
                "pause_on_hover",
                "show_follow"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "columns": {
            "description": "Columns on a computer; phones and tablets use fewer.",
            "maximum": 6,
            "minimum": 1,
            "type": "integer"
          },
          "count": {
            "description": "How many posts to show: the chosen number, rows × columns, or 50 for every post.",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "home": {
            "description": "Whether the feed appears on the home page by itself when no section there already shows it (default true; the sheet's display_home).",
            "type": "boolean"
          },
          "layout": {
            "enum": [
              "grid",
              "carousel",
              "marquee",
              "masonry"
            ],
            "type": "string"
          },
          "pause_on_hover": {
            "type": "boolean"
          },
          "rows": {
            "description": "The chosen number of rows (shown posts = rows × columns); absent otherwise.",
            "maximum": 10,
            "minimum": 1,
            "type": "integer"
          },
          "show_follow": {
            "type": "boolean"
          },
          "speed": {
            "description": "The endless row (marquee): seconds per full loop.",
            "maximum": 120,
            "minimum": 20,
            "type": "integer"
          }
        },
        "required": [
          "layout",
          "count",
          "all",
          "columns",
          "speed",
          "pause_on_hover",
          "show_follow",
          "chosen"
        ],
        "type": "object"
      },
      "SocialFeedItem": {
        "properties": {
          "author": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "embed_url": {
            "description": "The platform's player or embed address (YouTube nocookie, TikTok player, Facebook plugin, LinkedIn embed); absent for Instagram, Pinterest and X.",
            "type": "string"
          },
          "id": {
            "description": "The platform's id (media, video or post id), a Pinterest pin id, or the post's address or URN (Facebook, LinkedIn).",
            "type": "string"
          },
          "image_url": {
            "description": "The picture's copy in the store's media library; absent when the platform gives none.",
            "type": "string"
          },
          "kind": {
            "enum": [
              "image",
              "video",
              "carousel",
              "post",
              "page"
            ],
            "type": "string"
          },
          "permalink": {
            "description": "The post on the platform.",
            "type": "string"
          },
          "posted_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "permalink"
        ],
        "type": "object"
      },
      "SocialFeedStatus": {
        "properties": {
          "account": {
            "type": "string"
          },
          "avatar_url": {
            "description": "The account's picture, a copy in the media library.",
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "connect_available": {
            "description": "The platform administrator added the provider's app: the panel offers Connect.",
            "type": "boolean"
          },
          "connect_supported": {
            "description": "The platform connects with its own login (Instagram, Facebook, TikTok).",
            "type": "boolean"
          },
          "connected": {
            "type": "boolean"
          },
          "connected_at": {
            "format": "date-time",
            "type": "string"
          },
          "connected_name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "items": {
            "type": "integer"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_success_at": {
            "format": "date-time",
            "type": "string"
          },
          "pages": {
            "description": "Facebook: the Pages the login reached, to choose one from.",
            "items": {
              "$ref": "#/components/schemas/SocialPageChoice"
            },
            "type": "array"
          },
          "platform": {
            "type": "string"
          },
          "platform_key": {
            "description": "YouTube: the platform's own API key is set; the channel is enough.",
            "type": "boolean"
          },
          "plugin": {
            "type": "string"
          },
          "token_expires_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "platform",
          "plugin",
          "enabled",
          "configured",
          "items",
          "connect_supported",
          "connect_available",
          "platform_key",
          "connected"
        ],
        "type": "object"
      },
      "SocialFeedTestResult": {
        "properties": {
          "account": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "items": {
            "type": "integer"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "items"
        ],
        "type": "object"
      },
      "SocialLink": {
        "properties": {
          "contact": {
            "type": "boolean"
          },
          "footer": {
            "type": "boolean"
          },
          "header": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "network": {
            "enum": [
              "instagram",
              "facebook",
              "x",
              "youtube",
              "tiktok",
              "linkedin",
              "pinterest",
              "whatsapp",
              "telegram",
              "threads",
              "spotify",
              "podcast",
              "other"
            ],
            "type": "string"
          },
          "url": {
            "description": "The normalised https address.",
            "type": "string"
          }
        },
        "required": [
          "network",
          "url",
          "footer",
          "header",
          "contact"
        ],
        "type": "object"
      },
      "SocialPageChoice": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "SocialPageInput": {
        "properties": {
          "page_id": {
            "type": "string"
          }
        },
        "required": [
          "page_id"
        ],
        "type": "object"
      },
      "StaffGoogleCallbackInput": {
        "properties": {
          "binding": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "state",
          "code",
          "binding"
        ],
        "type": "object"
      },
      "StaffGoogleSession": {
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "record": {
            "$ref": "#/components/schemas/Superuser"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "expires_at",
          "record"
        ],
        "type": "object"
      },
      "StaffGoogleStartInput": {
        "properties": {
          "redirect_uri": {
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "redirect_uri"
        ],
        "type": "object"
      },
      "StaffGoogleStarted": {
        "properties": {
          "binding": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "binding"
        ],
        "type": "object"
      },
      "StockAlertConfig": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "sms": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "sms"
        ],
        "type": "object"
      },
      "StockAlertDemand": {
        "properties": {
          "available": {
            "type": "integer"
          },
          "oldest": {
            "format": "date-time",
            "type": "string"
          },
          "price_drop": {
            "type": "integer"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_title": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "variant_label": {
            "type": "string"
          },
          "waiting": {
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "product_id",
          "product_title",
          "sku",
          "waiting",
          "price_drop",
          "oldest"
        ],
        "type": "object"
      },
      "StockAlertInput": {
        "properties": {
          "consent": {
            "description": "Must be true: the person ticked the box.",
            "type": "boolean"
          },
          "consent_text": {
            "description": "The wording the person agreed to (the proof).",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "back_in_stock",
              "price_drop"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "consent",
          "consent_text"
        ],
        "type": "object"
      },
      "StockAlertOverview": {
        "properties": {
          "report": {
            "$ref": "#/components/schemas/StockAlertReport"
          },
          "settings": {
            "$ref": "#/components/schemas/StockAlertSettings"
          }
        },
        "required": [
          "settings",
          "report"
        ],
        "type": "object"
      },
      "StockAlertReceipt": {
        "properties": {
          "status": {
            "enum": [
              "waiting"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "StockAlertReport": {
        "properties": {
          "converted": {
            "type": "integer"
          },
          "sent": {
            "type": "integer"
          },
          "waiting": {
            "type": "integer"
          }
        },
        "required": [
          "waiting",
          "sent",
          "converted"
        ],
        "type": "object"
      },
      "StockAlertRequest": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "notified_at": {
            "format": "date-time",
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "status": {
            "enum": [
              "waiting",
              "sent",
              "cancelled"
            ],
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "kind",
          "variant_id",
          "channel",
          "recipient",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "StockAlertSettings": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "multiple": {
            "description": "One unit of new stock is announced to this many people a day.",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "sms": {
            "description": "A phone number is taken beside an email address.",
            "type": "boolean"
          },
          "sms_ready": {
            "description": "An SMS sender is set up (reads only).",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "sms",
          "multiple"
        ],
        "type": "object"
      },
      "StockMovement": {
        "description": "One row of the append-only stock ledger. Two deltas rather than one, because a commit takes units out of the reservation and off the shelf in the same movement and a single signed number could not say which happened. Every row records what the statement APPLIED, never what the caller asked for — five of the writers move nothing for a variant that does not track inventory, one floors a release at zero, and two write absolutely — which is what makes sum(on_hand_delta) reconcile to on_hand for every (variant, location) pair. variant_id and location_id go null when their parent is deleted, while sku and location_code keep what the row was written with, so history survives a deleted SKU and a closed shelf. A null superuser_id means no person was behind it; `source` then names which path was.",
        "properties": {
          "actor_email": {
            "type": "string"
          },
          "counterpart_code": {
            "type": "string"
          },
          "counterpart_location_id": {
            "description": "The other end of a transfer.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "opening",
              "adjust",
              "stock_take",
              "import",
              "transfer_out",
              "transfer_in",
              "reserve",
              "commit",
              "release",
              "restock",
              "sell"
            ],
            "type": "string"
          },
          "location_code": {
            "type": "string"
          },
          "location_id": {
            "description": "Null once the location has been deleted; `location_code` still names it.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "on_hand_after": {
            "type": "integer"
          },
          "on_hand_delta": {
            "type": "integer"
          },
          "order_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "order_number": {
            "type": "string"
          },
          "reason": {
            "description": "The operator's own words, when they gave any.",
            "type": "string"
          },
          "reason_code": {
            "description": "The coded reason an operator picked; absent for order and import movements.",
            "enum": [
              "counted",
              "received",
              "damaged",
              "lost",
              "returned",
              "correction",
              "other"
            ],
            "type": "string"
          },
          "reserved_after": {
            "type": "integer"
          },
          "reserved_delta": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "source": {
            "description": "Which path moved the stock, not who: whether a person or a static admin token was behind an `admin` movement is superuser_id's job. `migration` belongs to the ledger's own opening balances.",
            "enum": [
              "admin",
              "checkout",
              "order",
              "sweeper",
              "import",
              "migration"
            ],
            "type": "string"
          },
          "superuser_id": {
            "description": "Null when no person was behind the movement — a checkout, the unpaid sweeper, a script holding a static token — or when the operator's account has since been deleted, in which case actor_email still names them.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "variant_id": {
            "description": "Null once the variant has been deleted; `sku` still names it.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "StockValueReport": {
        "properties": {
          "cost_value": {
            "$ref": "#/components/schemas/Money"
          },
          "currency": {
            "type": "string"
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/StockValueRow"
            },
            "type": "array"
          },
          "retail_value": {
            "$ref": "#/components/schemas/Money"
          },
          "units": {
            "format": "int64",
            "type": "integer"
          },
          "variants": {
            "type": "integer"
          },
          "variants_without_cost": {
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "units",
          "cost_value",
          "retail_value",
          "variants",
          "variants_without_cost",
          "locations"
        ],
        "type": "object"
      },
      "StockValueRow": {
        "properties": {
          "cost_value": {
            "$ref": "#/components/schemas/Money"
          },
          "location_code": {
            "type": "string"
          },
          "location_id": {
            "format": "int64",
            "type": "integer"
          },
          "location_name": {
            "type": "string"
          },
          "retail_value": {
            "$ref": "#/components/schemas/Money"
          },
          "units": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "location_id",
          "location_code",
          "location_name",
          "units",
          "cost_value",
          "retail_value"
        ],
        "type": "object"
      },
      "StoreAlternateTemplates": {
        "additionalProperties": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "description": "The live theme's alternate templates by base template (product, collection, page): {\"product\": [\"landing\"]}.",
        "type": "object"
      },
      "StoreArticle": {
        "properties": {
          "author": {
            "type": "string"
          },
          "author_ref": {
            "$ref": "#/components/schemas/StoreBlogAuthor"
          },
          "category": {
            "$ref": "#/components/schemas/BlogRef"
          },
          "cover_alt": {
            "type": "string"
          },
          "cover_image": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "sticky": {
            "type": "boolean"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreArticleBlog": {
        "properties": {
          "author": {
            "$ref": "#/components/schemas/StoreBlogAuthor"
          },
          "category": {
            "$ref": "#/components/schemas/BlogRef"
          },
          "comment_count": {
            "type": "integer"
          },
          "comments": {
            "description": "The mode a reader meets on this article.",
            "enum": [
              "off",
              "moderated",
              "auto"
            ],
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "tags",
          "comments",
          "comment_count"
        ],
        "type": "object"
      },
      "StoreBlogAuthor": {
        "properties": {
          "avatar": {
            "type": "string"
          },
          "bio": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "type": "object"
      },
      "StoreBlogComment": {
        "properties": {
          "author_name": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "reply": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "author_name",
          "body",
          "created_at"
        ],
        "type": "object"
      },
      "StoreBlogIndex": {
        "properties": {
          "authors": {
            "items": {
              "$ref": "#/components/schemas/StoreBlogAuthor"
            },
            "type": "array"
          },
          "categories": {
            "items": {
              "properties": {
                "count": {
                  "type": "integer"
                },
                "description": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                }
              },
              "required": [
                "slug",
                "name",
                "count"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "comments": {
            "enum": [
              "off",
              "moderated",
              "auto"
            ],
            "type": "string"
          },
          "page_size": {
            "type": "integer"
          },
          "tags": {
            "items": {
              "properties": {
                "count": {
                  "type": "integer"
                },
                "tag": {
                  "type": "string"
                }
              },
              "required": [
                "tag",
                "count"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "categories",
          "authors",
          "tags",
          "comments",
          "page_size"
        ],
        "type": "object"
      },
      "StoreBrand": {
        "properties": {
          "favicon_url": {
            "description": "The live favicon's address; empty when the store has none.",
            "type": "string"
          },
          "logo_url": {
            "description": "The live logo's address; empty when the store has none.",
            "type": "string"
          },
          "name": {
            "description": "The store's name.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "logo_url",
          "favicon_url"
        ],
        "type": "object"
      },
      "StoreBuilderTemplatePreview": {
        "properties": {
          "name": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          }
        },
        "required": [
          "ref",
          "name",
          "sections"
        ],
        "type": "object"
      },
      "StoreContentPage": {
        "properties": {
          "article": {
            "$ref": "#/components/schemas/ContentArticleFields"
          },
          "blog": {
            "$ref": "#/components/schemas/StoreArticleBlog"
          },
          "description": {
            "type": "string"
          },
          "document": {
            "$ref": "#/components/schemas/ContentDocument"
          },
          "kind": {
            "enum": [
              "home",
              "page",
              "article",
              "popup",
              "global"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "languages": {
            "description": "Languages the page is published in (hreflang, language switcher).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "page_id": {
            "format": "int64",
            "type": "integer"
          },
          "preview": {
            "description": "An unpublished version chosen by a preview token: never cache or index it.",
            "type": "boolean"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "seo": {
            "$ref": "#/components/schemas/ContentSEO"
          },
          "slug": {
            "type": "string"
          },
          "slugs": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The page's address in each language it is published in: the language's own slug, else `slug`. The page is found under any of its slugs in any language; a storefront redirects a request under another one to the language's own and builds canonical and hreflang from these.",
            "type": "object"
          },
          "status": {
            "enum": [
              "draft",
              "in_review",
              "approved",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "template": {
            "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
            "maxLength": 40,
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StoreCoupon": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "code": {
            "description": "Only while the discount can be used.",
            "type": "string"
          },
          "ends_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "active"
        ],
        "type": "object"
      },
      "StoreCrawl": {
        "properties": {
          "block_ai_crawlers": {
            "description": "Turn away the crawlers that collect pages for AI models (GPTBot, ClaudeBot, CCBot, Google-Extended, PerplexityBot and others); search engines' own crawlers are untouched.",
            "type": "boolean"
          },
          "hide_from_search": {
            "description": "Keep the whole store out of search engines: robots.txt disallows everything, every page says noindex, the sitemap is empty and no IndexNow ping goes out.",
            "type": "boolean"
          },
          "robots_extra": {
            "description": "The store's own robots.txt lines, after the standard ones.",
            "maxLength": 4000,
            "type": "string"
          },
          "sitemap_exclude": {
            "description": "The parts the sitemap leaves out.",
            "items": {
              "enum": [
                "products",
                "collections",
                "categories",
                "pages",
                "blog",
                "legal"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "sitemap_no_images": {
            "description": "Leave the pictures out of the sitemap.",
            "type": "boolean"
          }
        },
        "required": [
          "hide_from_search",
          "block_ai_crawlers",
          "robots_extra",
          "sitemap_exclude",
          "sitemap_no_images"
        ],
        "type": "object"
      },
      "StoreCredit": {
        "properties": {
          "balances": {
            "items": {
              "$ref": "#/components/schemas/Money"
            },
            "type": "array"
          }
        },
        "required": [
          "balances"
        ],
        "type": "object"
      },
      "StoreCurrency": {
        "properties": {
          "auto_prices": {
            "description": "Variants priced in this currency by the rate.",
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "exponent": {
            "type": "integer"
          },
          "fixed_rate": {
            "description": "A rate the merchant fixed by hand (units of this currency for one unit of the base): automatic prices follow it instead of the daily rate. Null: the daily rate.",
            "type": [
              "number",
              "null"
            ]
          },
          "hand_prices": {
            "description": "Variants priced in this currency by hand.",
            "type": "integer"
          },
          "last_error": {
            "description": "Why the last run failed for this currency.",
            "type": "string"
          },
          "markets": {
            "description": "The markets selling in it.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "markup_percent": {
            "description": "Added on top of the rate (5 = 5 %; negative is a discount).",
            "type": "number"
          },
          "mode": {
            "enum": [
              "manual",
              "auto"
            ],
            "type": "string"
          },
          "prices_changed": {
            "description": "Prices the last automatic run changed.",
            "type": "integer"
          },
          "prices_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "rate": {
            "description": "Units of this currency for one unit of the base currency, as last fetched.",
            "type": [
              "number",
              "null"
            ]
          },
          "rate_date": {
            "format": "date",
            "type": "string"
          },
          "rate_fetched_at": {
            "format": "date-time",
            "type": "string"
          },
          "rate_source": {
            "type": "string"
          },
          "rounding": {
            "description": "none: to the minor unit; 99/90: up to the next whole unit less 0.01/0.10; whole: to the nearest whole unit.",
            "enum": [
              "none",
              "99",
              "90",
              "whole"
            ],
            "type": "string"
          },
          "variants": {
            "description": "The catalogue's variants.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StoreCurrencyInput": {
        "properties": {
          "fixed_rate": {
            "description": "Fixes the rate by hand; null or absent follows the daily rate.",
            "maximum": 1000000000,
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "markup_percent": {
            "maximum": 500,
            "minimum": -50,
            "type": "number"
          },
          "mode": {
            "enum": [
              "manual",
              "auto"
            ],
            "type": "string"
          },
          "rounding": {
            "enum": [
              "none",
              "99",
              "90",
              "whole"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreDomain": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dns_records": {
            "items": {
              "$ref": "#/components/schemas/DNSRecord"
            },
            "type": "array"
          },
          "host": {
            "type": "string"
          },
          "is_primary": {
            "type": "boolean"
          },
          "last_checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "platform_subdomain": {
            "description": "The store's platform address (\u003cslug\u003e.\u003cplatform domain\u003e), made at provisioning; it cannot be removed.",
            "type": "boolean"
          },
          "provider": {
            "description": "The edge holding the host (manual, cloudflare or bunny); empty without an edge.",
            "type": "string"
          },
          "ssl_status": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "dns_pending",
              "ssl_pending",
              "cf_pending",
              "active",
              "failing",
              "removing"
            ],
            "type": "string"
          },
          "status_detail": {
            "description": "The last lifecycle check's words.",
            "type": "string"
          },
          "verified_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "host",
          "is_primary",
          "status",
          "created_at",
          "dns_records",
          "platform_subdomain"
        ],
        "type": "object"
      },
      "StoreDomainInfo": {
        "properties": {
          "canonical_url": {
            "type": "string"
          },
          "primary_host": {
            "type": "string"
          },
          "redirect": {
            "enum": [
              "none",
              "www_to_apex",
              "apex_to_www"
            ],
            "type": "string"
          }
        },
        "required": [
          "primary_host",
          "canonical_url",
          "redirect"
        ],
        "type": "object"
      },
      "StoreIdentity": {
        "properties": {
          "announcement": {
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "href": {
                "type": "string"
              },
              "text": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Text per language (tr, en, de).",
                "type": "object"
              }
            },
            "type": "object"
          },
          "contact": {
            "properties": {
              "email": {
                "type": "string"
              },
              "hours": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Working hours per language (ADR-0062).",
                "type": "object"
              },
              "phone": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "delivery_text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "footer_text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "free_shipping": {
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "installment_text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "payment_icons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "presence": {
            "$ref": "#/components/schemas/StorePresence",
            "description": "The store's own social links and payment marks (store_presence, ADR-0062 §3), served beside the identity; the identity's social and payment_icons are the theme settings' copy the storefront falls back to."
          },
          "social": {
            "items": {
              "$ref": "#/components/schemas/ThemeSocialLink"
            },
            "type": "array"
          },
          "trust_badges": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "whatsapp": {
            "type": "string"
          },
          "whatsapp_message": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "StoreKindInput": {
        "properties": {
          "kind": {
            "enum": [
              "",
              "physical",
              "digital",
              "both",
              "services"
            ],
            "type": "string"
          },
          "overrides": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "The merchant's own choice per surface; one equal to the kind's default is dropped.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "StoreKindState": {
        "properties": {
          "defaults": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "kind": {
            "description": "\"\" not said yet (reads as physical).",
            "enum": [
              "",
              "physical",
              "digital",
              "both",
              "services"
            ],
            "type": "string"
          },
          "kinds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "overrides": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "surface_names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "surfaces": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "order_tracking, shipping_settings, shipping_texts: shown (true) or hidden.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "StoreLabel": {
        "description": "A merchant's label on a product, in the request's language (ADR-0074).",
        "properties": {
          "color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "text_color": {
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          }
        },
        "required": [
          "id",
          "text",
          "color",
          "text_color"
        ],
        "type": "object"
      },
      "StoreLegalPage": {
        "description": "A legal text as the legal module renders it, presented by the content service with the store's introduction page for that kind (slug legal-\u003ckind\u003e) when one is published.",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/RenderedLegalDocument"
          },
          "intro": {
            "$ref": "#/components/schemas/StoreContentPage"
          },
          "kind": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreMarket": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Market"
          },
          {
            "properties": {
              "duties_mode": {
                "description": "How the market prices a parcel that crosses a customs border (ADR-0123): ddp — duties and import taxes included (a product page says so); dap — they may be charged on delivery; off.",
                "enum": [
                  "off",
                  "dap",
                  "ddp"
                ],
                "type": "string"
              },
              "geo_detect": {
                "description": "The store's setting, repeated per market: whether the shopper's country picks the market. Off, a storefront starts every shopper in the default market.",
                "type": "boolean"
              },
              "origin_country": {
                "description": "Where the store's parcels leave from (ISO 3166-1 alpha-2): a destination elsewhere, outside a shared customs territory, crosses a border.",
                "type": "string"
              },
              "prices_include_tax": {
                "description": "Whether prices contain tax — the store's setting, which the checkout prices every market with; repeated per market so a storefront can label prices without another read.",
                "type": "boolean"
              },
              "ship_countries": {
                "description": "The countries the market's checkout offers: where the store's shipping zones deliver, limited by the market's own countries when it lists some. Empty: no limit known (a catch-all zone or none), use countries.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "tax_free": {
                "description": "True when the store has no active tax rate above zero, so no basket can carry tax; a storefront then prints no tax note.",
                "type": "boolean"
              }
            },
            "type": "object"
          }
        ],
        "description": "A market as the storefront reads it: the code to send as X-Market, the currency the market's baskets charge in, the countries it serves (empty: the rest of the world) and the languages it speaks, first the market's main one.",
        "properties": {
          "deliver_countries": {
            "description": "Where a shopper of this market may send the parcel: every country a shipping zone reaches with an active rate in the market's currency, whatever market the country belongs to. Empty with deliver_everywhere.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deliver_everywhere": {
            "description": "No destination limit: the store set no rate at all, or a catch-all zone has a rate in this currency.",
            "type": "boolean"
          }
        }
      },
      "StoreMenu": {
        "properties": {
          "handle": {
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ThemeMenuItem"
            },
            "type": "array"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "StoreMenuDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StoreMenuSummary"
          },
          {
            "properties": {
              "draft_differs": {
                "description": "main/footer: the theme draft holds other, unpublished links; saving here replaces them.",
                "type": "boolean"
              },
              "links": {
                "items": {
                  "$ref": "#/components/schemas/ThemeMenuItem"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ]
      },
      "StoreMenuInput": {
        "properties": {
          "handle": {
            "description": "Create only; made from the name when absent.",
            "type": "string"
          },
          "links": {
            "description": "Three levels at most, 50 per level, 250 in all.",
            "items": {
              "$ref": "#/components/schemas/ThemeMenuItem"
            },
            "type": "array"
          },
          "name": {
            "maxLength": 80,
            "type": "string"
          },
          "position": {
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StoreMenuSummary": {
        "properties": {
          "builtin": {
            "description": "main or footer: the theme's own, never deleted.",
            "type": "boolean"
          },
          "handle": {
            "type": "string"
          },
          "items": {
            "description": "Links at every level.",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreOverview": {
        "properties": {
          "channels": {
            "items": {
              "properties": {
                "medium": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "sessions": {
                  "type": "integer"
                },
                "source": {
                  "type": "string"
                }
              },
              "required": [
                "source",
                "medium",
                "sessions",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "countries": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "customers": {
            "properties": {
              "buckets": {
                "items": {
                  "properties": {
                    "customers": {
                      "type": "integer"
                    },
                    "members": {
                      "type": "integer"
                    },
                    "start": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "required": [
                    "start",
                    "customers",
                    "members"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "members": {
                "type": "integer"
              },
              "new": {
                "type": "integer"
              },
              "prev_members": {
                "type": "integer"
              },
              "prev_new": {
                "type": "integer"
              }
            },
            "required": [
              "new",
              "prev_new",
              "members",
              "prev_members",
              "buckets"
            ],
            "type": "object"
          },
          "days": {
            "type": "integer"
          },
          "devices": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "grain": {
            "enum": [
              "hour",
              "day"
            ],
            "type": "string"
          },
          "hours": {
            "description": "24 slots, 0–23: visits begun and sales placed, in the store's clock.",
            "items": {
              "properties": {
                "orders": {
                  "type": "integer"
                },
                "sessions": {
                  "type": "integer"
                },
                "slot": {
                  "type": "integer"
                }
              },
              "required": [
                "slot",
                "sessions",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pages": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "payments": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "total": {
                  "$ref": "#/components/schemas/Money"
                }
              },
              "required": [
                "currency",
                "code",
                "name",
                "orders",
                "total"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "prev_from": {
            "format": "date-time",
            "type": "string"
          },
          "prev_to": {
            "format": "date-time",
            "type": "string"
          },
          "sales": {
            "description": "One block per currency, the store's own first.",
            "items": {
              "$ref": "#/components/schemas/OverviewSales"
            },
            "type": "array"
          },
          "statuses": {
            "description": "Every order placed in the period (the trash left out), by status.",
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "time_zone": {
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "top_products": {
            "items": {
              "properties": {
                "image_url": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "product_id": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "revenue": {
                  "$ref": "#/components/schemas/Money"
                },
                "sku": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "units": {
                  "type": "integer"
                }
              },
              "required": [
                "product_id",
                "title",
                "sku",
                "units",
                "orders",
                "revenue"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "viewed_products": {
            "items": {
              "properties": {
                "image_url": {
                  "type": "string"
                },
                "product_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "title": {
                  "type": "string"
                },
                "views": {
                  "type": "integer"
                }
              },
              "required": [
                "product_id",
                "title",
                "views"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "visits": {
            "properties": {
              "converted": {
                "type": "integer"
              },
              "pageviews": {
                "type": "integer"
              },
              "prev_converted": {
                "type": "integer"
              },
              "prev_pageviews": {
                "type": "integer"
              },
              "prev_sessions": {
                "type": "integer"
              },
              "prev_visitors": {
                "type": "integer"
              },
              "sessions": {
                "type": "integer"
              },
              "visitors": {
                "type": "integer"
              }
            },
            "required": [
              "visitors",
              "prev_visitors",
              "sessions",
              "prev_sessions",
              "converted",
              "prev_converted",
              "pageviews",
              "prev_pageviews"
            ],
            "type": "object"
          },
          "weekdays": {
            "description": "7 slots, 1 = Monday.",
            "items": {
              "properties": {
                "orders": {
                  "type": "integer"
                },
                "sessions": {
                  "type": "integer"
                },
                "slot": {
                  "type": "integer"
                }
              },
              "required": [
                "slot",
                "sessions",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "days",
          "time_zone",
          "grain",
          "from",
          "to",
          "prev_from",
          "prev_to",
          "sales",
          "visits",
          "customers",
          "statuses",
          "hours",
          "weekdays",
          "payments",
          "top_products",
          "viewed_products",
          "pages",
          "countries",
          "devices",
          "channels"
        ],
        "type": "object"
      },
      "StorePopup": {
        "properties": {
          "document": {
            "$ref": "#/components/schemas/PageDocument"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "marketing": {
            "description": "It asks for a marketing permission (a newsletter, a form's permission box): it waits for the visitor's marketing consent.",
            "type": "boolean"
          },
          "rules": {
            "$ref": "#/components/schemas/PopupRules"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "title",
          "rules",
          "marketing",
          "document"
        ],
        "type": "object"
      },
      "StorePresence": {
        "properties": {
          "payment_badges": {
            "description": "The owner's list once saved, else the marks of the switched-on payment methods.",
            "items": {
              "$ref": "#/components/schemas/PaymentBadge"
            },
            "type": "array"
          },
          "payment_badges_chosen": {
            "type": "boolean"
          },
          "social": {
            "items": {
              "$ref": "#/components/schemas/SocialLink"
            },
            "type": "array"
          }
        },
        "required": [
          "social",
          "payment_badges",
          "payment_badges_chosen"
        ],
        "type": "object"
      },
      "StorePresenceInput": {
        "properties": {
          "payment_badges": {
            "description": "null: follow the switched-on payment methods.",
            "items": {
              "$ref": "#/components/schemas/PaymentBadge"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "social": {
            "items": {
              "properties": {
                "contact": {
                  "description": "Default true.",
                  "type": "boolean"
                },
                "footer": {
                  "description": "Default true.",
                  "type": "boolean"
                },
                "header": {
                  "description": "Default false.",
                  "type": "boolean"
                },
                "label": {
                  "maxLength": 40,
                  "type": "string"
                },
                "network": {
                  "type": "string"
                },
                "value": {
                  "description": "A handle (@nerocart), a phone number (WhatsApp) or a URL; empty means not used.",
                  "type": "string"
                }
              },
              "required": [
                "network",
                "value"
              ],
              "type": "object"
            },
            "maxItems": 16,
            "type": "array"
          }
        },
        "type": "object"
      },
      "StorePresenceSettings": {
        "properties": {
          "badges": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "networks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "payment_badges": {
            "description": "The owner's saved list; null while it follows the payment methods.",
            "items": {
              "$ref": "#/components/schemas/PaymentBadge"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "social": {
            "items": {
              "$ref": "#/components/schemas/SocialLink"
            },
            "type": "array"
          },
          "suggested_payment_badges": {
            "items": {
              "$ref": "#/components/schemas/PaymentBadge"
            },
            "type": "array"
          }
        },
        "required": [
          "social",
          "payment_badges",
          "suggested_payment_badges",
          "networks",
          "badges"
        ],
        "type": "object"
      },
      "StoreProductRelations": {
        "properties": {
          "bought_together": {
            "description": "What shoppers bought in the same order over the last year, most often first (at most eight); worked out from the orders, not picked.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cross_sell": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "related": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "related",
          "cross_sell",
          "bought_together"
        ],
        "type": "object"
      },
      "StorePush": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "public_key": {
            "type": "string"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "StoreRedirect": {
        "properties": {
          "from": {
            "description": "Path after the locale prefix.",
            "type": "string"
          },
          "language": {
            "description": "'' applies to every language.",
            "type": "string"
          },
          "status": {
            "enum": [
              301,
              302,
              308
            ],
            "type": "integer"
          },
          "to": {
            "description": "Store path (the visitor's locale is put in front) or an https URL.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreRef": {
        "properties": {
          "currency": {
            "description": "The store's base currency.",
            "type": "string"
          },
          "current": {
            "description": "The store this request acted on.",
            "type": "boolean"
          },
          "default_language": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "currency",
          "default_language",
          "current"
        ],
        "type": "object"
      },
      "StoreReview": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicReview"
          },
          {
            "properties": {
              "product": {
                "$ref": "#/components/schemas/ReviewProduct"
              }
            },
            "required": [
              "product"
            ],
            "type": "object"
          }
        ],
        "description": "An approved review on the store-wide list, with its product in the request's language; the text is cut at 400 characters."
      },
      "StoreSettings": {
        "description": "What this store is configured as. A hand-written whitelist over the engine's configuration rather than a dump of it: the configuration also holds the database URL and the admin tokens, so a field appears here because somebody decided it should.",
        "properties": {
          "cart_ttl_seconds": {
            "description": "How long an untouched cart survives before the sweeper deletes it, in seconds.",
            "example": 2592000,
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "description": "The store's single settlement currency, as an ISO 4217 code.",
            "example": "USD",
            "type": "string"
          },
          "default_language": {
            "description": "The BCP 47 tag used when a request expresses no preference.",
            "example": "en",
            "type": "string"
          },
          "flat_shipping": {
            "$ref": "#/components/schemas/Money",
            "description": "Added to every order. It is the whole of the built-in shipping calculation; a rate engine is a module's job."
          },
          "fulfillment_providers": {
            "description": "The shipping backends this binary was composed with, sorted by code.",
            "items": {
              "$ref": "#/components/schemas/ProviderInfo"
            },
            "type": "array"
          },
          "hidden_languages": {
            "description": "Languages of languages the storefront does not offer shoppers yet: operators translate and preview them; the storefront's language list, switcher, hreflang and negotiation leave them out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "languages": {
            "description": "Every tag this store serves. The default language is always one of them. Empty is impossible, and it is an array rather than null so a client can iterate it without a guard.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "market_geo_detect": {
            "description": "Whether the shopper's country (the edge's country header) picks the market and so the currency. On by default; off, every shopper starts in the default market unless the storefront names another.",
            "type": "boolean"
          },
          "media_uploads_enabled": {
            "description": "False when this store has nowhere to put files. The media library still records files by URL, so a client should say why the upload button is missing rather than hide the library.",
            "type": "boolean"
          },
          "modules": {
            "description": "The modules this binary was composed with, named, in the order they were passed to New — the order their migrations ran in. Names and nothing else: a client's question is \"was this binary built with cms\", and anything richer would describe the running process rather than the store's configuration. Empty in a binary built with no modules.",
            "example": [
              "cms",
              "invoices"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notifier_channels": {
            "description": "Every notification channel the engine has, whether or not anything is behind it — a channel with no backend still appears, because \"sms is not configured\" is an answer and a missing row is not. Read `delivers` before anything else: with no vendor module installed the engine's built-in logger writes the message to the process log and reports success, so sending appears to work and nobody receives anything.",
            "items": {
              "$ref": "#/components/schemas/NotifierChannelInfo"
            },
            "type": "array"
          },
          "order_prefix": {
            "description": "Prefixes human order numbers.",
            "example": "GC-",
            "type": "string"
          },
          "order_ttl_seconds": {
            "description": "How long an unpaid order holds its inventory reservation before it is cancelled and the stock released, in seconds.",
            "example": 86400,
            "format": "int64",
            "type": "integer"
          },
          "payment_methods": {
            "description": "The payment methods this binary was composed with, sorted by code.",
            "items": {
              "$ref": "#/components/schemas/ProviderInfo"
            },
            "type": "array"
          },
          "price_always_decimals": {
            "description": "Whether every price shows its decimals (\"49,00 ₺\"). Off by default: a whole amount drops them (\"49 ₺\"), an amount with a fraction keeps them.",
            "type": "boolean"
          },
          "prices_include_tax": {
            "description": "True when every catalog price is gross — the tax is already inside the figure — rather than net with tax added at checkout. It is snapshotted onto each order as it is placed, so changing it never rewrites what last month's orders were saying.",
            "type": "boolean"
          },
          "sale_badge": {
            "description": "A \"%15\" badge beside a discounted price, or none (0242).",
            "enum": [
              "percent",
              "none"
            ],
            "type": "string"
          },
          "sale_old_price": {
            "description": "How a discount's old price shows: struck through beside the new one, or hidden (0242).",
            "enum": [
              "strike",
              "hidden"
            ],
            "type": "string"
          },
          "sale_old_side": {
            "description": "The old price after the new one (right) or before it (left) (0242).",
            "enum": [
              "right",
              "left"
            ],
            "type": "string"
          },
          "shipping_tax": {
            "description": "How shipping is taxed: not at all, or at the highest rate among the order's lines.",
            "enum": [
              "none",
              "highest_line_rate"
            ],
            "type": "string"
          },
          "version": {
            "description": "The engine version this store is running.",
            "example": "0.0.0-m0",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreSite": {
        "properties": {
          "addons": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "The storefront add-ons switched on (Ayarlar › Vitrin eklentileri, the share buttons, the WhatsApp button), by plugin key, each with its public settings; an add-on switched off is not in it. The tracking codes and chat widgets go through the cookie consent instead.",
            "type": "object"
          },
          "address_assist": {
            "$ref": "#/components/schemas/AddressAssistState"
          },
          "assistant": {
            "description": "The shopping assistant while the store has switched it on and its own AI key is set up (ADR-0122): the merchant's greetings by language. null otherwise: no chat button.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreSiteAssistant"
              },
              {
                "type": "null"
              }
            ]
          },
          "canonical_url": {
            "description": "https://\u003cprimary_host\u003e, the origin canonical links use; empty without a primary host.",
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/StoreSiteContact"
          },
          "crawl": {
            "$ref": "#/components/schemas/StoreCrawl",
            "description": "What the store tells search engines (0174): the storefront's robots.txt, sitemap and noindex follow it."
          },
          "default_language": {
            "type": "string"
          },
          "demo": {
            "description": "Set for a theme's demo store (ADR-0072), null for every real store.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/StoreSiteDemo"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "description": "The store's public contact address (store profile).",
            "type": "string"
          },
          "features": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "The engine's public feature flags resolved for this store, defaults filled in (storefront.data_cache, domains.redirect). Each defaults to true; false switches the runtime to its older path.",
            "type": "object"
          },
          "host": {
            "description": "The host the request was resolved by (lower case, no port).",
            "type": "string"
          },
          "hosts": {
            "description": "Every host serving the store (active or failing), primary first.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "indexnow_key": {
            "description": "The store's IndexNow key while its IndexNow plugin is on (ADR-0050); empty otherwise. The storefront answers /{key}.txt with it. Public by protocol.",
            "pattern": "^([a-f0-9]{32})?$",
            "type": "string"
          },
          "languages": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "open": {
            "description": "False while the account is suspended or closing.",
            "type": "boolean"
          },
          "presence": {
            "$ref": "#/components/schemas/StorePresence"
          },
          "price_always_decimals": {
            "description": "The store's choice to show every price with its decimals (\"49,00 ₺\"); false, the default, a whole amount drops them (\"49 ₺\") and an amount with a fraction keeps them.",
            "type": "boolean"
          },
          "primary_host": {
            "description": "The store's primary host; empty when none is set.",
            "type": "string"
          },
          "redirect": {
            "description": "The www/apex redirect policy.",
            "type": "string"
          },
          "sale": {
            "$ref": "#/components/schemas/StoreSiteSale",
            "description": "How the store shows a discount (0242)."
          },
          "status": {
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "store_kind": {
            "description": "What the store sells (ADR-0071); \"\" not said (physical).",
            "enum": [
              "",
              "physical",
              "digital",
              "both",
              "services"
            ],
            "type": "string"
          },
          "surfaces": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "What the store kind shows on the storefront, with the merchant's own choices: order_tracking, shipping_settings, shipping_texts.",
            "type": "object"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "theme_version": {
            "description": "The published theme version (0: none). Part of every storefront cache key.",
            "type": "integer"
          },
          "turnstile_site_key": {
            "description": "The Cloudflare Turnstile widget the storefront renders in its public forms on this host (ADR-0096): the platform's site key on a NeroCart host, the store's own on its own domain, empty when none applies (no widget, no script). Public by design; the secret never leaves the kernel.",
            "type": "string"
          },
          "verification": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Site-ownership tokens the storefront renders as meta tags in every page's head: `google` is the content of google-site-verification, from the enabled Search Console plugin (ADR-0046); `bing` of msvalidate.01 and `yandex` of yandex-verification, from the enabled Bing and Yandex Webmaster plugins (ADR-0050); `baidu`, `naver`, `seznam`, `facebook`, `pinterest`, `tiktok`, `norton` and `ahrefs` of their providers' tags, and `etbis` the store's ETBİS code the footer links to (Ayarlar › Site doğrulama). Public by nature; never a credential.",
            "type": "object"
          },
          "wholesale": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StoreSiteWholesale"
              }
            ],
            "description": "The store's wholesale choices (ADR-0091); null for a store that made none."
          },
          "withdrawal_days": {
            "type": "integer"
          }
        },
        "required": [
          "tenant_id",
          "store_id",
          "host",
          "primary_host",
          "canonical_url",
          "hosts",
          "redirect",
          "name",
          "email",
          "crawl",
          "default_language",
          "languages",
          "theme_version",
          "withdrawal_days",
          "open",
          "status",
          "features",
          "verification",
          "indexnow_key",
          "address_assist",
          "contact",
          "presence",
          "store_kind",
          "surfaces",
          "demo",
          "wholesale",
          "turnstile_site_key",
          "assistant",
          "addons",
          "price_always_decimals",
          "sale"
        ],
        "type": "object"
      },
      "StoreSiteAssistant": {
        "properties": {
          "greetings": {
            "additionalProperties": {
              "maxLength": 300,
              "type": "string"
            },
            "description": "The greeting per storefront language (tr, en, de, fr, it, es, nl, da, sv, pl), at most 300 characters each; a language left out uses the storefront's own greeting.",
            "type": "object"
          }
        },
        "required": [
          "greetings"
        ],
        "type": "object"
      },
      "StoreSiteContact": {
        "description": "The store profile's public part (ADR-0062): what its legal texts already print.",
        "properties": {
          "address_line1": {
            "type": "string"
          },
          "address_line2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "legal_name",
          "email",
          "phone",
          "address_line1",
          "address_line2",
          "city",
          "state",
          "postal_code",
          "country"
        ],
        "type": "object"
      },
      "StoreSiteDemo": {
        "description": "Present only for a theme's demo store (ADR-0072): the storefront shows the demo bar on every page, keeps the store out of search engines (noindex, robots.txt Disallow, no sitemap) and tells a shopper at the checkout that nothing can be ordered (the engine answers 409 demo_store).",
        "properties": {
          "platform_url": {
            "description": "The platform the demos belong to (https://nerocart.com), for the demo bar's way back; empty when the deployment named no demo or platform domain.",
            "type": "string"
          },
          "sector": {
            "description": "The trade the demo shows; its slug is the host's first label (\u003cslug\u003e-demo).",
            "properties": {
              "name": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "The sector's name by language (tr, en, de).",
                "type": "object"
              },
              "slug": {
                "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
                "type": "string"
              }
            },
            "required": [
              "slug",
              "name"
            ],
            "type": "object"
          },
          "theme": {
            "description": "The theme whose demo store this is.",
            "type": "string"
          }
        },
        "required": [
          "theme",
          "sector",
          "platform_url"
        ],
        "type": "object"
      },
      "StoreSiteSale": {
        "properties": {
          "badge": {
            "enum": [
              "percent",
              "none"
            ],
            "type": "string"
          },
          "old_price": {
            "enum": [
              "strike",
              "hidden"
            ],
            "type": "string"
          },
          "old_side": {
            "enum": [
              "right",
              "left"
            ],
            "type": "string"
          }
        },
        "required": [
          "old_price",
          "badge",
          "old_side"
        ],
        "type": "object"
      },
      "StoreSiteWholesale": {
        "description": "The store's wholesale choices as the storefront needs them; absent from the site for a store that made none (ADR-0091).",
        "properties": {
          "applications_open": {
            "type": "boolean"
          },
          "demo_dealer": {
            "description": "A theme demo store's published dealer sign-in (its pack's demo_dealer, ADR-0091 §5); never set for a real store.",
            "properties": {
              "email": {
                "type": "string"
              },
              "password": {
                "type": "string"
              }
            },
            "required": [
              "email",
              "password"
            ],
            "type": "object"
          },
          "price_visibility": {
            "enum": [
              "everyone",
              "dealers"
            ],
            "type": "string"
          },
          "quotes_enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "price_visibility",
          "applications_open",
          "quotes_enabled"
        ],
        "type": "object"
      },
      "StoreSizeGuide": {
        "description": "A size guide in the request's language (else the store's default language, else the first that has a text).",
        "properties": {
          "columns": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "rows": {
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "columns",
          "rows",
          "note"
        ],
        "type": "object"
      },
      "StoreStatus": {
        "properties": {
          "open": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "open",
          "status"
        ],
        "type": "object"
      },
      "StoreTestMode": {
        "properties": {
          "hidden": {
            "description": "The live methods it hides.",
            "items": {
              "$ref": "#/components/schemas/TestModeMethod"
            },
            "type": "array"
          },
          "offered": {
            "description": "What the checkout offers while test mode is on.",
            "items": {
              "$ref": "#/components/schemas/TestModeMethod"
            },
            "type": "array"
          },
          "on": {
            "type": "boolean"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_by": {
            "type": "string"
          },
          "test_orders": {
            "type": "integer"
          },
          "until": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "on",
          "test_orders",
          "offered",
          "hidden"
        ],
        "type": "object"
      },
      "StoreTheme": {
        "properties": {
          "groups": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeGroup"
            },
            "description": "The theme's section groups (header, footer, overlay), resolved for this store (theme engine 2.0.0, ADR-0061).",
            "type": "object"
          },
          "menus": {
            "additionalProperties": {
              "$ref": "#/components/schemas/StoreMenu"
            },
            "description": "The store's own named menus the builders name beyond the theme's (ADR-0071), by handle.",
            "type": "object"
          },
          "preview": {
            "type": "boolean"
          },
          "settings": {
            "$ref": "#/components/schemas/ThemeSettings"
          },
          "share": {
            "description": "Read through a share link of the theme draft (ADR-0102, \"Arkadaşına Göster\"): the storefront marks every page as a draft preview and keeps the link on the visitor's way through the store.",
            "type": "boolean"
          },
          "theme_id": {
            "description": "The theme package these settings configure.",
            "type": "string"
          },
          "theme_version": {
            "type": "string"
          },
          "version": {
            "description": "0 when the store has published no theme.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StoreThemeTemplate": {
        "properties": {
          "groups": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeGroup"
            },
            "type": "object"
          },
          "name": {
            "description": "The template asked for.",
            "type": "string"
          },
          "preview": {
            "type": "boolean"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          },
          "template": {
            "description": "The template that answered it.",
            "type": "string"
          },
          "theme_id": {
            "type": "string"
          },
          "theme_version": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Story": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "link_label": {
            "type": "string"
          },
          "link_url": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "title": {
            "maxLength": 40,
            "type": "string"
          },
          "video_url": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "image_url"
        ],
        "type": "object"
      },
      "Superuser": {
        "description": "An admin-panel operator: one user's membership of this tenant (M8). The same person (user_id) may hold memberships in several tenants. Note what is absent: no password hash and no second-factor secret is ever serialized.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mfa_enabled": {
            "description": "Whether the user has a second factor (TOTP).",
            "type": "boolean"
          },
          "mfa_required": {
            "description": "Whether this member must use a second factor — by their membership's policy or their role's. Until they enroll one, a session reaches only /api/admin/me, the MFA routes, refresh and logout.",
            "type": "boolean"
          },
          "rights": {
            "description": "What this operator may do, resolved through the store's role matrix. The panel hides what it cannot do from this rather than from a copy of the table.",
            "items": {
              "enum": [
                "catalog.read",
                "catalog.write",
                "inventory.read",
                "inventory.write",
                "discounts.read",
                "discounts.write",
                "taxes.read",
                "taxes.write",
                "locations.read",
                "locations.write",
                "orders.read",
                "orders.write",
                "orders.fulfill",
                "orders.refund",
                "customers.read",
                "team.read",
                "team.write",
                "roles.write",
                "data.export",
                "data.import",
                "store.operate",
                "shipping.read",
                "shipping.write",
                "channels.read",
                "channels.write",
                "plugins.read",
                "plugins.write",
                "notifications.read",
                "notifications.write",
                "collections.read",
                "collections.write",
                "categories.read",
                "categories.write",
                "media.read",
                "media.write",
                "pricing.read",
                "pricing.write",
                "groups.read",
                "groups.write",
                "reports.read",
                "carts.read",
                "payouts.read",
                "store.write",
                "apikeys.read",
                "apikeys.write",
                "reports.write",
                "vendors.read",
                "vendors.write",
                "customers.write",
                "content.read",
                "content.write",
                "content.review",
                "content.publish",
                "theme.read",
                "theme.write",
                "theme.publish",
                "contact.read",
                "contact.write",
                "review.read",
                "review.write",
                "media.delete"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "role": {
            "description": "The role this membership holds: one of the engine's (owner, manager, staff, vendor) or one this store defined.",
            "type": "string"
          },
          "status": {
            "description": "A suspended membership keeps its history and authenticates nothing.",
            "enum": [
              "active",
              "suspended"
            ],
            "type": "string"
          },
          "store_ids": {
            "description": "The stores this membership may act on; empty means every store of the tenant. A request naming another store (X-Store-Id) is refused with 403; one naming none acts on the first of these.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "user_id": {
            "description": "The person behind the membership; the same in every tenant they belong to.",
            "format": "int64",
            "type": "integer"
          },
          "vendor_id": {
            "description": "The seller this account belongs to. Present only on accounts with the `vendor` role, and required on all of them — the two are set together or neither is.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SuperuserRow": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Superuser"
          },
          {
            "properties": {
              "newest_session": {
                "description": "When the newest live session started — not a last sign-in. Expired sessions are deleted, so null means nobody is signed in now, never that they have never signed in.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "sessions": {
                "description": "Live sessions this operator holds right now.",
                "type": "integer"
              }
            },
            "type": "object"
          }
        ],
        "description": "One operator as the team listing needs them: the record, plus what only a listing asks."
      },
      "SupplyAddress": {
        "properties": {
          "city": {
            "description": "İl.",
            "type": "string"
          },
          "country": {
            "description": "ISO 3166-1 alpha-2; TR when omitted.",
            "type": "string"
          },
          "district": {
            "description": "İlçe.",
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyApplicationDocument": {
        "description": "A private application document (G-07); its bytes only through the download routes.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "mime": {
            "enum": [
              "application/pdf",
              "image/jpeg",
              "image/png",
              "image/webp"
            ],
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "filename",
          "mime",
          "size_bytes",
          "created_at"
        ],
        "type": "object"
      },
      "SupplyAttributes": {
        "properties": {
          "options": {
            "items": {
              "$ref": "#/components/schemas/SupplyNameValue"
            },
            "type": "array"
          },
          "origin_country": {
            "type": "string"
          },
          "product_type": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "weight_grams": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SupplyBalance": {
        "description": "One counterparty's line of a statement, in one currency; amounts are what is owed (positive: the seller owes the supplier).",
        "properties": {
          "cancellations_minor": {
            "format": "int64",
            "type": "integer"
          },
          "closing_minor": {
            "format": "int64",
            "type": "integer"
          },
          "counterparty_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "disputed_count": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "opening_minor": {
            "format": "int64",
            "type": "integer"
          },
          "orders_minor": {
            "format": "int64",
            "type": "integer"
          },
          "payments_minor": {
            "format": "int64",
            "type": "integer"
          },
          "pending_count": {
            "type": "integer"
          },
          "pending_minor": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "open",
              "awaiting_confirmation",
              "disputed",
              "settled",
              "overpaid"
            ],
            "type": "string"
          }
        },
        "required": [
          "counterparty_tenant_id",
          "name",
          "currency",
          "opening_minor",
          "orders_minor",
          "cancellations_minor",
          "payments_minor",
          "closing_minor",
          "pending_minor",
          "pending_count",
          "disputed_count",
          "status"
        ],
        "type": "object"
      },
      "SupplyBreakdown": {
        "description": "The price breakdown (minor units, half-up per component): payout − kdv_payable = net_margin.",
        "properties": {
          "cargo_gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "cargo_kdv_minor": {
            "format": "int64",
            "type": "integer"
          },
          "cargo_net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "commission_gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "commission_kdv_minor": {
            "format": "int64",
            "type": "integer"
          },
          "commission_net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "input_kdv_minor": {
            "format": "int64",
            "type": "integer"
          },
          "kdv_payable_minor": {
            "format": "int64",
            "type": "integer"
          },
          "net_margin_bp": {
            "format": "int64",
            "type": "integer"
          },
          "net_margin_minor": {
            "format": "int64",
            "type": "integer"
          },
          "output_kdv_minor": {
            "format": "int64",
            "type": "integer"
          },
          "payout_minor": {
            "format": "int64",
            "type": "integer"
          },
          "pos_fee_minor": {
            "format": "int64",
            "type": "integer"
          },
          "retail_gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "retail_net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_kdv_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_net_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "retail_gross_minor",
          "retail_net_minor",
          "net_margin_minor",
          "payout_minor",
          "kdv_payable_minor"
        ],
        "type": "object"
      },
      "SupplyCatalogCard": {
        "description": "A network catalogue entry as \"Keşfet\" shows it: supplier price, the store rule's price and the net margin there.",
        "properties": {
          "attributes": {
            "$ref": "#/components/schemas/SupplyAttributes"
          },
          "availability": {
            "description": "Availability bucket — never the exact stock.",
            "enum": [
              "0",
              "1-4",
              "5+",
              "backorder"
            ],
            "type": "string"
          },
          "barcode": {
            "type": "string"
          },
          "break_even_minor": {
            "format": "int64",
            "type": "integer"
          },
          "category_path": {
            "type": "string"
          },
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "cost_notice_days": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "floor_reason": {
            "enum": [
              "loss",
              "low_margin"
            ],
            "type": "string"
          },
          "floored": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "in_store_link_id": {
            "format": "int64",
            "type": "integer"
          },
          "lead_time_days": {
            "type": "integer"
          },
          "media": {
            "items": {
              "$ref": "#/components/schemas/SupplyMediaRef"
            },
            "type": "array"
          },
          "min_order_qty": {
            "type": "integer"
          },
          "net_margin_bp": {
            "format": "int64",
            "type": "integer"
          },
          "net_margin_minor": {
            "format": "int64",
            "type": "integer"
          },
          "network_category": {
            "type": "string"
          },
          "offer_id": {
            "format": "int64",
            "type": "integer"
          },
          "offer_version": {
            "type": "integer"
          },
          "priced": {
            "type": "boolean"
          },
          "prices": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPrice"
            },
            "type": "array"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "rrp_minor": {
            "format": "int64",
            "type": "integer"
          },
          "ship_from": {
            "items": {
              "$ref": "#/components/schemas/SupplyShipFrom"
            },
            "type": "array"
          },
          "sku": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "suggested_price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_name": {
            "type": "string"
          },
          "supplier_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "tax_class": {
            "enum": [
              "kdv20",
              "kdv10",
              "kdv1",
              "kdv0"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "supplier_tenant_id",
          "supplier_name",
          "title",
          "media",
          "availability",
          "currency",
          "cost_minor",
          "suggested_price_minor",
          "net_margin_minor",
          "net_margin_bp",
          "warnings",
          "priced"
        ],
        "type": "object"
      },
      "SupplyCategoryMapping": {
        "properties": {
          "category_id": {
            "format": "int64",
            "type": "integer"
          },
          "category_path": {
            "type": "string"
          },
          "network_category": {
            "type": "string"
          }
        },
        "required": [
          "network_category",
          "category_id"
        ],
        "type": "object"
      },
      "SupplyCompany": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "tenant_id",
          "name",
          "count"
        ],
        "type": "object"
      },
      "SupplyGroupLine": {
        "properties": {
          "breakdown": {
            "$ref": "#/components/schemas/SupplyBreakdown"
          },
          "charged_gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "cost_currency": {
            "type": "string"
          },
          "hold_ref": {
            "type": "string"
          },
          "offer_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_line_id": {
            "format": "int64",
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "supplier_sku": {
            "type": "string"
          },
          "tax_class": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "unit_cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "unit_price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "order_line_id",
          "variant_id",
          "offer_id",
          "sku",
          "title",
          "quantity",
          "unit_price_minor",
          "charged_gross_minor",
          "unit_cost_minor",
          "cost_currency",
          "tax_class",
          "hold_ref",
          "breakdown"
        ],
        "type": "object"
      },
      "SupplyLabelToken": {
        "description": "A single-use print link of one supply order's label, valid for two minutes.",
        "properties": {
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "expires_at",
          "url"
        ],
        "type": "object"
      },
      "SupplyLinkBreakdown": {
        "properties": {
          "breakdown": {
            "$ref": "#/components/schemas/SupplyBreakdown"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "suggested": {
            "$ref": "#/components/schemas/SupplySuggestion"
          },
          "terms": {
            "$ref": "#/components/schemas/SupplyTerms"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "price_minor",
          "breakdown",
          "warnings",
          "terms"
        ],
        "type": "object"
      },
      "SupplyMediaRef": {
        "properties": {
          "alt": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyMovement": {
        "description": "One statement row; amount_minor raises (an order) or lowers (a cancellation, a payment) what is owed.",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "balance_minor": {
            "format": "int64",
            "type": "integer"
          },
          "journal_id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "order",
              "cancellation",
              "payment",
              "payment_reversal"
            ],
            "type": "string"
          },
          "memo": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          }
        },
        "required": [
          "journal_id",
          "at",
          "kind",
          "memo",
          "amount_minor",
          "balance_minor"
        ],
        "type": "object"
      },
      "SupplyNameValue": {
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ],
        "type": "object"
      },
      "SupplyNetworkCategory": {
        "description": "A network category, seeded from the product taxonomy the kernel embeds.",
        "properties": {
          "count": {
            "type": "integer"
          },
          "depth": {
            "type": "integer"
          },
          "has_children": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "path",
          "depth",
          "has_children"
        ],
        "type": "object"
      },
      "SupplyOffer": {
        "description": "A supplier's offer for one of its variants (supplier terms, never a consumer price).",
        "properties": {
          "allow_backorder": {
            "type": "boolean"
          },
          "availability": {
            "description": "Availability bucket — never the exact stock.",
            "enum": [
              "0",
              "1-4",
              "5+",
              "backorder"
            ],
            "type": "string"
          },
          "category_path": {
            "type": "string"
          },
          "cost_notice_days": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "current": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPrice"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "lead_time_days": {
            "type": "integer"
          },
          "location_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "min_order_qty": {
            "type": "integer"
          },
          "network_buffer": {
            "type": "integer"
          },
          "network_category": {
            "type": "string"
          },
          "prices": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPrice"
            },
            "type": "array"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "scheduled": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPrice"
            },
            "type": "array"
          },
          "sku": {
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "active",
              "paused",
              "retired"
            ],
            "type": "string"
          },
          "tax_class": {
            "enum": [
              "kdv20",
              "kdv10",
              "kdv1",
              "kdv0"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "variant_id",
          "sku",
          "status",
          "version",
          "prices",
          "current",
          "scheduled",
          "location_ids"
        ],
        "type": "object"
      },
      "SupplyOfferInput": {
        "description": "Creates or edits a variant's offer; a missing field keeps what is there.",
        "properties": {
          "allow_backorder": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "cost_notice_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lead_time_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "location_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "min_order_qty": {
            "type": [
              "integer",
              "null"
            ]
          },
          "network_buffer": {
            "type": [
              "integer",
              "null"
            ]
          },
          "network_category": {
            "type": [
              "string",
              "null"
            ]
          },
          "prices": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPriceInput"
            },
            "type": "array"
          },
          "tax_class": {
            "enum": [
              "kdv20",
              "kdv10",
              "kdv1",
              "kdv0",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SupplyOfferPrice": {
        "description": "One row of an offer's price list: the supplier's price net of KDV, optional recommended retail price.",
        "properties": {
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "effective_from": {
            "format": "date-time",
            "type": "string"
          },
          "effective_to": {
            "format": "date-time",
            "type": "string"
          },
          "rrp_minor": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "currency",
          "cost_minor",
          "effective_from"
        ],
        "type": "object"
      },
      "SupplyOfferPriceInput": {
        "description": "A new price. Without effective_from it applies now — or, for a cost increase on a published offer, after the notice period.",
        "properties": {
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "effective_from": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "effective_to": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "rrp_minor": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "currency",
          "cost_minor"
        ],
        "type": "object"
      },
      "SupplyOfferRow": {
        "description": "One variant on \"Ürünlerim\".",
        "properties": {
          "available": {
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "offer": {
            "$ref": "#/components/schemas/SupplyOffer"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "tracked": {
            "type": "boolean"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "variant_label": {
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "variant_id",
          "title",
          "sku"
        ],
        "type": "object"
      },
      "SupplyOrder": {
        "description": "An order a seller placed for this supplier's network products (Siparişler). No personal data and no retail price.",
        "properties": {
          "accept_by": {
            "format": "date-time",
            "type": "string"
          },
          "accepted_at": {
            "format": "date-time",
            "type": "string"
          },
          "auto_accepted": {
            "type": "boolean"
          },
          "cost_total_minor": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/SupplyOrderLine"
            },
            "type": "array"
          },
          "merchant_order_id": {
            "format": "int64",
            "type": "integer"
          },
          "merchant_order_number": {
            "type": "string"
          },
          "merchant_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "payout": {
            "$ref": "#/components/schemas/SupplyOrderPayout"
          },
          "reason": {
            "type": "string"
          },
          "ship_to": {
            "$ref": "#/components/schemas/SupplyShipToArea"
          },
          "shipping": {
            "$ref": "#/components/schemas/SupplyShipping"
          },
          "status": {
            "enum": [
              "awaiting_acceptance",
              "accepted",
              "rejected",
              "cancelled"
            ],
            "type": "string"
          },
          "store_name": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "merchant_tenant_id",
          "merchant_order_id",
          "merchant_order_number",
          "store_name",
          "status",
          "ship_to",
          "currency",
          "cost_total_minor",
          "auto_accepted",
          "lines",
          "created_at",
          "updated_at",
          "shipping"
        ],
        "type": "object"
      },
      "SupplyOrderGroup": {
        "description": "One supplier's part of a seller's order: lines as sold, the margin snapshot at the prices charged, the supplier's answer and any refund.",
        "properties": {
          "accept_by": {
            "format": "date-time",
            "type": "string"
          },
          "alert": {
            "type": "string"
          },
          "breakdown": {
            "$ref": "#/components/schemas/SupplyBreakdown"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/SupplyGroupLine"
            },
            "type": "array"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "refund_minor": {
            "format": "int64",
            "type": "integer"
          },
          "refund_state": {
            "enum": [
              "none",
              "due",
              "refunded",
              "order_cancelled",
              "manual",
              "not_needed"
            ],
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "type": "string"
          },
          "shipment": {
            "$ref": "#/components/schemas/SupplyShipment"
          },
          "status": {
            "enum": [
              "pending",
              "sent",
              "awaiting_acceptance",
              "accepted",
              "rejected",
              "cancel_requested",
              "cancelled",
              "released"
            ],
            "type": "string"
          },
          "supplier_name": {
            "type": "string"
          },
          "supplier_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "supply_order_id": {
            "format": "int64",
            "type": "integer"
          },
          "terms_version": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "order_number",
          "supplier_tenant_id",
          "supplier_name",
          "status",
          "currency",
          "lines",
          "breakdown",
          "refund_state",
          "refund_minor",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SupplyOrderLine": {
        "properties": {
          "cost_currency": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "merchant_order_line_id": {
            "description": "The seller's order line this pairs with (never by position).",
            "format": "int64",
            "type": "integer"
          },
          "offer_id": {
            "format": "int64",
            "type": "integer"
          },
          "qty_cancelled": {
            "type": "integer"
          },
          "qty_shipped": {
            "type": "integer"
          },
          "quantity": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "tax_class": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "unit_cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "merchant_order_line_id",
          "offer_id",
          "variant_id",
          "sku",
          "title",
          "quantity",
          "unit_cost_minor",
          "cost_currency",
          "tax_class",
          "qty_shipped",
          "qty_cancelled"
        ],
        "type": "object"
      },
      "SupplyOrderPayout": {
        "description": "What the supplier is paid for a supply order and when (the catalog store, ADR-0141): its price for the lines with their tax, through NeroPay, releasable once delivered and the return window passed. Never the retail price.",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "release_on": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "waiting_delivery",
              "return_window",
              "due"
            ],
            "type": "string"
          },
          "through": {
            "enum": [
              "neropay"
            ],
            "type": "string"
          }
        },
        "required": [
          "through",
          "amount_minor",
          "currency",
          "state"
        ],
        "type": "object"
      },
      "SupplyOrderSettings": {
        "description": "The supplier's acceptance settings.",
        "properties": {
          "accept_within_hours": {
            "maximum": 168,
            "minimum": 1,
            "type": "integer"
          },
          "auto_accept": {
            "type": "boolean"
          },
          "default": {
            "type": "boolean"
          }
        },
        "required": [
          "auto_accept",
          "accept_within_hours"
        ],
        "type": "object"
      },
      "SupplyPayment": {
        "description": "A payment recorded between a seller (payer) and a supplier (payee).",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "confirmed_at": {
            "format": "date-time",
            "type": "string"
          },
          "counterparty_name": {
            "type": "string"
          },
          "counterparty_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "dispute_note": {
            "type": "string"
          },
          "disputed_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "note": {
            "type": "string"
          },
          "paid_on": {
            "format": "date",
            "type": "string"
          },
          "payment_uid": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "role": {
            "enum": [
              "payer",
              "payee"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "reported",
              "confirmed",
              "disputed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_uid",
          "role",
          "counterparty_tenant_id",
          "counterparty_name",
          "currency",
          "amount_minor",
          "paid_on",
          "reference",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "SupplyPaymentInput": {
        "description": "\"Ödeme yapıldı\": a bank transfer already made.",
        "properties": {
          "amount_minor": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "note": {
            "maxLength": 500,
            "type": "string"
          },
          "paid_on": {
            "format": "date",
            "type": "string"
          },
          "reference": {
            "maxLength": 120,
            "type": "string"
          }
        },
        "required": [
          "currency",
          "amount_minor",
          "paid_on"
        ],
        "type": "object"
      },
      "SupplyPayoutAccount": {
        "description": "The business's payout account at the payment institution (mode P). Never the IBAN or the identity number: hints only.",
        "properties": {
          "active_at": {
            "format": "date-time",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "has_representative_identity": {
            "type": "boolean"
          },
          "iban_hint": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "",
              "PERSONAL",
              "PRIVATE_COMPANY",
              "LIMITED_OR_JOINT_STOCK_COMPANY"
            ],
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "representative_identity_hint": {
            "type": "string"
          },
          "representative_name": {
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "pending",
              "active",
              "refused",
              "error"
            ],
            "type": "string"
          },
          "status_text": {
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "kind",
          "status",
          "status_text",
          "missing"
        ],
        "type": "object"
      },
      "SupplyPayoutAccountInput": {
        "properties": {
          "kind": {
            "enum": [
              "PERSONAL",
              "PRIVATE_COMPANY",
              "LIMITED_OR_JOINT_STOCK_COMPANY"
            ],
            "type": "string"
          },
          "representative_identity": {
            "description": "TCKN; empty keeps the one on file. Sealed at rest.",
            "pattern": "^[0-9]{11}$",
            "type": "string"
          },
          "representative_name": {
            "maxLength": 120,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyPayoutSummary": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SupplyPayoutView"
            },
            "type": "array"
          },
          "paid": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Hesabınıza geçti, per currency",
            "type": "object"
          },
          "upcoming": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "description": "Hesabınıza geçecek, per currency",
            "type": "object"
          }
        },
        "required": [
          "enabled",
          "upcoming",
          "paid",
          "items"
        ],
        "type": "object"
      },
      "SupplyPayoutView": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "date": {
            "format": "date-time",
            "type": "string"
          },
          "date_label": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "gross_minor": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "order_number": {
            "type": "string"
          },
          "paid_out_at": {
            "format": "date-time",
            "type": "string"
          },
          "payout_id": {
            "format": "int64",
            "type": "integer"
          },
          "refunded_minor": {
            "format": "int64",
            "type": "integer"
          },
          "released_at": {
            "format": "date-time",
            "type": "string"
          },
          "role": {
            "enum": [
              "supplier",
              "seller"
            ],
            "type": "string"
          },
          "share_minor": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "held",
              "on_hold",
              "releasing",
              "released",
              "paid_out",
              "cancelled"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "payout_id",
          "role",
          "currency",
          "amount_minor",
          "status",
          "label"
        ],
        "type": "object"
      },
      "SupplyProductLink": {
        "description": "A supply product of the store (\"Mağazamdakiler\"): provenance, price, breakdown, warnings.",
        "properties": {
          "applied_cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "availability": {
            "description": "Availability bucket — never the exact stock.",
            "enum": [
              "0",
              "1-4",
              "5+",
              "backorder"
            ],
            "type": "string"
          },
          "breakdown": {
            "$ref": "#/components/schemas/SupplyBreakdown"
          },
          "catalog_entry_id": {
            "format": "int64",
            "type": "integer"
          },
          "category_path": {
            "type": "string"
          },
          "cost_minor": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "floor_minor": {
            "description": "The lowest price it may sell at: the supplier's price with its tax, NeroCart's commission and the processing fee.",
            "format": "int64",
            "type": "integer"
          },
          "grant_uid": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image_url": {
            "type": "string"
          },
          "needs_review": {
            "type": "boolean"
          },
          "network_category": {
            "type": "string"
          },
          "offer_id": {
            "format": "int64",
            "type": "integer"
          },
          "offer_version": {
            "type": "integer"
          },
          "paid_through": {
            "description": "Set when the product's lines are paid only through NeroPay (the catalog store, ADR-0141).",
            "enum": [
              "neropay"
            ],
            "type": "string"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "prices": {
            "items": {
              "$ref": "#/components/schemas/SupplyOfferPrice"
            },
            "type": "array"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_status": {
            "type": "string"
          },
          "review_reason": {
            "type": "string"
          },
          "rrp_minor": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "active",
              "paused",
              "withdrawn",
              "declined"
            ],
            "type": "string"
          },
          "store_id": {
            "format": "int64",
            "type": "integer"
          },
          "suggested_price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "supplier_name": {
            "type": "string"
          },
          "supplier_sku": {
            "type": "string"
          },
          "supplier_standing": {
            "description": "The supplier's standing with NeroCart (G-06): only an active supplier's products are on sale; suspended or terminated ones are taken off sale in every store (sold out) and come back when NeroCart reinstates the supplier.",
            "enum": [
              "active",
              "suspended",
              "terminated"
            ],
            "type": "string"
          },
          "supplier_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "tax_class": {
            "enum": [
              "kdv20",
              "kdv10",
              "kdv1",
              "kdv0"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          },
          "warnings": {
            "description": "Short codes the screen words: low_margin, loss, review, unavailable, withdrawn, supplier_suspended, supplier_terminated, no_shipping (NeroCart has no carrier account that can book the parcel yet: off sale until it has).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "product_id",
          "variant_id",
          "supplier_name",
          "status",
          "title",
          "currency",
          "cost_minor",
          "price_minor",
          "needs_review",
          "warnings"
        ],
        "type": "object"
      },
      "SupplyProfile": {
        "description": "The supplier application. Personal data when the business is a sole proprietor (KVKK): the IBAN is never returned, only its last four digits.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/SupplyAddress"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contact_email": {
            "type": "string"
          },
          "contact_name": {
            "type": "string"
          },
          "contact_phone": {
            "type": "string"
          },
          "document_media_ids": {
            "description": "Media library ids from before G-07 that are not private documents: links to files elsewhere, or files the supply job has still to move. Normally empty.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "documents": {
            "description": "The application's documents, kept private (G-07): downloaded from /api/admin/x/supply/profile/documents/{id}.",
            "items": {
              "$ref": "#/components/schemas/SupplyApplicationDocument"
            },
            "type": "array"
          },
          "has_iban": {
            "type": "boolean"
          },
          "iban_hint": {
            "description": "The IBAN's last four digits.",
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "submitted_at": {
            "format": "date-time",
            "type": "string"
          },
          "tax_kind": {
            "enum": [
              "vkn",
              "tckn"
            ],
            "type": "string"
          },
          "tax_number": {
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyProfileInput": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/SupplyAddress"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          },
          "contact_email": {
            "type": "string"
          },
          "contact_name": {
            "type": "string"
          },
          "contact_phone": {
            "type": "string"
          },
          "document_media_ids": {
            "description": "Accepted for older clients and ignored: documents are added and removed through /api/admin/x/supply/profile/documents (G-07).",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 10,
            "type": "array"
          },
          "iban": {
            "description": "TR IBAN (26 characters, mod-97 checked); sealed at rest. Omitted or empty keeps the one on file.",
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "tax_kind": {
            "enum": [
              "vkn",
              "tckn"
            ],
            "type": "string"
          },
          "tax_number": {
            "description": "VKN (10 digits) or TCKN (11 digits), checked by its check digits.",
            "type": "string"
          },
          "tax_office": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyProfileView": {
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/CapabilitySummary"
          },
          "profile": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SupplyProfile"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "SupplyRule": {
        "description": "A pricing rule; the most specific scope wins.",
        "properties": {
          "apply": {
            "enum": [
              "auto",
              "review"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "method": {
            "enum": [
              "markup_pct",
              "markup_fixed",
              "target_margin_fixed",
              "target_margin_pct",
              "rrp"
            ],
            "type": "string"
          },
          "min_margin_bp": {
            "format": "int64",
            "type": "integer"
          },
          "rounding": {
            "enum": [
              "none",
              "90",
              "99",
              "00"
            ],
            "type": "string"
          },
          "scope": {
            "enum": [
              "product",
              "category",
              "supplier",
              "all"
            ],
            "type": "string"
          },
          "scope_ref": {
            "type": "string"
          },
          "value": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "scope",
          "method",
          "value"
        ],
        "type": "object"
      },
      "SupplyScore": {
        "description": "A supplier's catalog score (ADR-0141): 0–100 from shipping time, returns and complaints over 90 days; null with too few orders. Under the network's threshold past the notice period the supplier drops out of the shared catalog.",
        "properties": {
          "detail": {
            "properties": {
              "avg_ship_hours": {
                "type": "number"
              },
              "complaints": {
                "type": "integer"
              },
              "complaints_score": {
                "type": "integer"
              },
              "orders": {
                "type": "integer"
              },
              "returned": {
                "type": "integer"
              },
              "returns_score": {
                "type": "integer"
              },
              "shipping_score": {
                "type": "integer"
              },
              "threshold": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "hidden_at": {
            "format": "date-time",
            "type": "string"
          },
          "low_since": {
            "format": "date-time",
            "type": "string"
          },
          "score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scored_at": {
            "format": "date-time",
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "tenant_id",
          "score",
          "detail"
        ],
        "type": "object"
      },
      "SupplySellerSettings": {
        "description": "A store's supply settings (Ayarlar › Tedarik).",
        "properties": {
          "apply": {
            "enum": [
              "auto",
              "review"
            ],
            "type": "string"
          },
          "default": {
            "type": "boolean"
          },
          "default_markup_bp": {
            "format": "int64",
            "type": "integer"
          },
          "min_margin_bp": {
            "format": "int64",
            "type": "integer"
          },
          "rounding": {
            "enum": [
              "none",
              "90",
              "99",
              "00"
            ],
            "type": "string"
          }
        },
        "required": [
          "default_markup_bp",
          "rounding",
          "min_margin_bp",
          "apply"
        ],
        "type": "object"
      },
      "SupplyShipFrom": {
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        },
        "required": [
          "city",
          "country"
        ],
        "type": "object"
      },
      "SupplyShipToArea": {
        "description": "All a supplier learns of where a parcel goes: district (ilçe), province (il), country. Never a name, street, phone or e-mail.",
        "properties": {
          "country": {
            "type": "string"
          },
          "district": {
            "type": "string"
          },
          "province": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SupplyShipment": {
        "description": "The parcel the platform booked on its carrier account for one supplier's part of a seller's order (SN-7).",
        "properties": {
          "alert": {
            "type": "string"
          },
          "booked_at": {
            "format": "date-time",
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "group_id": {
            "format": "int64",
            "type": "integer"
          },
          "handed_over_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "label_mode": {
            "enum": [
              "coded",
              "l2"
            ],
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "service": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "booked",
              "blocked",
              "failed",
              "handed_over",
              "in_transit",
              "out_for_delivery",
              "delivered",
              "failed_delivery",
              "exception",
              "returned",
              "cancelled"
            ],
            "type": "string"
          },
          "supplier_tenant_id": {
            "format": "int64",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "order_id",
          "supplier_tenant_id",
          "status",
          "updated_at"
        ],
        "type": "object"
      },
      "SupplyShipping": {
        "description": "A supply order's parcel as the supplier sees it (SN-7): the code and barcode to put on the parcel, the carrier and where the parcel is. Never the shopper's contact details.",
        "properties": {
          "barcode": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "handed_over_at": {
            "format": "date-time",
            "type": "string"
          },
          "label_mode": {
            "enum": [
              "coded",
              "l2"
            ],
            "type": "string"
          },
          "status": {
            "description": "Empty: the platform is booking (the label is being prepared); ready: print the label.",
            "enum": [
              "",
              "ready",
              "handed_over",
              "in_transit",
              "out_for_delivery",
              "delivered",
              "failed_delivery",
              "exception",
              "returned",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "SupplyStatement": {
        "description": "One counterparty's statement in one currency.",
        "properties": {
          "balance": {
            "$ref": "#/components/schemas/SupplyBalance"
          },
          "from": {
            "format": "date",
            "type": "string"
          },
          "movements": {
            "items": {
              "$ref": "#/components/schemas/SupplyMovement"
            },
            "type": "array"
          },
          "payments": {
            "items": {
              "$ref": "#/components/schemas/SupplyPayment"
            },
            "type": "array"
          },
          "to": {
            "format": "date",
            "type": "string"
          }
        },
        "required": [
          "balance",
          "movements",
          "payments"
        ],
        "type": "object"
      },
      "SupplySuggestion": {
        "description": "A rule's price for a product. Invariant: the suggested price never loses money and earns at least min_margin_bp of the retail net, cargo and fees included.",
        "properties": {
          "break_even_minor": {
            "description": "The lowest price, rounded as the rule rounds, that loses nothing with cargo and every fee included.",
            "format": "int64",
            "type": "integer"
          },
          "breakdown": {
            "$ref": "#/components/schemas/SupplyBreakdown"
          },
          "cargo_gross_minor": {
            "description": "The one parcel's cargo (incl. KDV) the price carries in full.",
            "format": "int64",
            "type": "integer"
          },
          "floor_reason": {
            "description": "Why the suggestion was floored.",
            "enum": [
              "loss",
              "low_margin"
            ],
            "type": "string"
          },
          "floored": {
            "description": "The rule's own price lost money or earned under the minimum margin; the suggestion is the floor.",
            "type": "boolean"
          },
          "min_margin_bp": {
            "description": "The floor applied, as basis points of the retail net.",
            "format": "int64",
            "type": "integer"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "rule": {
            "$ref": "#/components/schemas/SupplyRule"
          },
          "rule_margin_minor": {
            "description": "The net margin at the rule's own price.",
            "format": "int64",
            "type": "integer"
          },
          "rule_price_minor": {
            "description": "The rule's own price (rounded), before the floor.",
            "format": "int64",
            "type": "integer"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "price_minor",
          "rule",
          "breakdown",
          "warnings",
          "rule_price_minor",
          "rule_margin_minor",
          "break_even_minor",
          "min_margin_bp",
          "cargo_gross_minor"
        ],
        "type": "object"
      },
      "SupplyTerms": {
        "description": "The standard network terms in force and the fee inputs of the price breakdown.",
        "properties": {
          "cargo_kdv_bp": {
            "format": "int64",
            "type": "integer"
          },
          "cargo_net_minor": {
            "format": "int64",
            "type": "integer"
          },
          "commission_bp": {
            "format": "int64",
            "type": "integer"
          },
          "commission_kdv_bp": {
            "format": "int64",
            "type": "integer"
          },
          "cost_notice_days": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "default": {
            "description": "True while the platform has written no version: placeholder figures (Q-SN-02/03), labelled \"varsayılan, değiştirilebilir\".",
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "pos_fee_bp": {
            "format": "int64",
            "type": "integer"
          },
          "return_window_days": {
            "description": "Days after delivery an item's money stays held under mode P before it is released.",
            "maximum": 90,
            "minimum": 0,
            "type": "integer"
          },
          "score_grace_days": {
            "description": "Days a supplier under the threshold has, after its notice, before it drops out of the catalog.",
            "type": "integer"
          },
          "score_min": {
            "description": "The supplier score's threshold, 0–100 (0 switches it off; ADR-0141).",
            "type": "integer"
          },
          "score_min_orders": {
            "description": "Supply orders (last 90 days) a score needs.",
            "type": "integer"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "version",
          "commission_bp",
          "commission_kdv_bp",
          "pos_fee_bp",
          "cargo_net_minor",
          "cargo_kdv_bp",
          "cost_notice_days",
          "default"
        ],
        "type": "object"
      },
      "SupplyTrailEntry": {
        "properties": {
          "action": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SupplyVariantOffer": {
        "description": "The product page's \"Ağda sat\" panel.",
        "properties": {
          "locations": {
            "items": {
              "$ref": "#/components/schemas/SupplyVariantOfferLocation"
            },
            "type": "array"
          },
          "offer": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SupplyOffer"
              },
              {
                "type": "null"
              }
            ]
          },
          "supplier_status": {
            "type": "string"
          },
          "terms": {
            "$ref": "#/components/schemas/SupplyTerms"
          }
        },
        "required": [
          "offer",
          "locations",
          "supplier_status",
          "terms"
        ],
        "type": "object"
      },
      "SupplyVariantOfferLocation": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "city": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "active"
        ],
        "type": "object"
      },
      "Suppression": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "commercial",
              "all"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SuppressionInput": {
        "properties": {
          "channel": {
            "enum": [
              "sms",
              "email",
              "call"
            ],
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "scope": {
            "description": "Defaults to commercial.",
            "enum": [
              "commercial",
              "all"
            ],
            "type": "string"
          }
        },
        "required": [
          "channel",
          "recipient",
          "reason"
        ],
        "type": "object"
      },
      "SuratTestResult": {
        "properties": {
          "error": {
            "description": "Sürat Kargo's reason when the test failed.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "TRDistrict": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "TRDistrictList": {
        "properties": {
          "districts": {
            "items": {
              "$ref": "#/components/schemas/TRDistrict"
            },
            "type": "array"
          },
          "province": {
            "$ref": "#/components/schemas/TRProvince"
          }
        },
        "required": [
          "province",
          "districts"
        ],
        "type": "object"
      },
      "TRNeighbourhood": {
        "properties": {
          "name": {
            "type": "string"
          },
          "postal_codes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name",
          "postal_codes"
        ],
        "type": "object"
      },
      "TRNeighbourhoodList": {
        "properties": {
          "district": {
            "type": "string"
          },
          "neighbourhoods": {
            "items": {
              "$ref": "#/components/schemas/TRNeighbourhood"
            },
            "type": "array"
          },
          "province": {
            "$ref": "#/components/schemas/TRProvince"
          }
        },
        "required": [
          "province",
          "district",
          "neighbourhoods"
        ],
        "type": "object"
      },
      "TRPlace": {
        "properties": {
          "district": {
            "type": "string"
          },
          "neighbourhood": {
            "type": "string"
          },
          "province": {
            "type": "string"
          },
          "province_code": {
            "type": "integer"
          }
        },
        "required": [
          "province",
          "province_code",
          "district",
          "neighbourhood"
        ],
        "type": "object"
      },
      "TRPostalAnswer": {
        "properties": {
          "code": {
            "type": "string"
          },
          "places": {
            "items": {
              "$ref": "#/components/schemas/TRPlace"
            },
            "type": "array"
          }
        },
        "required": [
          "code",
          "places"
        ],
        "type": "object"
      },
      "TRProvince": {
        "properties": {
          "code": {
            "description": "The plate number.",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name"
        ],
        "type": "object"
      },
      "TRProvinceList": {
        "properties": {
          "provinces": {
            "items": {
              "$ref": "#/components/schemas/TRProvince"
            },
            "type": "array"
          }
        },
        "required": [
          "provinces"
        ],
        "type": "object"
      },
      "TaxClass": {
        "description": "How the law treats a kind of goods (M2.3) — reduced, standard; a rate targets a class.",
        "properties": {
          "code": {
            "example": "reduced",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "code",
          "name"
        ],
        "type": "object"
      },
      "TaxRate": {
        "description": "A rule about a place and a kind of thing. The best rule for a line is chosen in Medusa's order: the destination's state before its country before the store-wide fallback, and within one place the product's tax class before its category before a rule for everything; among categories the deeper one wins. A rule on a category reaches its whole subtree. A combinable state rule adds the country's best rule for the line on top of itself.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "category_id": {
            "description": "Absent applies to everything.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "category_name": {
            "description": "Read-only, for display.",
            "type": "string"
          },
          "country": {
            "description": "ISO 3166-1 alpha-2. Empty is the fallback every other rule is more specific than.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "is_combinable": {
            "description": "Only meaningful on a rate with a state: when it is the rate a line gets, the country's best rate for that line is charged on top of it (e.g. QST on top of GST); the line records the sum and both names. Default false.",
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "description": "What appears on the invoice, e.g. \"GST 18%\".",
            "type": "string"
          },
          "rate_bp": {
            "description": "Basis points: 1800 is 18.00%. An integer, like every other money-adjacent figure here.",
            "type": "integer"
          },
          "state": {
            "description": "Requires a country.",
            "type": "string"
          },
          "tax_class_id": {
            "description": "The tax class this rate applies to; null for the default rate.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TaxRateInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "category_id": {
            "description": "Absent applies to everything.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "country": {
            "description": "ISO 3166-1 alpha-2. Empty is the fallback every other rule is more specific than.",
            "type": "string"
          },
          "is_combinable": {
            "description": "Only meaningful on a rate with a state: when it is the rate a line gets, the country's best rate for that line is charged on top of it (e.g. QST on top of GST); the line records the sum and both names. Default false.",
            "type": "boolean"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "description": "What appears on the invoice, e.g. \"GST 18%\".",
            "type": "string"
          },
          "rate_bp": {
            "description": "Basis points: 1800 is 18.00%. An integer, like every other money-adjacent figure here.",
            "type": "integer"
          },
          "state": {
            "description": "Requires a country.",
            "type": "string"
          },
          "tax_class_id": {
            "description": "The tax class this rate applies to; null for the default rate.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "rate_bp"
        ],
        "type": "object"
      },
      "TaxonomyAttribute": {
        "properties": {
          "choices": {
            "example": [
              "Short",
              "Long"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "handle": {
            "example": "sleeve-length",
            "type": "string"
          },
          "label": {
            "example": "Sleeve length",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TaxonomyAttributeImport": {
        "description": "Unmatched counts lines naming a category this store does not have, which is the ordinary case when the tree came from a different release or only part of it was kept.",
        "properties": {
          "attributes": {
            "type": "integer"
          },
          "categories": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "unmatched": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TaxonomyAttributeInput": {
        "properties": {
          "choices": {
            "example": [
              "Short",
              "Long"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "handle": {
            "example": "sleeve-length",
            "type": "string"
          },
          "label": {
            "example": "Sleeve length",
            "type": "string"
          }
        },
        "required": [
          "handle",
          "label"
        ],
        "type": "object"
      },
      "TaxonomyImport": {
        "description": "Created counts rows written; matched counts categories that were already in the right place and were left alone, which is what makes a second run a no-op.",
        "properties": {
          "created": {
            "type": "integer"
          },
          "matched": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TaxonomyImportResult": {
        "properties": {
          "attributes": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxonomyAttributeImport"
              }
            ],
            "description": "Absent for an uploaded file: the field definitions match on a taxonomy id only the embedded tree writes, so nothing was attempted and a report of zeros would read like a failure."
          },
          "categories": {
            "$ref": "#/components/schemas/TaxonomyImport"
          },
          "source": {
            "enum": [
              "embedded",
              "upload"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TellUs": {
        "properties": {
          "answers": {
            "$ref": "#/components/schemas/TellUsAnswers"
          },
          "applied": {
            "$ref": "#/components/schemas/TellUsApplied"
          },
          "moods": {
            "items": {
              "$ref": "#/components/schemas/TellUsMood"
            },
            "type": "array"
          },
          "round": {
            "type": "integer"
          },
          "sectors": {
            "items": {
              "$ref": "#/components/schemas/TellUsSector"
            },
            "type": "array"
          },
          "seed": {
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "enum": [
              "new",
              "open",
              "skipped",
              "applied"
            ],
            "type": "string"
          },
          "store_name": {
            "type": "string"
          },
          "swatches": {
            "items": {
              "$ref": "#/components/schemas/TellUsSwatch"
            },
            "type": "array"
          }
        },
        "required": [
          "sectors",
          "moods",
          "swatches",
          "store_name",
          "state",
          "seed",
          "round"
        ],
        "type": "object"
      },
      "TellUsAnswers": {
        "properties": {
          "color": {
            "description": "The brand colour as #rrggbb; empty: the mood's colours.",
            "type": "string"
          },
          "logo": {
            "description": "A picture of the media library shown in the header; absent: the name stands there.",
            "format": "int64",
            "type": "integer"
          },
          "mood": {
            "description": "How the store should feel; empty: the sector theme's own.",
            "enum": [
              "",
              "sade",
              "sicak",
              "canli",
              "luks"
            ],
            "type": "string"
          },
          "name": {
            "description": "The store's name as the proposals say it; empty: the store's own.",
            "maxLength": 80,
            "type": "string"
          },
          "photos": {
            "description": "Up to six pictures of the media library, in order; none: the sector's sample photos.",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 6,
            "type": "array"
          },
          "sector": {
            "description": "A sector's slug (TellUs.sectors), \"other\" (Başka) or empty (skipped).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TellUsApplied": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "round": {
            "type": "integer"
          },
          "theme_id": {
            "type": "string"
          }
        },
        "required": [
          "theme_id",
          "round",
          "index",
          "at"
        ],
        "type": "object"
      },
      "TellUsApplyInput": {
        "properties": {
          "answers": {
            "$ref": "#/components/schemas/TellUsAnswers"
          },
          "index": {
            "maximum": 2,
            "minimum": 0,
            "type": "integer"
          },
          "round": {
            "type": "integer"
          },
          "seed": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "answers",
          "seed",
          "round",
          "index"
        ],
        "type": "object"
      },
      "TellUsApplyResult": {
        "properties": {
          "checkpoint_id": {
            "description": "The save point of the theme as it was.",
            "format": "int64",
            "type": "integer"
          },
          "theme": {
            "$ref": "#/components/schemas/ThemeVersion"
          },
          "unchanged": {
            "description": "The draft already was this proposal.",
            "type": "boolean"
          }
        },
        "required": [
          "theme",
          "unchanged"
        ],
        "type": "object"
      },
      "TellUsDeal": {
        "properties": {
          "proposals": {
            "items": {
              "$ref": "#/components/schemas/TellUsProposal"
            },
            "type": "array"
          },
          "round": {
            "type": "integer"
          },
          "seed": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "seed",
          "round",
          "proposals"
        ],
        "type": "object"
      },
      "TellUsDealInput": {
        "properties": {
          "answers": {
            "$ref": "#/components/schemas/TellUsAnswers"
          },
          "round": {
            "description": "0 the first; \"Hepsini beğenmedim\" the next.",
            "maximum": 1000,
            "minimum": 0,
            "type": "integer"
          },
          "seed": {
            "description": "Absent rolls one (the answer names it).",
            "format": "int64",
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "answers"
        ],
        "type": "object"
      },
      "TellUsLogoColors": {
        "properties": {
          "colors": {
            "items": {
              "$ref": "#/components/schemas/LookColor"
            },
            "type": "array"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "primary": {
            "description": "The logo's main colour (#rrggbb), when it has one.",
            "type": "string"
          }
        },
        "required": [
          "media_id",
          "colors"
        ],
        "type": "object"
      },
      "TellUsLogoInput": {
        "properties": {
          "media_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "media_id"
        ],
        "type": "object"
      },
      "TellUsLook": {
        "properties": {
          "code": {
            "type": "string"
          },
          "fonts": {
            "$ref": "#/components/schemas/LookFonts"
          },
          "main": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "swatch": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "code",
          "name",
          "swatch"
        ],
        "type": "object"
      },
      "TellUsMood": {
        "properties": {
          "fonts": {
            "$ref": "#/components/schemas/LookFonts"
          },
          "id": {
            "enum": [
              "sade",
              "sicak",
              "canli",
              "luks"
            ],
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "shape": {
            "enum": [
              "sharp",
              "soft",
              "round"
            ],
            "type": "string"
          },
          "swatch": {
            "description": "Main colour, page, text.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "fonts",
          "swatch",
          "shape"
        ],
        "type": "object"
      },
      "TellUsProposal": {
        "properties": {
          "index": {
            "type": "integer"
          },
          "look": {
            "$ref": "#/components/schemas/TellUsLook"
          },
          "photos": {
            "description": "How many of the merchant's photos it shows.",
            "type": "integer"
          },
          "preview": {
            "$ref": "#/components/schemas/ContentPreviewToken"
          },
          "theme_id": {
            "type": "string"
          },
          "theme_name": {
            "type": "string"
          }
        },
        "required": [
          "index",
          "theme_id",
          "theme_name",
          "look",
          "photos"
        ],
        "type": "object"
      },
      "TellUsSector": {
        "properties": {
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "picture": {
            "description": "The card's photograph, a path on the storefront.",
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "type": "object"
      },
      "TellUsSwatch": {
        "properties": {
          "hex": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "hex",
          "name"
        ],
        "type": "object"
      },
      "TemplateBlock": {
        "properties": {
          "disabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "The name the merchant gave the item in the navigator (ADR-0085 VB-8, flag vb_navigator2); one line, never printed for shoppers.",
            "maxLength": 60,
            "type": "string"
          },
          "locked": {
            "description": "Locked in the navigator: the editor does not drag, move or delete it (ADR-0085 VB-8).",
            "type": "boolean"
          },
          "parent": {
            "description": "A free layout node's container id; absent or empty for the section itself (ADR-0085 §1.2). Only the blocks of a layout section have one.",
            "type": "string"
          },
          "settings": {
            "additionalProperties": true,
            "type": "object"
          },
          "sync": {
            "$ref": "#/components/schemas/NodeSync"
          },
          "type": {
            "type": "string"
          },
          "v": {
            "description": "The schema version a free layout node was written at; absent is 1 (ADR-0085 §1.3). The kernel brings an older node to its type's current shape on read and write; a node a newer release wrote is kept exactly as stored.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TemplateSection": {
        "properties": {
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/TemplateBlock"
            },
            "type": "array"
          },
          "disabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "The name the merchant gave the item in the navigator (ADR-0085 VB-8, flag vb_navigator2); one line, never printed for shoppers.",
            "maxLength": 60,
            "type": "string"
          },
          "locked": {
            "description": "Locked in the navigator: the editor does not drag, move or delete it (ADR-0085 VB-8).",
            "type": "boolean"
          },
          "settings": {
            "additionalProperties": true,
            "type": "object"
          },
          "sync": {
            "$ref": "#/components/schemas/NodeSync"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TenantRequest": {
        "properties": {
          "artifact_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "artifact_sha256": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "export",
              "deletion"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "status": {
            "enum": [
              "requested",
              "processing",
              "ready",
              "failed",
              "expired",
              "scheduled",
              "cancelled",
              "due"
            ],
            "type": "string"
          },
          "tenant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "kind",
          "status"
        ],
        "type": "object"
      },
      "TenantState": {
        "properties": {
          "deletion_due_at": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "enum": [
              "standard",
              "internal"
            ],
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "enum": [
              "provisioning",
              "active",
              "suspended",
              "closing",
              "deleted"
            ],
            "type": "string"
          },
          "suspended_at": {
            "format": "date-time",
            "type": "string"
          },
          "suspension_note": {
            "type": "string"
          },
          "suspension_reason": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "status"
        ],
        "type": "object"
      },
      "TestModeInput": {
        "properties": {
          "confirm": {
            "description": "Must be true to switch it on.",
            "type": "boolean"
          },
          "hours": {
            "description": "How long it stays on; 0 is two hours.",
            "maximum": 24,
            "minimum": 0,
            "type": "integer"
          },
          "on": {
            "type": "boolean"
          }
        },
        "required": [
          "on"
        ],
        "type": "object"
      },
      "TestModeMethod": {
        "properties": {
          "code": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "test_card",
              "test_environment",
              "offline",
              "live"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "kind"
        ],
        "type": "object"
      },
      "TestOrdersDeleted": {
        "properties": {
          "deleted": {
            "type": "integer"
          },
          "kept": {
            "description": "Order numbers that stayed (licence codes on them).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "deleted",
          "kept"
        ],
        "type": "object"
      },
      "TextTranslation": {
        "description": "A collection's or category's text in one non-default language, with its review status.",
        "properties": {
          "description": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "missing": {
            "description": "Fields with default-language text and no translation (title, description, seo_title, seo_description). Empty means complete.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "description": "Translation provenance; default human.",
            "enum": [
              "human",
              "ai",
              "imported",
              "machine"
            ],
            "type": "string"
          },
          "status": {
            "description": "Review status (constitution §13). Only a published translation is served by store reads; empty for a language with nothing stored.",
            "enum": [
              "draft",
              "reviewed",
              "approved",
              "published"
            ],
            "type": "string"
          },
          "status_changed_at": {
            "format": "date-time",
            "type": "string"
          },
          "status_changed_by": {
            "description": "The operator (e-mail) who last moved the status.",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "warnings": {
            "description": "The store glossary's rules this text breaks (advisory; nothing is refused).",
            "items": {
              "$ref": "#/components/schemas/GlossaryWarning"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TextTranslationInput": {
        "description": "The whole new state of one language, with the same rules as ProductTranslationInput.",
        "properties": {
          "description": {
            "type": "string"
          },
          "seo_description": {
            "type": "string"
          },
          "seo_title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "source": {
            "description": "Translation provenance; default human.",
            "enum": [
              "human",
              "ai",
              "imported",
              "machine"
            ],
            "type": "string"
          },
          "status": {
            "description": "draft keeps the translation off the storefront; published (human source only) serves it. Omitted: a human translation is published, any other source starts as a draft and is published through review.",
            "enum": [
              "draft",
              "published"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TextTranslations": {
        "properties": {
          "default_language": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "translations": {
            "items": {
              "$ref": "#/components/schemas/TextTranslation"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeAnnouncement": {
        "properties": {
          "background": {
            "description": "#rrggbb; empty uses the accent colour.",
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "href": {
            "type": "string"
          },
          "marquee": {
            "description": "Scroll the text's \" · \" parts as a ticker.",
            "type": "boolean"
          },
          "text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeApplyInput": {
        "properties": {
          "demo": {
            "description": "Ignored on input: the engine previews a theme that ships a demo pack on its own demo store (ADR-0072).",
            "type": "boolean"
          },
          "home": {
            "description": "map (default), replace or keep.",
            "enum": [
              "",
              "map",
              "replace",
              "keep"
            ],
            "type": "string"
          },
          "import_sample": {
            "description": "Apply only: also add the theme's sample content (categories, collections, products with pictures, size guides; pages and articles as drafts; never reviews) to the store, recorded so that DELETE /admin/theme/demo-imports/{id} removes exactly it. Needs catalog.write and content.write as well.",
            "type": "boolean"
          },
          "keep_colors": {
            "description": "Colours, fonts and appearance.",
            "type": "boolean"
          },
          "keep_logo": {
            "type": "boolean"
          },
          "keep_menus": {
            "description": "Header and footer menus and footer link columns.",
            "type": "boolean"
          },
          "keep_store_info": {
            "description": "Announcement, footer text, contact, social links, payment icons, trust badges, WhatsApp button, product page texts, free-shipping amount.",
            "type": "boolean"
          },
          "overwrite_drafts": {
            "description": "Confirms replacing an unpublished theme draft (and, with home \"replace\", unpublished home page drafts); without it such a draft is 409.",
            "type": "boolean"
          },
          "version": {
            "description": "Defaults to the newest installed version.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeApplyResult": {
        "properties": {
          "home": {
            "items": {
              "properties": {
                "kept": {
                  "type": "integer"
                },
                "language": {
                  "type": "string"
                },
                "mapped": {
                  "type": "integer"
                },
                "reason": {
                  "description": "For a skipped language: content_write (the operator lacks it), in_review or approved.",
                  "type": "string"
                },
                "status": {
                  "enum": [
                    "saved",
                    "skipped"
                  ],
                  "type": "string"
                },
                "version_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "sample": {
            "$ref": "#/components/schemas/DemoImport"
          },
          "theme": {
            "$ref": "#/components/schemas/ThemeVersion"
          }
        },
        "type": "object"
      },
      "ThemeBuilderLimits": {
        "properties": {
          "bar_elements": {
            "type": "integer"
          },
          "column_elements": {
            "type": "integer"
          },
          "drawer_elements": {
            "type": "integer"
          },
          "footer_columns": {
            "type": "integer"
          },
          "footer_rows": {
            "type": "integer"
          },
          "row_height_max": {
            "type": "integer"
          },
          "row_height_min": {
            "type": "integer"
          },
          "slot_elements": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeBuilderPreset": {
        "properties": {
          "description": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "footer": {
            "$ref": "#/components/schemas/FooterBuilder"
          },
          "header": {
            "$ref": "#/components/schemas/HeaderBuilder"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeButtons": {
        "description": "The store's button set (ADR-0090): a ready set's values and the store's own changes; every storefront button's shape, fill, border, size, weight, letter case, shadow, hover, keyboard focus ring, secondary and link button. Absent: the theme's own buttons.",
        "properties": {
          "border": {
            "enum": [
              "",
              "none",
              "thin",
              "thick",
              "heavy"
            ],
            "type": "string"
          },
          "fill": {
            "enum": [
              "",
              "solid",
              "outline",
              "gradient",
              "tint"
            ],
            "type": "string"
          },
          "focus": {
            "enum": [
              "",
              "ring",
              "thick",
              "double"
            ],
            "type": "string"
          },
          "hover": {
            "enum": [
              "",
              "darken",
              "lift",
              "grow",
              "glow",
              "fill",
              "press"
            ],
            "type": "string"
          },
          "link": {
            "enum": [
              "",
              "underline",
              "plain",
              "arrow",
              "bold"
            ],
            "type": "string"
          },
          "secondary": {
            "enum": [
              "",
              "outline",
              "tint",
              "underline",
              "solid"
            ],
            "type": "string"
          },
          "set": {
            "description": "The ready set the values started from (button_sets[].id); empty: the store's own.",
            "type": "string"
          },
          "shadow": {
            "enum": [
              "",
              "none",
              "soft",
              "hard",
              "raised"
            ],
            "type": "string"
          },
          "shape": {
            "enum": [
              "",
              "square",
              "soft",
              "rounded",
              "pill"
            ],
            "type": "string"
          },
          "size": {
            "enum": [
              "",
              "s",
              "m",
              "l"
            ],
            "type": "string"
          },
          "transform": {
            "enum": [
              "",
              "none",
              "uppercase",
              "capitalize"
            ],
            "type": "string"
          },
          "weight": {
            "enum": [
              0,
              400,
              500,
              600,
              700,
              800
            ],
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeCartPage": {
        "description": "The cart (engine 1.1.0).",
        "properties": {
          "free_shipping": {
            "description": "The amount of the store's own free-shipping offer, for the progress bar; advisory.",
            "properties": {
              "amount_minor": {
                "format": "int64",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "layout": {
            "description": "split or stacked",
            "type": "string"
          },
          "trust_badges": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeChat": {
        "description": "The floating WhatsApp button (engine 1.1.0).",
        "properties": {
          "message": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "position": {
            "description": "right or left",
            "type": "string"
          },
          "whatsapp": {
            "description": "International number, digits only; empty hides the button.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeCheckpoint": {
        "properties": {
          "area": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "save",
              "auto"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "reason": {
            "description": "Why an automatic save point was taken (ADR-0102): look, kit, theme, restore, live; absent for the merchant's own.",
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "theme_id": {
            "description": "The theme package the snapshot was taken on.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "revision",
          "kind",
          "area",
          "label",
          "created_by_label",
          "created_at"
        ],
        "type": "object"
      },
      "ThemeCheckpointInput": {
        "properties": {
          "area": {
            "type": "string"
          },
          "label": {
            "maxLength": 120,
            "type": "string"
          },
          "reason": {
            "description": "An automatic save point taken by the editor before a big change (ADR-0102: a ready look about to be tried); kind auto.",
            "enum": [
              "look",
              "kit",
              "theme",
              "restore",
              "live"
            ],
            "type": "string"
          },
          "revision": {
            "description": "The draft revision this change was made on (0 when there is no draft yet). A stale one is refused with 409 (details.reason stale_revision, details.current_revision).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeCollectionPage": {
        "description": "Listings (engine 1.1.0).",
        "properties": {
          "columns": {
            "description": "2–5 on a wide screen; 0 keeps the default.",
            "type": "integer"
          },
          "filters": {
            "description": "top or sidebar",
            "type": "string"
          },
          "mobile_columns": {
            "description": "1 or 2; 0 keeps the default.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeColorScheme": {
        "properties": {
          "colors": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "background, surface, text, muted, accent, button, button_text, border as #rrggbb (background and text required).",
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeDemoTarget": {
        "properties": {
          "host": {
            "description": "The demo store's host (\u003ctheme\u003e-demo.\u003cplatform domain\u003e).",
            "type": "string"
          },
          "theme_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeDoctorInput": {
        "properties": {
          "links": {
            "description": "Store paths a page links to (one leading slash, no spaces or backslashes).",
            "items": {
              "maxLength": 400,
              "type": "string"
            },
            "maxItems": 400,
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeDoctorLink": {
        "properties": {
          "kind": {
            "enum": [
              "product",
              "collection",
              "category",
              "page",
              "article",
              "route",
              "file",
              "unknown"
            ],
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "state": {
            "description": "missing: a shopper following the link gets the store's 404.",
            "enum": [
              "ok",
              "missing"
            ],
            "type": "string"
          }
        },
        "required": [
          "path",
          "state",
          "kind"
        ],
        "type": "object"
      },
      "ThemeDoctorResult": {
        "properties": {
          "links": {
            "items": {
              "$ref": "#/components/schemas/ThemeDoctorLink"
            },
            "type": "array"
          },
          "samples": {
            "description": "The theme's sample texts, whitespace squashed.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "theme_id": {
            "type": "string"
          }
        },
        "required": [
          "theme_id",
          "links",
          "samples"
        ],
        "type": "object"
      },
      "ThemeEditor": {
        "properties": {
          "box_fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionFieldSchema"
            },
            "description": "Fields every template and group section has beside its own: hide, space above and below, its headings' and texts' size (s, l, xl; ADR-0067 amendment 2026-10-14), each per device (ADR-0068).",
            "type": "object"
          },
          "builder": {
            "$ref": "#/components/schemas/ThemeEditorBuilder"
          },
          "button_options": {
            "$ref": "#/components/schemas/ButtonSetOptions"
          },
          "button_sets": {
            "description": "The ready button sets of the \"Düğme setleri\" gallery (ADR-0090).",
            "items": {
              "$ref": "#/components/schemas/ButtonSetPreset"
            },
            "type": "array"
          },
          "can_edit_css": {
            "description": "Whether this operator may change custom CSS (theme.publish).",
            "type": "boolean"
          },
          "changes": {
            "description": "Areas that differ from the live theme (\"theme\" when the draft is another theme).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "css": {
            "description": "The custom CSS field every template and group section has (custom_css) and the limits (ADR-0068).",
            "properties": {
              "field": {
                "$ref": "#/components/schemas/SectionFieldSchema"
              },
              "section_max": {
                "description": "Bytes a section's CSS may have.",
                "type": "integer"
              },
              "theme_max": {
                "description": "Bytes the theme's CSS may have.",
                "type": "integer"
              }
            },
            "required": [
              "field",
              "theme_max",
              "section_max"
            ],
            "type": "object"
          },
          "devices": {
            "description": "The device keys of a per-device value: d (computer), t (tablet), m (phone).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "document": {
            "$ref": "#/components/schemas/ThemeEditorDocument"
          },
          "fonts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "group_names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "live": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ThemeEditorLive"
              }
            ]
          },
          "max_sections": {
            "type": "integer"
          },
          "page_sections": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "parts": {
            "description": "The store panels this theme offers, each with the settings paths it edits (ADR-0067).",
            "items": {
              "$ref": "#/components/schemas/ThemeEditorPart"
            },
            "type": "array"
          },
          "schedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ThemeSchedule"
              }
            ],
            "description": "The newest scheduled publish that is pending, done or was not done because the draft changed (ADR-0068)."
          },
          "scheme_color_keys": {
            "description": "The colours of one colour scheme.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sections": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectionSchemaV2"
            },
            "type": "object"
          },
          "settings_schema": {
            "$ref": "#/components/schemas/ThemeSettingsSchema"
          },
          "template_names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "theme": {
            "properties": {
              "format": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "locales": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "version",
              "name",
              "format"
            ],
            "type": "object"
          },
          "type_scale_ratios": {
            "description": "The ratios a type scale may use.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "document",
          "theme",
          "settings_schema",
          "sections",
          "page_sections",
          "template_names",
          "group_names",
          "fonts",
          "max_sections",
          "changes",
          "parts",
          "scheme_color_keys",
          "type_scale_ratios",
          "box_fields",
          "devices",
          "css",
          "can_edit_css"
        ],
        "type": "object"
      },
      "ThemeEditorBuilder": {
        "description": "What the header and footer builders offer (ADR-0071). cta and header_upgrade (2026-10-10): a store that draws its call to action from the menu's last link gets it as a button; header_upgrade is its stored header with that button (absent without a stored header).",
        "properties": {
          "cta": {
            "$ref": "#/components/schemas/HeaderCTA"
          },
          "elements": {
            "properties": {
              "footer": {
                "additionalProperties": {
                  "$ref": "#/components/schemas/BuilderElementDef"
                },
                "type": "object"
              },
              "header": {
                "additionalProperties": {
                  "$ref": "#/components/schemas/BuilderElementDef"
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "footer_presets": {
            "items": {
              "$ref": "#/components/schemas/ThemeBuilderPreset"
            },
            "type": "array"
          },
          "header_presets": {
            "description": "Ready layouts; the first (current) draws what the header settings draw today.",
            "items": {
              "$ref": "#/components/schemas/ThemeBuilderPreset"
            },
            "type": "array"
          },
          "header_upgrade": {
            "$ref": "#/components/schemas/HeaderBuilder"
          },
          "icon_looks": {
            "description": "Ready tool icon looks: the theme's suggestion first, then the engine's.",
            "items": {
              "$ref": "#/components/schemas/IconLookPreset"
            },
            "type": "array"
          },
          "limits": {
            "$ref": "#/components/schemas/ThemeBuilderLimits"
          },
          "menus": {
            "items": {
              "$ref": "#/components/schemas/StoreMenuSummary"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeEditorDocument": {
        "properties": {
          "custom_css": {
            "description": "The store's own CSS for the whole theme, as written (ADR-0068).",
            "type": "string"
          },
          "customized": {
            "description": "template:\u003cname\u003e and group:\u003ctype\u003e the store changed from the theme's own.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "free_areas": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Serbest Tasarım (ADR-0104): the theme areas designed freely in this document (header, footer, product, collection, search, cart, blog, article, notfound), each with the languages it has a design in, sorted; absent when there is none. The storefront draws such an area instead of its sections or builder. The designs are read one at a time (GET /api/admin/theme/editor/free-design) and written with the op set_free_design.",
            "type": "object"
          },
          "groups": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeGroup"
            },
            "type": "object"
          },
          "has_draft": {
            "type": "boolean"
          },
          "parts": {
            "additionalProperties": true,
            "description": "The store panels' values by settings path (ADR-0067): logo, favicon, share_image, menus.header, menus.footer, header.announcement, footer.* , product.*, cart.*, chat.*, color_schemes — the library pictures with their current addresses.",
            "type": "object"
          },
          "revision": {
            "description": "The draft's revision; 0 while there is no draft.",
            "type": "integer"
          },
          "templates": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeTemplate"
            },
            "type": "object"
          },
          "theme_id": {
            "type": "string"
          },
          "theme_version": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "values": {
            "additionalProperties": true,
            "description": "Global settings by setting id in the schema's form (a select is a string); null is the theme's default.",
            "type": "object"
          }
        },
        "required": [
          "revision",
          "has_draft",
          "theme_id",
          "theme_version",
          "values",
          "templates",
          "groups",
          "customized",
          "parts",
          "custom_css"
        ],
        "type": "object"
      },
      "ThemeEditorLive": {
        "properties": {
          "published_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "published_by_label": {
            "type": "string"
          },
          "theme_id": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeEditorOp": {
        "properties": {
          "area": {
            "description": "set_free_design: the theme area (header, footer, product, collection, search, cart, blog, article, notfound; ADR-0104).",
            "type": "string"
          },
          "design": {
            "description": "set_free_design: the area's design in the language (FreeDesignEntry), checked like a page's; null removes it (the theme's own layout again)."
          },
          "id": {
            "description": "set_setting: the setting id (colors.accent, custom.announcement_speed …); set_part: a store panel's settings path (menus.header, logo, footer.bottom …).",
            "type": "string"
          },
          "language": {
            "description": "set_free_design: the design's language (tr, en, de …).",
            "type": "string"
          },
          "name": {
            "description": "The template (home, product …) or group (header, footer, overlay).",
            "type": "string"
          },
          "op": {
            "enum": [
              "set_setting",
              "set_template",
              "reset_template",
              "set_group",
              "reset_group",
              "set_part",
              "set_css",
              "set_free_design"
            ],
            "type": "string"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          },
          "value": {
            "description": "set_setting: the value in the schema's form; null is the default. set_part: the path's value as the theme settings hold it. set_css: the theme's own CSS as text (\"\" or null removes it); needs theme.publish."
          }
        },
        "required": [
          "op"
        ],
        "type": "object"
      },
      "ThemeEditorPart": {
        "properties": {
          "id": {
            "enum": [
              "identity",
              "menus",
              "announcement",
              "footer",
              "footer_bottom",
              "product_info",
              "cart_info",
              "chat",
              "color_schemes",
              "header_builder",
              "footer_builder",
              "language_switcher",
              "global_styles",
              "buttons"
            ],
            "type": "string"
          },
          "paths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "paths"
        ],
        "type": "object"
      },
      "ThemeEditorPatch": {
        "properties": {
          "ops": {
            "items": {
              "$ref": "#/components/schemas/ThemeEditorOp"
            },
            "maxItems": 200,
            "type": "array"
          },
          "revision": {
            "description": "The draft revision this change was made on (0 when there is no draft yet). A stale one is refused with 409 (details.reason stale_revision, details.current_revision).",
            "minimum": 0,
            "type": "integer"
          },
          "window": {
            "description": "The editor window that made the change (its editing-lock session id), recorded in the save's audit row. Optional.",
            "pattern": "^[A-Za-z0-9_-]{8,64}$",
            "type": "string"
          }
        },
        "required": [
          "ops"
        ],
        "type": "object"
      },
      "ThemeEditorPresence": {
        "properties": {
          "expires_seconds": {
            "type": "integer"
          },
          "heartbeat_seconds": {
            "type": "integer"
          },
          "holder_label": {
            "description": "Who holds it (empty when nobody does).",
            "type": "string"
          },
          "mine": {
            "description": "Whether this window holds the editing lock.",
            "type": "boolean"
          },
          "since": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "mine",
          "holder_label",
          "heartbeat_seconds",
          "expires_seconds"
        ],
        "type": "object"
      },
      "ThemeEditorPresenceInput": {
        "properties": {
          "leave": {
            "description": "Let the lock go (the window closes).",
            "type": "boolean"
          },
          "session": {
            "description": "The editor window's own id (8–64 letters, digits, - and _).",
            "type": "string"
          },
          "take": {
            "description": "Take the lock over from someone else (\"Devral\").",
            "type": "boolean"
          }
        },
        "required": [
          "session"
        ],
        "type": "object"
      },
      "ThemeEditorPublishInput": {
        "properties": {
          "revision": {
            "description": "The draft revision this change was made on (0 when there is no draft yet). A stale one is refused with 409 (details.reason stale_revision, details.current_revision).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeEditorSaved": {
        "properties": {
          "changes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "document": {
            "$ref": "#/components/schemas/ThemeEditorDocument"
          },
          "theme_changed": {
            "description": "A whole restore brought another theme back into the draft (ADR-0102): the editor opens again.",
            "type": "boolean"
          },
          "undo_checkpoint_id": {
            "description": "After a restore: the save point of the draft as it was just before; restoring it undoes the restore (ADR-0102).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "document",
          "changes"
        ],
        "type": "object"
      },
      "ThemeFooter": {
        "properties": {
          "bottom": {
            "description": "The copyright row's arrangement; absent keeps the default.",
            "properties": {
              "align": {
                "description": "spread (default), start or center.",
                "enum": [
                  "spread",
                  "start",
                  "center"
                ],
                "type": "string"
              },
              "order": {
                "description": "Each item once; missing items follow in the default order.",
                "items": {
                  "enum": [
                    "copyright",
                    "payments",
                    "powered"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "stack": {
                "description": "Items one under the other.",
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "builder": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FooterBuilder"
              }
            ],
            "description": "The footer laid out by the merchant (ADR-0071); absent keeps the settings' footer."
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ThemeFooterColumn"
            },
            "type": "array"
          },
          "contact": {
            "properties": {
              "email": {
                "type": "string"
              },
              "hours": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Working hours per language (tr, en, de), one line each; absent when none (ADR-0062).",
                "type": "object"
              },
              "phone": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "layout": {
            "description": "columns (default), centered or minimal; from the package's footer.layouts (engine 1.1.0).",
            "type": "string"
          },
          "payment_icons": {
            "description": "From the theme package's allow-list.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "show_newsletter": {
            "type": "boolean"
          },
          "social": {
            "items": {
              "$ref": "#/components/schemas/ThemeSocialLink"
            },
            "type": "array"
          },
          "text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "tone": {
            "description": "light, dark or tint; from the package's footer.tones (engine 1.1.0).",
            "type": "string"
          },
          "trust_badges": {
            "description": "From the theme package's allow-list.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeFooterColumn": {
        "properties": {
          "links": {
            "items": {
              "$ref": "#/components/schemas/ThemeMenuItem"
            },
            "type": "array"
          },
          "title": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeFreeDesignInput": {
        "properties": {
          "area": {
            "type": "string"
          },
          "design": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FreeDesignEntry"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "type": "string"
          },
          "revision": {
            "description": "The draft revision the change was made on (0 when there is no draft).",
            "type": "integer"
          }
        },
        "required": [
          "area",
          "language"
        ],
        "type": "object"
      },
      "ThemeFreeDesignRead": {
        "properties": {
          "area": {
            "type": "string"
          },
          "entry": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FreeDesignEntry"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "type": "string"
          },
          "languages": {
            "description": "The languages the area has a design in.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "live": {
            "description": "The design in this language is the live theme's as it is.",
            "type": "boolean"
          },
          "revision": {
            "description": "The theme draft's revision (0: no draft yet).",
            "type": "integer"
          }
        },
        "required": [
          "area",
          "language",
          "entry",
          "revision",
          "languages",
          "live"
        ],
        "type": "object"
      },
      "ThemeGalleryEntry": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "compatible": {
            "type": "boolean"
          },
          "demo": {
            "description": "The theme ships its own demo store (ADR-0072): the preview shows it, never the store's products.",
            "type": "boolean"
          },
          "demo_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "The demo catalogue's sizes: products, product_pictures, pictures, categories, collections, pages, posts.",
            "type": "object"
          },
          "demo_pages": {
            "description": "The demo store's pages the preview offers.",
            "items": {
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Per language (tr, en, de).",
                  "type": "object"
                },
                "path": {
                  "description": "A store path without the locale; empty for the home page.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "draft": {
            "type": "boolean"
          },
          "has_preset": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "preview_image": {
            "description": "A path on the storefront.",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "sections": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "settings": {
            "$ref": "#/components/schemas/ThemeSettings"
          },
          "tagline": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "version": {
            "type": "string"
          },
          "vertical": {
            "description": "fashion, electronics, home, food, beauty or single.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeGlobalStyles": {
        "description": "Global styles (\"Genel stiller\", ADR-0085 §6, VB-7): named colours a free layout's node names as global-\u003cn\u003e, text styles per device (H1–H6, body, small, button), the button and the spacing scale of free layouts. Every value is enumerated or bounded; absent keeps the theme's look.",
        "properties": {
          "button": {
            "$ref": "#/components/schemas/GlobalButtonStyle"
          },
          "colors": {
            "items": {
              "$ref": "#/components/schemas/GlobalColor"
            },
            "maxItems": 8,
            "type": "array"
          },
          "site_wide": {
            "description": "\"Tüm sitede kullan\": the text styles also style the theme's sections and the pages, not only free layouts (ADR-0067 amendment 2026-10-14). Off by default; dropped without text styles.",
            "type": "boolean"
          },
          "space": {
            "$ref": "#/components/schemas/GlobalSpace"
          },
          "text": {
            "additionalProperties": {
              "$ref": "#/components/schemas/GlobalTextStyle"
            },
            "description": "By style: h1 … h6, body, small, button.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeGroup": {
        "properties": {
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "header",
              "footer",
              "overlay"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeHeader": {
        "properties": {
          "announcement": {
            "$ref": "#/components/schemas/ThemeAnnouncement"
          },
          "bottom_nav": {
            "description": "A tab bar at the bottom of a phone screen (engine 1.1.0; the package's bottom_nav feature).",
            "type": "boolean"
          },
          "builder": {
            "allOf": [
              {
                "$ref": "#/components/schemas/HeaderBuilder"
              }
            ],
            "description": "The header laid out by the merchant (ADR-0071); absent keeps the settings' header."
          },
          "currency_switcher": {
            "enum": [
              "",
              "header",
              "footer",
              "none"
            ],
            "type": "string"
          },
          "hide_account": {
            "type": "boolean"
          },
          "hide_search": {
            "type": "boolean"
          },
          "language_switcher": {
            "enum": [
              "",
              "header",
              "footer",
              "none"
            ],
            "type": "string"
          },
          "layout": {
            "enum": [
              "",
              "left",
              "center",
              "split",
              "minimal"
            ],
            "type": "string"
          },
          "logo_size": {
            "enum": [
              "",
              "small",
              "medium",
              "large"
            ],
            "type": "string"
          },
          "mega_menu": {
            "type": "boolean"
          },
          "sticky": {
            "description": "Absent keeps the theme's default (sticky).",
            "type": [
              "boolean",
              "null"
            ]
          },
          "transparent": {
            "description": "Over the home page's first section.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ThemeHistory": {
        "properties": {
          "checkpoints": {
            "items": {
              "$ref": "#/components/schemas/ThemeCheckpoint"
            },
            "type": "array"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/ThemeHistoryVersion"
            },
            "type": "array"
          }
        },
        "required": [
          "checkpoints",
          "versions"
        ],
        "type": "object"
      },
      "ThemeHistoryVersion": {
        "properties": {
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "published_by_label": {
            "type": "string"
          },
          "restored_from": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "theme_id": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "version",
          "status",
          "theme_id",
          "published_by_label"
        ],
        "type": "object"
      },
      "ThemeIdentity": {
        "properties": {
          "favicon": {
            "description": "The browser tab's icon (square, at least 512 px); null when none.",
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "description": "The file's current address, resolved from the media library; empty when the file was removed.",
                "readOnly": true,
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "logo": {
            "description": "The logo; media_id null when none (its alt text may stay).",
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "description": "The file's current address, resolved from the media library; empty when the file was removed.",
                "readOnly": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "share_image": {
            "description": "The picture a shared link shows when a page has none of its own; null when none.",
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "description": "The file's current address, resolved from the media library; empty when the file was removed.",
                "readOnly": true,
                "type": "string"
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "logo",
          "favicon",
          "share_image"
        ],
        "type": "object"
      },
      "ThemeIdentityInput": {
        "properties": {
          "favicon": {
            "description": "The browser tab's icon (square, at least 512 px); null removes it.",
            "properties": {
              "alt": {
                "maxLength": 160,
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "logo": {
            "description": "The logo and its alt text; media_id null (or null) removes the logo.",
            "properties": {
              "alt": {
                "maxLength": 160,
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "share_image": {
            "description": "The picture a shared link shows; null removes it.",
            "properties": {
              "alt": {
                "maxLength": 160,
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ThemeInstance": {
        "properties": {
          "groups": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeGroup"
            },
            "type": "object"
          },
          "package_version": {
            "type": "string"
          },
          "published_version": {
            "type": "integer"
          },
          "settings": {
            "$ref": "#/components/schemas/ThemeSettings"
          },
          "status": {
            "enum": [
              "live",
              "library"
            ],
            "type": "string"
          },
          "templates": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeTemplate"
            },
            "type": "object"
          },
          "theme_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeLanguageFloating": {
        "description": "A language switcher fixed to a corner of the window (ADR-0079).",
        "properties": {
          "devices": {
            "description": "Where it shows; empty is all.",
            "enum": [
              "all",
              "desktop",
              "mobile"
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "position": {
            "description": "The corner; empty is bottom_right.",
            "enum": [
              "bottom_right",
              "bottom_left",
              "top_right",
              "top_left"
            ],
            "type": "string"
          },
          "tone": {
            "description": "Empty is light.",
            "enum": [
              "light",
              "dark"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeLanguagePlace": {
        "description": "The switcher in the header or the footer: whether it shows there (absent: header.language_switcher decides) and its own look there (an empty value takes the switcher's).",
        "properties": {
          "content": {
            "enum": [
              "flag_name",
              "flag",
              "name",
              "code",
              "flag_code"
            ],
            "type": "string"
          },
          "flag": {
            "enum": [
              "rect",
              "round",
              "square",
              "none"
            ],
            "type": "string"
          },
          "show": {
            "description": "Shown in this place.",
            "type": "boolean"
          },
          "style": {
            "enum": [
              "dropdown",
              "list",
              "popup"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeLanguageSwitcher": {
        "description": "How the store's languages are offered (ADR-0079): the look of the header and footer switchers (the builders' language elements take it with \"auto\"), each place's own choices (header, footer) and a floating switcher. An empty value is the default (the first listed): unset, a dropdown of flag and native name.",
        "properties": {
          "content": {
            "description": "What each language shows.",
            "enum": [
              "flag_name",
              "flag",
              "name",
              "code",
              "flag_code"
            ],
            "type": "string"
          },
          "current": {
            "description": "Whether the page's own language is listed.",
            "enum": [
              "show",
              "hide"
            ],
            "type": "string"
          },
          "flag": {
            "description": "The flag's shape.",
            "enum": [
              "rect",
              "round",
              "square",
              "none"
            ],
            "type": "string"
          },
          "floating": {
            "$ref": "#/components/schemas/ThemeLanguageFloating"
          },
          "footer": {
            "$ref": "#/components/schemas/ThemeLanguagePlace"
          },
          "header": {
            "$ref": "#/components/schemas/ThemeLanguagePlace"
          },
          "names": {
            "description": "Native names (Deutsch) or names in the page's language.",
            "enum": [
              "native",
              "translated"
            ],
            "type": "string"
          },
          "open": {
            "description": "Hover opens with a mouse on a computer; a click, a tap and the keyboard always do.",
            "enum": [
              "click",
              "hover"
            ],
            "type": "string"
          },
          "style": {
            "description": "A dropdown, the languages side by side, or a panel over the page.",
            "enum": [
              "dropdown",
              "list",
              "popup"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeLookSummary": {
        "properties": {
          "body_font": {
            "type": "string"
          },
          "heading_font": {
            "description": "The heading face's catalogue id (absent: the theme's own).",
            "type": "string"
          },
          "main": {
            "description": "The main colour (the theme's accent, or what stands for it).",
            "type": "string"
          },
          "sections": {
            "description": "The home page's section types in order (at most 8).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "swatch": {
            "description": "The page, text, main colour, tint and a band, as #rrggbb.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "swatch",
          "sections"
        ],
        "type": "object"
      },
      "ThemeManifest": {
        "description": "A theme package's manifest (constitution §12).",
        "properties": {
          "author": {
            "type": "string"
          },
          "capabilities": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "engine": {
            "description": "Theme engine range, e.g. \"\u003e=1.0.0 \u003c2.0.0\".",
            "type": "string"
          },
          "exclusive": {
            "description": "Set on a package only the platform's own store may use (ADR-0083): never offered in the gallery.",
            "enum": [
              "platform"
            ],
            "type": "string"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "migrations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "preview": {
            "properties": {
              "devices": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "image": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "sections": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "settings": {
            "additionalProperties": true,
            "type": "object"
          },
          "templates": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeMenuBadge": {
        "description": "A header link's badge (ADR-0063): its words per language (≤ 16 characters) and a tone the theme colours.",
        "properties": {
          "text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per language (tr, en, de).",
            "type": "object"
          },
          "tone": {
            "enum": [
              "new",
              "sale",
              "hot",
              "neutral"
            ],
            "type": "string"
          }
        },
        "required": [
          "text",
          "tone"
        ],
        "type": "object"
      },
      "ThemeMenuImage": {
        "description": "A header link's picture from the media library; `url` is resolved on read and never taken from a client.",
        "properties": {
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "media_id"
        ],
        "type": "object"
      },
      "ThemeMenuItem": {
        "properties": {
          "badge": {
            "$ref": "#/components/schemas/ThemeMenuBadge"
          },
          "children": {
            "description": "Header links only: a dropdown, or a panel with the mega menu on whose columns are these sub-links; a sub-link's own children are that column's links (two levels at most, at most 12 per column; ADR-0063).",
            "items": {
              "$ref": "#/components/schemas/ThemeMenuItem"
            },
            "type": "array"
          },
          "href": {
            "type": "string"
          },
          "image": {
            "$ref": "#/components/schemas/ThemeMenuImage"
          },
          "kind": {
            "description": "What the link was picked from (ADR-0071); the storefront builds the address in the visitor's language. Absent: a typed address.",
            "enum": [
              "page",
              "product",
              "collection",
              "category",
              "blog",
              "article"
            ],
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Label per language (tr, en, de).",
            "type": "object"
          },
          "ref": {
            "description": "The slug of the page, product, collection, category or article (empty for the blog).",
            "type": "string"
          }
        },
        "required": [
          "label",
          "href"
        ],
        "type": "object"
      },
      "ThemePackage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ThemeManifest"
          },
          {
            "properties": {
              "active": {
                "type": "boolean"
              },
              "compatible": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "ThemePackageDetail": {
        "properties": {
          "compatible": {
            "type": "boolean"
          },
          "engine_sections": {
            "additionalProperties": true,
            "type": "object"
          },
          "format": {
            "enum": [
              "2.0",
              "1.1"
            ],
            "type": "string"
          },
          "groups": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeGroup"
            },
            "type": "object"
          },
          "locales": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "object"
          },
          "manifest": {
            "$ref": "#/components/schemas/ThemeManifest"
          },
          "package": {
            "additionalProperties": true,
            "description": "theme.json of a 2.0 package.",
            "type": [
              "object",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "sections": {
            "additionalProperties": true,
            "type": "object"
          },
          "settings_schema": {
            "additionalProperties": true,
            "type": "object"
          },
          "styles": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "templates": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ThemeTemplate"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ThemeProductPage": {
        "description": "The product template (engine 1.1.0).",
        "properties": {
          "blocks": {
            "description": "Accordions under the description, the same on every product.",
            "items": {
              "properties": {
                "text": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Text per language (tr, en, de).",
                  "type": "object"
                },
                "title": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Text per language (tr, en, de).",
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "delivery_text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The store's own delivery promise per language.",
            "type": "object"
          },
          "installment_text": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The store's own instalment line per language.",
            "type": "object"
          },
          "layout": {
            "description": "gallery, thumbnails, stacked",
            "type": "string"
          },
          "recently_viewed": {
            "type": "boolean"
          },
          "related": {
            "type": "boolean"
          },
          "sticky_cart": {
            "type": "boolean"
          },
          "trust_badges": {
            "description": "From the package's trust badge allow-list.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "variant_picker": {
            "description": "select, buttons",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeRestoreInput": {
        "properties": {
          "area": {
            "type": "string"
          },
          "checkpoint_id": {
            "format": "int64",
            "type": "integer"
          },
          "reason": {
            "description": "What the save point kept first records: live for \"Yayınlanmış hâle dön\", else restore.",
            "enum": [
              "restore",
              "live"
            ],
            "type": "string"
          },
          "revision": {
            "description": "The draft revision this change was made on (0 when there is no draft yet). A stale one is refused with 409 (details.reason stale_revision, details.current_revision).",
            "minimum": 0,
            "type": "integer"
          },
          "version_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeRevertInput": {
        "properties": {
          "area": {
            "type": "string"
          },
          "revision": {
            "description": "The draft revision this change was made on (0 when there is no draft yet). A stale one is refused with 409 (details.reason stale_revision, details.current_revision).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeSchedule": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "done_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "publish_at": {
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "description": "The draft revision that goes live.",
            "type": "integer"
          },
          "status": {
            "description": "stale: the draft changed after it was scheduled, so nothing went live.",
            "enum": [
              "pending",
              "done",
              "stale",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "revision",
          "publish_at",
          "status",
          "created_by_label",
          "created_at"
        ],
        "type": "object"
      },
      "ThemeScheduleInput": {
        "properties": {
          "publish_at": {
            "description": "More than a minute and less than a year ahead.",
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "description": "The draft revision being scheduled (or If-Match).",
            "type": "integer"
          }
        },
        "required": [
          "publish_at"
        ],
        "type": "object"
      },
      "ThemeSettingDef": {
        "properties": {
          "default": {},
          "id": {
            "type": "string"
          },
          "label": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "max": {
            "type": "integer"
          },
          "min": {
            "type": "integer"
          },
          "options": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "responsive": {
            "description": "The setting may differ per device: the editor sends {d, t, m} (ADR-0068).",
            "type": "boolean"
          },
          "step": {
            "type": "integer"
          },
          "type": {
            "description": "color, font, select, checkbox, range, text, textarea, image, url or color_scheme.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "label"
        ],
        "type": "object"
      },
      "ThemeSettings": {
        "properties": {
          "appearance": {
            "description": "The colour scheme the storefront renders: auto (follows the visitor's device; the default, also when empty) or light (always the light palette, even on a device in dark mode). Limited to the package's manifest settings.appearances.",
            "type": "string"
          },
          "buttons": {
            "$ref": "#/components/schemas/ThemeButtons"
          },
          "cart": {
            "$ref": "#/components/schemas/ThemeCartPage"
          },
          "chat": {
            "$ref": "#/components/schemas/ThemeChat"
          },
          "collection": {
            "$ref": "#/components/schemas/ThemeCollectionPage"
          },
          "color_schemes": {
            "description": "The store's colour schemes (ADR-0067): sets of colours a section picks with its color_scheme setting. Absent: the package's own; the storefront's theme read always carries the effective list.",
            "items": {
              "$ref": "#/components/schemas/ThemeColorScheme"
            },
            "type": "array"
          },
          "colors": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Token → #rrggbb (background, surface, text, muted, accent, accent_text; engine 1.1.0 adds tint and sale).",
            "type": "object"
          },
          "custom": {
            "additionalProperties": true,
            "description": "A theme engine 2.0 package's own settings (settings_schema ids custom.\u003cname\u003e, stored without the prefix); read only by that theme's components.",
            "type": "object"
          },
          "custom_css": {
            "description": "The store's own CSS for the whole theme (ADR-0068): written as the merchant typed it (checked, at most 32 KB); the storefront reads it re-serialized. Changing it needs theme.publish.",
            "type": "string"
          },
          "favicon": {
            "description": "The browser tab's icon: a picture from the media library (ADR-0065), resolved like the logo. Absent: the storefront's own.",
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "readOnly": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "fonts": {
            "properties": {
              "body": {
                "type": "string"
              },
              "heading": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "footer": {
            "$ref": "#/components/schemas/ThemeFooter"
          },
          "free_design": {
            "$ref": "#/components/schemas/FreeDesign"
          },
          "global_styles": {
            "$ref": "#/components/schemas/ThemeGlobalStyles"
          },
          "header": {
            "$ref": "#/components/schemas/ThemeHeader"
          },
          "language_switcher": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ThemeLanguageSwitcher"
              }
            ],
            "description": "The language switcher's look and the floating switcher (ADR-0079); absent keeps the plain list of language names."
          },
          "logo": {
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "readOnly": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "menus": {
            "properties": {
              "footer": {
                "items": {
                  "$ref": "#/components/schemas/ThemeMenuItem"
                },
                "type": "array"
              },
              "header": {
                "items": {
                  "$ref": "#/components/schemas/ThemeMenuItem"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "product": {
            "$ref": "#/components/schemas/ThemeProductPage"
          },
          "responsive": {
            "additionalProperties": {
              "additionalProperties": {},
              "type": "object"
            },
            "description": "Tablet (t) and phone (m) values of the settings that may differ per device (type.base_size, style.image_ratio, and the site-wide sizes type.text_size, type.heading_size, type.nav_size, type.footer_heading_size, type.footer_text_size, type.footer_bar_size), by setting id; the computer's value is the setting itself (ADR-0068).",
            "type": "object"
          },
          "share_image": {
            "description": "The picture a shared link shows when a page has none of its own: a picture from the media library (ADR-0065).",
            "properties": {
              "alt": {
                "type": "string"
              },
              "media_id": {
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "url": {
                "readOnly": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "style": {
            "$ref": "#/components/schemas/ThemeStyle"
          },
          "type": {
            "$ref": "#/components/schemas/ThemeTypeScale"
          }
        },
        "type": "object"
      },
      "ThemeSettingsGroup": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Text per language (tr, en, de).",
            "type": "object"
          },
          "settings": {
            "items": {
              "$ref": "#/components/schemas/ThemeSettingDef"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "settings"
        ],
        "type": "object"
      },
      "ThemeSettingsSchema": {
        "properties": {
          "color_schemes": {
            "items": {
              "$ref": "#/components/schemas/ThemeColorScheme"
            },
            "type": "array"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/ThemeSettingsGroup"
            },
            "type": "array"
          }
        },
        "required": [
          "groups"
        ],
        "type": "object"
      },
      "ThemeSocialLink": {
        "properties": {
          "network": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeState": {
        "properties": {
          "color_keys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "draft": {
            "$ref": "#/components/schemas/ThemeVersion"
          },
          "fonts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "published": {
            "$ref": "#/components/schemas/ThemeVersion"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/ThemeVersion"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeStyle": {
        "description": "The look shared by every page (engine 1.1.0, ADR-0060). Every value must be one the package's manifest settings.style offers; empty keeps the storefront's default.",
        "properties": {
          "button_shape": {
            "description": "square, rounded, pill",
            "type": "string"
          },
          "card": {
            "description": "Product card: standard, minimal, bordered, elevated",
            "type": "string"
          },
          "card_align": {
            "description": "left, center",
            "type": "string"
          },
          "density": {
            "description": "comfortable, compact",
            "type": "string"
          },
          "heading_case": {
            "description": "normal, uppercase",
            "type": "string"
          },
          "heading_weight": {
            "description": "light, regular, medium, semibold, bold",
            "type": "string"
          },
          "hover_image": {
            "description": "The second picture on hover.",
            "type": "boolean"
          },
          "image_ratio": {
            "description": "square, portrait, landscape",
            "type": "string"
          },
          "new_badge_days": {
            "description": "A product created within this many days is marked new; 0 never.",
            "type": "integer"
          },
          "quick_add": {
            "description": "An add-to-cart button on a single-variant product's card.",
            "type": "boolean"
          },
          "radius": {
            "description": "none, small, medium, large",
            "type": "string"
          },
          "sale_badge": {
            "description": "none, percent, text",
            "type": "string"
          },
          "swatches": {
            "description": "A product's colours as dots on its card.",
            "type": "boolean"
          },
          "width": {
            "description": "standard (1200 px), wide (1440 px)",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ThemeTemplate": {
        "properties": {
          "sections": {
            "items": {
              "$ref": "#/components/schemas/TemplateSection"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ThemeTimeline": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/ThemeTimelineEntry"
            },
            "type": "array"
          },
          "has_draft": {
            "type": "boolean"
          },
          "more": {
            "description": "Older versions follow (before = the last version's number).",
            "type": "boolean"
          }
        },
        "required": [
          "entries",
          "more",
          "has_draft"
        ],
        "type": "object"
      },
      "ThemeTimelineEntry": {
        "properties": {
          "area": {
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "type": "string"
          },
          "changes": {
            "description": "A version: the areas it changed from the version before it (settings:\u003cgroup\u003e, template:\u003cname\u003e, group:\u003ctype\u003e, part:\u003cid\u003e, css), or theme.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "checkpoint_kind": {
            "enum": [
              "save",
              "auto"
            ],
            "type": "string"
          },
          "earlier": {
            "description": "A named save point of a draft published since.",
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "enum": [
              "version",
              "checkpoint"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "live": {
            "type": "boolean"
          },
          "look": {
            "$ref": "#/components/schemas/ThemeLookSummary"
          },
          "reason": {
            "type": "string"
          },
          "restored_from": {
            "type": "integer"
          },
          "theme_id": {
            "type": "string"
          },
          "theme_name": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "by",
          "label",
          "theme_id",
          "theme_name",
          "changes"
        ],
        "type": "object"
      },
      "ThemeTypeScale": {
        "description": "The type scale (ADR-0067); 0 or absent is the theme's own value. Each setting only where the package's settings schema offers it.",
        "properties": {
          "base_size": {
            "description": "Body text size in px, 14–20.",
            "type": "integer"
          },
          "body_spacing": {
            "description": "Body letter spacing in hundredths of an em, −2…10.",
            "type": "integer"
          },
          "body_weight": {
            "description": "300–700 in hundreds.",
            "type": "integer"
          },
          "footer_bar_size": {
            "description": "The footer's last row (copyright, payment logos) in per cent, 85–160 in steps of 5. May differ per device.",
            "type": "integer"
          },
          "footer_heading_size": {
            "description": "The footer's headings in per cent, 85–160 in steps of 5. May differ per device.",
            "type": "integer"
          },
          "footer_text_size": {
            "description": "The footer's texts and links in per cent, 85–160 in steps of 5. May differ per device.",
            "type": "integer"
          },
          "heading_size": {
            "description": "Every heading in per cent of the theme's own sizes, 70–150 in steps of 5. May differ per device.",
            "type": "integer"
          },
          "heading_spacing": {
            "description": "Heading letter spacing in hundredths of an em, −5…15.",
            "type": "integer"
          },
          "heading_weight": {
            "description": "300–900 in hundreds.",
            "type": "integer"
          },
          "line_height": {
            "description": "Body line height in hundredths, 120–200.",
            "type": "integer"
          },
          "nav_case": {
            "description": "The header menu's letter case (not offered by a theme with its own custom.nav_case).",
            "enum": [
              "normal",
              "uppercase"
            ],
            "type": "string"
          },
          "nav_size": {
            "description": "The header menu's text in per cent, 85–140 in steps of 5. May differ per device.",
            "type": "integer"
          },
          "nav_weight": {
            "description": "The header menu's letter weight, 300–800 in hundreds.",
            "type": "integer"
          },
          "scale": {
            "description": "Ratio between heading levels.",
            "enum": [
              "1.125",
              "1.2",
              "1.25",
              "1.333",
              "1.5"
            ],
            "type": "string"
          },
          "text_size": {
            "description": "Every text of the store in per cent of the theme's own sizes, 90–130 in steps of 5 (ADR-0067 amendment 2026-10-14; offered by every theme). May differ per device.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeVersion": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_label": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by_label": {
            "type": "string"
          },
          "restored_from": {
            "type": "integer"
          },
          "settings": {
            "$ref": "#/components/schemas/ThemeSettings"
          },
          "status": {
            "enum": [
              "draft",
              "published",
              "archived"
            ],
            "type": "string"
          },
          "theme_id": {
            "description": "The theme package these settings configure.",
            "type": "string"
          },
          "theme_version": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ThemeVersionNameInput": {
        "properties": {
          "label": {
            "maxLength": 80,
            "type": "string"
          }
        },
        "type": "object"
      },
      "TranslationAutoInput": {
        "properties": {
          "language": {
            "type": "string"
          },
          "publish": {
            "description": "Publish each translation through review at once; false leaves drafts in the review queue.",
            "type": "boolean"
          }
        },
        "required": [
          "language"
        ],
        "type": "object"
      },
      "TranslationAutoRun": {
        "properties": {
          "characters": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "failed": {
            "type": "integer"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "publish": {
            "type": "boolean"
          },
          "requested_by": {
            "type": "string"
          },
          "skipped": {
            "description": "Records a person started, or published machine translations a draft run leaves live.",
            "type": "integer"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "type": "string"
          },
          "translated": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TranslationAutoStatus": {
        "properties": {
          "provider": {
            "description": "The provider a run uses now; empty when none is set up.",
            "type": "string"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/TranslatorInfo"
            },
            "type": "array"
          },
          "runs": {
            "description": "Each language's latest run.",
            "items": {
              "$ref": "#/components/schemas/TranslationAutoRun"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TranslationGap": {
        "properties": {
          "entity": {
            "enum": [
              "product",
              "collection",
              "category",
              "page",
              "article"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "description": "The stored translation's state; empty when never started.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TranslationReviewItem": {
        "description": "One stored translation in the review queue.",
        "properties": {
          "entity": {
            "enum": [
              "product",
              "collection",
              "category"
            ],
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "language": {
            "type": "string"
          },
          "source": {
            "enum": [
              "human",
              "ai",
              "imported",
              "machine"
            ],
            "type": "string"
          },
          "status": {
            "description": "Review status (constitution §13). Only a published translation is served by store reads; empty for a language with nothing stored.",
            "enum": [
              "draft",
              "reviewed",
              "approved",
              "published"
            ],
            "type": "string"
          },
          "status_changed_at": {
            "format": "date-time",
            "type": "string"
          },
          "status_changed_by": {
            "description": "The operator (e-mail) who last moved the status.",
            "type": "string"
          },
          "title": {
            "description": "The record's default-language title.",
            "type": "string"
          },
          "translated_title": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "warnings": {
            "description": "How many glossary rules the text breaks.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TranslationStatusInput": {
        "properties": {
          "note": {
            "description": "Why (a rejection, typically); audited. At most 500 characters.",
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "reviewed",
              "approved",
              "published"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "type": "object"
      },
      "TranslationSummary": {
        "properties": {
          "default_language": {
            "type": "string"
          },
          "languages": {
            "items": {
              "properties": {
                "articles_missing": {
                  "type": "integer"
                },
                "articles_total": {
                  "description": "Blog posts published in the default language.",
                  "type": "integer"
                },
                "categories_missing": {
                  "type": "integer"
                },
                "categories_total": {
                  "type": "integer"
                },
                "collections_missing": {
                  "type": "integer"
                },
                "collections_total": {
                  "type": "integer"
                },
                "in_review": {
                  "description": "Stored translations in this language (every entity) not published yet.",
                  "type": "integer"
                },
                "language": {
                  "type": "string"
                },
                "legal_missing": {
                  "type": "integer"
                },
                "legal_total": {
                  "description": "Legal text kinds published in the default language.",
                  "type": "integer"
                },
                "menus_missing": {
                  "description": "Of those, the ones empty in this language.",
                  "type": "integer"
                },
                "menus_total": {
                  "description": "The menus' per-language texts with default-language text.",
                  "type": "integer"
                },
                "pages_missing": {
                  "description": "Of those, the ones not published in this language.",
                  "type": "integer"
                },
                "pages_total": {
                  "description": "Pages published in the default language.",
                  "type": "integer"
                },
                "products_missing": {
                  "description": "Non-archived products lacking a complete translation.",
                  "type": "integer"
                },
                "products_total": {
                  "description": "Non-archived products.",
                  "type": "integer"
                },
                "theme_missing": {
                  "type": "integer"
                },
                "theme_total": {
                  "description": "The published theme's and the store details' per-language texts with default-language text.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TranslatorInfo": {
        "properties": {
          "code": {
            "type": "string"
          },
          "configured": {
            "description": "Switched on with its key entered.",
            "type": "boolean"
          },
          "module": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "description": "The provenance its translations carry.",
            "enum": [
              "machine",
              "ai"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TurnstileCheck": {
        "properties": {
          "checked": {
            "enum": [
              "widget",
              "secret"
            ],
            "type": "string"
          },
          "hostname": {
            "description": "Where the widget ran, when Cloudflare said.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "problem": {
            "description": "Absent when ok: secret (Cloudflare does not know the secret), token (the widget's answer was refused) or unreachable.",
            "enum": [
              "secret",
              "token",
              "unreachable"
            ],
            "type": "string"
          }
        },
        "required": [
          "ok",
          "checked"
        ],
        "type": "object"
      },
      "TurnstileInput": {
        "properties": {
          "secret": {
            "description": "Write-only; empty keeps the stored secret.",
            "maxLength": 200,
            "type": "string"
          },
          "site_key": {
            "maxLength": 100,
            "type": "string"
          },
          "token": {
            "description": "A widget's answer rendered with site_key, for the check.",
            "maxLength": 2048,
            "type": "string"
          }
        },
        "type": "object"
      },
      "TurnstileSettings": {
        "properties": {
          "active": {
            "description": "What guards the forms on the host the admin is on.",
            "enum": [
              "store",
              "platform",
              "none"
            ],
            "type": "string"
          },
          "own_hosts": {
            "description": "The store's hosts outside NeroCart's domain: where its own keys apply.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "platform_covered": {
            "description": "The platform's keys guard the store's NeroCart address.",
            "type": "boolean"
          },
          "secret_set": {
            "description": "A secret is kept (sealed). It is never returned.",
            "type": "boolean"
          },
          "site_key": {
            "description": "The store's own site key; empty when it set none.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "site_key",
          "secret_set",
          "active",
          "platform_covered",
          "own_hosts"
        ],
        "type": "object"
      },
      "UnitPricing": {
        "description": "Birim fiyat (Fiyat Etiketi Yönetmeliği, ADR-0074): the price per reference unit, computed from the price answered beside it, half up, in its currency.",
        "properties": {
          "measure": {
            "enum": [
              "g",
              "kg",
              "ml",
              "cl",
              "l",
              "m3",
              "cm",
              "m",
              "m2",
              "piece"
            ],
            "type": "string"
          },
          "quantity": {
            "description": "The net quantity as a decimal with a point (\"250\", \"1.5\").",
            "type": "string"
          },
          "reference": {
            "description": "What the unit price is per.",
            "enum": [
              "100g",
              "kg",
              "100ml",
              "l",
              "m3",
              "m",
              "m2",
              "piece"
            ],
            "type": "string"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "quantity",
          "measure",
          "reference"
        ],
        "type": "object"
      },
      "UnitPricingInput": {
        "properties": {
          "measure": {
            "description": "Empty takes the unit price off.",
            "enum": [
              "",
              "g",
              "kg",
              "ml",
              "cl",
              "l",
              "m3",
              "cm",
              "m",
              "m2",
              "piece"
            ],
            "type": "string"
          },
          "quantity": {
            "description": "A decimal (\"250\", \"1,5\", \"0.75\"); at most three decimals.",
            "type": "string"
          },
          "reference": {
            "description": "Empty: the measure's usual one (g→kg, ml/cl→l, cm→m).",
            "enum": [
              "",
              "100g",
              "kg",
              "100ml",
              "l",
              "m3",
              "m",
              "m2",
              "piece"
            ],
            "type": "string"
          }
        },
        "required": [
          "measure"
        ],
        "type": "object"
      },
      "UnmappedDecline": {
        "properties": {
          "code": {
            "type": "string"
          },
          "first_seen": {
            "format": "date-time",
            "type": "string"
          },
          "last_seen": {
            "format": "date-time",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "seen": {
            "type": "integer"
          }
        },
        "required": [
          "provider",
          "provider_name",
          "code",
          "seen",
          "first_seen",
          "last_seen"
        ],
        "type": "object"
      },
      "UnremittedCOD": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "carrier": {
            "type": "string"
          },
          "days_out": {
            "type": "integer"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "fulfillment_id": {
            "format": "int64",
            "type": "integer"
          },
          "method": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tracking": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Variant": {
        "description": "The sellable unit: SKU, price and stock live here, and cart and order lines reference it. A product with no options still has exactly one.",
        "properties": {
          "active": {
            "type": "boolean"
          },
          "at_location": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VariantStock"
              }
            ],
            "description": "This variant's holding at one place. Present only on the reads that are about a place — a location's stock listing, and the low-stock report for one location. `stock_on_hand` above stays the store-wide sum in the same row; both are true and they answer different questions."
          },
          "available": {
            "description": "on hand minus reserved.",
            "type": "integer"
          },
          "barcode": {
            "type": "string"
          },
          "compare_at_price": {
            "$ref": "#/components/schemas/Money"
          },
          "continue_selling": {
            "description": "Take the order when the count has run out, instead of refusing it.",
            "type": "boolean"
          },
          "cost": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "What the item cost this store, for margin reporting. Absent means nobody has recorded a cost — which is not the same as a cost of zero, and the difference matters: a zero would report a 100% margin on something nobody has costed. A storefront never sees this."
          },
          "dimension_unit": {
            "description": "How the sides should be read, exactly as `weight_unit` says how a mass should be read. The millimetres are the fact; the unit is presentation, kept so an operator who typed 30 cm sees 30 cm again and not 300 mm. One unit covers all three sides, because a box is measured in a single unit by whoever holds the tape.",
            "enum": [
              "mm",
              "cm",
              "m",
              "in"
            ],
            "type": "string"
          },
          "dimensions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dimensions"
              }
            ],
            "description": "Absent when nobody has measured the parcel, which is the normal case for most variants."
          },
          "for_sale": {
            "description": "Present on the store API's reads only: whether the variant has a price in the market the request sells in (X-Market, else the visitor's country, else the store default). `price` is then that market's price for one unit, by the same rule a basket opened in the market applies (the variant's price in that currency, price lists in that currency, never a conversion). False means the variant cannot be bought in this market and `price` is zero in its currency. On the store API `compare_at_price` is the one recorded for the market's currency (the base-currency one only in the base currency), shown only above `price`; `cost` never appears.",
            "type": "boolean"
          },
          "hs_code": {
            "description": "Tariff number, 6 to 12 digits (12: Türkiye's GTİP).",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "image": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VariantImage"
              }
            ],
            "description": "The first of `images`, kept as the thumbnail. Absent when the variant shows none, which is the normal case for most variants."
          },
          "images": {
            "description": "The product's pictures this variant shows, in order — what a storefront swaps to when a shopper picks a colour. Absent for most variants. Several variants may list the same picture.",
            "items": {
              "$ref": "#/components/schemas/VariantImage"
            },
            "type": "array"
          },
          "label": {
            "example": "M / Black",
            "type": "string"
          },
          "licence_keys": {
            "$ref": "#/components/schemas/VariantLicenceKeys"
          },
          "manufacturer_code": {
            "description": "The maker's own code for the variant (model, part or product number on the box); sent to customs as the manufacturer's product identifier beside the SKU and the barcode.",
            "maxLength": 100,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "options": {
            "example": [
              "M",
              "Black"
            ],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "origin_country": {
            "description": "Where the item was made, ISO 3166-1 alpha-2.",
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "preorder": {
            "$ref": "#/components/schemas/Preorder"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "price_hidden": {
            "description": "Storefront reads only: sold to dealers only and this visitor is not one; price is a zero and for_sale false (ADR-0091 §2).",
            "type": "boolean"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "product_image_url": {
            "description": "The product's lead picture (the first image of its media). Filled on the stock listings only.",
            "readOnly": true,
            "type": "string"
          },
          "product_title": {
            "description": "The product's name. Filled on the stock listings only (a location's stock, low stock), so a stock card shows what it counts.",
            "readOnly": true,
            "type": "string"
          },
          "quantity_rule": {
            "$ref": "#/components/schemas/QuantityRule"
          },
          "requires_shipping": {
            "description": "Whether the thing is sent at all. False for a download, a service or a gift card: nothing is charged to send it, and a basket holding nothing else is asked for no delivery option. Shopify's Variant Requires Shipping.",
            "type": "boolean"
          },
          "size": {
            "description": "The same parcel rendered for display, so a client that only shows it need not know that an inch is 25.4 mm. A side nobody measured reads as an em dash rather than being hidden, so a half-finished parcel says which side is missing.",
            "example": "30 × 20 × 45 cm",
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "stock_on_hand": {
            "description": "Physically on the shelf, including units promised to open orders. Summed across every location — `GET /api/admin/variants/{id}/stock` is the breakdown.",
            "type": "integer"
          },
          "stock_reserved": {
            "description": "Promised to orders in flight but not yet taken off the shelf. Summed across every location.",
            "type": "integer"
          },
          "taxable": {
            "description": "Whether tax applies to this variant. True for almost everything, and the safe default to be wrong about: tax charged in error is refundable, tax not charged is not. It sits on the variant rather than the product because a gift card and a shirt can share a product's shape and not its tax treatment.",
            "type": "boolean"
          },
          "track_inventory": {
            "type": "boolean"
          },
          "unit_pricing": {
            "$ref": "#/components/schemas/UnitPricing"
          },
          "weight": {
            "description": "The same mass rendered for display, so a client that only shows it need not know that a pound is 453.59237 g.",
            "example": "2.5 kg",
            "type": "string"
          },
          "weight_grams": {
            "description": "The canonical stored weight. Whole grams, because that is the resolution a carrier API is given and a float that cannot represent 0.1 exactly would eventually produce a total that does not add up.",
            "type": "integer"
          },
          "weight_unit": {
            "description": "How the weight should be read, exactly as a currency code says how an amount should be read. The grams are the fact; the unit is presentation, kept so an operator who typed 2.5 kg sees 2.5 kg again and not 2500 g.",
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "This variant's own exception to the right of withdrawal; null inherits the product's (ADR-0088 §1).",
            "enum": [
              "none",
              "price_fluctuating",
              "personalised",
              "perishable",
              "hygiene_opened",
              "mixed_inseparable",
              "sealed_media_opened",
              "periodicals",
              "dated_leisure",
              "instant_digital",
              "instant_service",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "VariantImage": {
        "description": "One of its product's pictures a variant shows — what a storefront swaps to when a shopper picks a colour. A variant never owns a file; it points at ones the product already shows, so the same picture is stored once however many sizes share it.",
        "properties": {
          "alt": {
            "type": "string"
          },
          "height": {
            "description": "The file's height in pixels, when the media library knows it.",
            "type": [
              "integer",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "image",
              "video",
              "model"
            ],
            "type": "string"
          },
          "media_id": {
            "format": "int64",
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "width": {
            "description": "The file's width in pixels, when the media library knows it.",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "VariantInput": {
        "properties": {
          "active": {
            "default": true,
            "type": "boolean"
          },
          "barcode": {
            "type": "string"
          },
          "compare_at_price_minor": {
            "description": "Omitted or null records no compare-at price. On create there is nothing to leave alone, which is why this is not the three-state field the patch has.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "continue_selling": {
            "default": false,
            "description": "Take the order when the count has run out, instead of refusing it.",
            "type": "boolean"
          },
          "cost_minor": {
            "description": "Cost in the store's minor units. Send null to clear a recorded cost.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "dimension_unit": {
            "default": "mm",
            "description": "How the sides should be read, exactly as `weight_unit` says how a mass should be read. The millimetres are the fact; the unit is presentation, kept so an operator who typed 30 cm sees 30 cm again and not 300 mm. One unit covers all three sides, because a box is measured in a single unit by whoever holds the tape.",
            "enum": [
              "mm",
              "cm",
              "m",
              "in"
            ],
            "type": "string"
          },
          "dimensions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Dimensions"
              }
            ],
            "description": "The parcel in millimetres. The API's shape; a form should send `size` and `dimension_unit` instead."
          },
          "hs_code": {
            "description": "Tariff number, 6 to 12 digits (12: Türkiye's GTİP).",
            "type": "string"
          },
          "manufacturer_code": {
            "description": "The maker's own code for the variant (model, part or product number on the box); sent to customs as the manufacturer's product identifier beside the SKU and the barcode.",
            "maxLength": 100,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "options": {
            "description": "The value chosen on each of the product's axes, in any order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "origin_country": {
            "description": "Where the item was made, ISO 3166-1 alpha-2.",
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "preorder": {
            "$ref": "#/components/schemas/PreorderInput"
          },
          "price_minor": {
            "format": "int64",
            "type": "integer"
          },
          "quantity_rule": {
            "$ref": "#/components/schemas/QuantityRule"
          },
          "requires_shipping": {
            "default": true,
            "description": "Whether the thing is sent at all. False for a download, a service or a gift card: nothing is charged to send it, and a basket holding nothing else is asked for no delivery option. Shopify's Variant Requires Shipping.",
            "type": "boolean"
          },
          "size": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DimensionValues"
              }
            ]
          },
          "sku": {
            "description": "Optional. Left out, the variant is named after its product — the slug, then its option values, upper-cased and hyphenated, which is the rule the option matrix has always used for the variants it generates. A derived code that is already taken is numbered rather than refused, since nobody chose it. A SKU sent here is used exactly as given, and a collision with one of those is a conflict.",
            "type": "string"
          },
          "stock_on_hand": {
            "type": "integer"
          },
          "taxable": {
            "default": true,
            "type": "boolean"
          },
          "track_inventory": {
            "default": true,
            "type": "boolean"
          },
          "unit_pricing": {
            "$ref": "#/components/schemas/UnitPricingInput"
          },
          "weight": {
            "description": "The weight in `weight_unit`, converted server-side. Sent together with the unit this is a form's shape; when both this and `weight_grams` arrive, this one wins — a caller that computed grams itself and then also sent a value contradicted itself, and the human-entered number is the one a person can check.",
            "type": "number"
          },
          "weight_grams": {
            "description": "The weight in grams. The API's shape; a form should send `weight` and `weight_unit` instead.",
            "type": "integer"
          },
          "weight_unit": {
            "default": "g",
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "type": "string"
          },
          "withdrawal_exception": {
            "description": "The variant's own exception (Product.withdrawal_exception's values); null, \"\" or \"inherit\" inherits the product's.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "price_minor"
        ],
        "type": "object"
      },
      "VariantLicenceKeys": {
        "description": "Set on a variant sold from a licence-key pool (ADR-0088 §2): its stock is its unused codes.",
        "properties": {
          "max_per_customer": {
            "description": "How many units one customer may buy; absent when no limit.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "VariantPrice": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "type": "integer"
          },
          "auto": {
            "description": "True for a price the exchange rate made (an automatic currency); false for one set by hand, which the rate never overwrites. Setting a different amount by hand makes it false.",
            "type": "boolean"
          },
          "compare_at_minor": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "example": "EUR",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "currency",
          "amount_minor",
          "updated_at"
        ],
        "type": "object"
      },
      "VariantPriceInput": {
        "properties": {
          "amount_minor": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "compare_at_minor": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "amount_minor"
        ],
        "type": "object"
      },
      "VariantPricing": {
        "properties": {
          "breaks": {
            "items": {
              "$ref": "#/components/schemas/PriceBreak"
            },
            "type": "array"
          },
          "price": {
            "$ref": "#/components/schemas/Money"
          },
          "regular": {
            "$ref": "#/components/schemas/Money"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "price",
          "regular",
          "breaks"
        ],
        "type": "object"
      },
      "VariantSale": {
        "properties": {
          "active": {
            "description": "Whether the variant sells at the sale price now.",
            "type": "boolean"
          },
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "prices": {
            "description": "The pair in every other currency the variant is priced in; the window is theirs too.",
            "items": {
              "$ref": "#/components/schemas/CurrencySale"
            },
            "type": "array"
          },
          "regular_minor": {
            "description": "The regular price, in the base currency's minor units.",
            "format": "int64",
            "type": "integer"
          },
          "sale_minor": {
            "description": "The sale price; null: no sale.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "variant_id",
          "regular_minor",
          "sale_minor",
          "starts_at",
          "ends_at",
          "active",
          "prices"
        ],
        "type": "object"
      },
      "VariantSaleInput": {
        "properties": {
          "ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "prices": {
            "description": "The pair in other currencies; a currency left out is left as it is.",
            "items": {
              "$ref": "#/components/schemas/CurrencySale"
            },
            "type": "array"
          },
          "regular_minor": {
            "format": "int64",
            "type": "integer"
          },
          "sale_minor": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "starts_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "regular_minor"
        ],
        "type": "object"
      },
      "VariantStock": {
        "description": "One variant's holding at one location. Every location is listed, including those holding none of it — that is where a transfer would be sent.",
        "properties": {
          "active": {
            "description": "Whether this location can fill orders.",
            "type": "boolean"
          },
          "available": {
            "description": "`on_hand - reserved`, at this location.",
            "type": "integer"
          },
          "incoming": {
            "description": "Units on their way to this location (a purchase order, a transfer), set by the operator. Never part of `available`.",
            "type": "integer"
          },
          "location_code": {
            "type": "string"
          },
          "location_id": {
            "format": "int64",
            "type": "integer"
          },
          "location_name": {
            "type": "string"
          },
          "on_hand": {
            "type": "integer"
          },
          "reserved": {
            "type": "integer"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "VariantTranslation": {
        "properties": {
          "label": {
            "description": "The default-language label, for reference; ignored on write.",
            "type": "string"
          },
          "title": {
            "description": "Empty derives the title from the translated option values.",
            "type": "string"
          },
          "variant_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Vendor": {
        "description": "A seller on this store. Not a brand: `products.vendor` is free text holding the manufacturer (\"Anker\"), which is what a Google feed sends as `brand`, and it is a different field with a different meaning. On a single-merchant store there are no vendors at all and the variant’s own price and stock are the shop selling its own goods.",
        "properties": {
          "about": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/VendorAddress"
          },
          "commission_bp": {
            "description": "What this store takes, in basis points — 250 is 2.5%. Recorded, not settled: nothing computes a payout from it yet (PLAN.md §39.10).",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "legal_name": {
            "description": "The name on the invoice, when it differs from the one over the shop.",
            "type": "string"
          },
          "logo_media_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "slug": {
            "description": "The handle in /vendor/{slug}. Unique, and it does not follow a rename.",
            "type": "string"
          },
          "status": {
            "description": "pending is the default: a marketplace that lists whoever signs up is not moderating. Only approved sellers appear on the storefront; suspended keeps the row, the offers and the history.",
            "enum": [
              "pending",
              "approved",
              "suspended"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "VendorAddress": {
        "description": "Where the seller trades from — what goes on an invoice and what a tax rule keys off.",
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": "string"
          },
          "postal_code": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "VendorInput": {
        "properties": {
          "about": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/VendorAddress"
          },
          "commission_bp": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "logo_media_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "slug": {
            "description": "Derived from the name when absent.",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "suspended"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "VendorPatch": {
        "description": "An absent field is left alone. `slug` is not patchable — a handle is a URL somebody has linked to.",
        "properties": {
          "about": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/VendorAddress"
          },
          "commission_bp": {
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "logo_media_id": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "suspended"
            ],
            "type": "string"
          },
          "tax_id": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "VisitChannel": {
        "properties": {
          "medium": {
            "type": "string"
          },
          "orders": {
            "type": "integer"
          },
          "revenue": {
            "$ref": "#/components/schemas/Money"
          },
          "sessions": {
            "type": "integer"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source",
          "medium",
          "sessions",
          "orders",
          "revenue"
        ],
        "type": "object"
      },
      "VisitCount": {
        "properties": {
          "key": {
            "type": "string"
          },
          "n": {
            "type": "integer"
          }
        },
        "required": [
          "key",
          "n"
        ],
        "type": "object"
      },
      "VisitEvent": {
        "description": "One event of the storefront's own visitor beacon.",
        "properties": {
          "e": {
            "description": "pageview; ping (the page is still in front, `ms` of attention since the last one, at most 30 s counted); order (the confirmation page of `order`, proven by its `token`).",
            "enum": [
              "pageview",
              "ping",
              "order"
            ],
            "type": "string"
          },
          "l": {
            "type": "string"
          },
          "ms": {
            "type": "integer"
          },
          "order": {
            "type": "string"
          },
          "r": {
            "description": "document.referrer; only its host and path are kept.",
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "u": {
            "description": "The page's path and query; the query is read for utm_* and ad click ids, never stored.",
            "type": "string"
          }
        },
        "required": [
          "e"
        ],
        "type": "object"
      },
      "VisitPageView": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "engaged_ms": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "at",
          "engaged_ms"
        ],
        "type": "object"
      },
      "VisitSession": {
        "description": "One visit: where it came from, the pages it saw, how long it stayed.",
        "properties": {
          "campaign": {
            "type": "string"
          },
          "click_id": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "device": {
            "enum": [
              "mobile",
              "tablet",
              "desktop",
              "other"
            ],
            "type": "string"
          },
          "engaged_ms": {
            "format": "int64",
            "type": "integer"
          },
          "exit_path": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "landing_path": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "last_seen_at": {
            "format": "date-time",
            "type": "string"
          },
          "live": {
            "type": "boolean"
          },
          "medium": {
            "type": "string"
          },
          "order_id": {
            "format": "int64",
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "pages": {
            "description": "Only when one visit is read.",
            "items": {
              "$ref": "#/components/schemas/VisitPageView"
            },
            "type": "array"
          },
          "pageviews": {
            "type": "integer"
          },
          "referrer": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "started_at",
          "last_seen_at",
          "live",
          "landing_path",
          "exit_path",
          "source",
          "medium",
          "device",
          "pageviews",
          "engaged_ms"
        ],
        "type": "object"
      },
      "VisitSummary": {
        "description": "The store's own visits over a period, in the store's time zone.",
        "properties": {
          "all_orders": {
            "description": "Every order placed in the period, credited or not.",
            "type": "integer"
          },
          "avg_engaged_ms": {
            "format": "int64",
            "type": "integer"
          },
          "bounces": {
            "description": "Visits of one page and under ten seconds.",
            "type": "integer"
          },
          "channels": {
            "items": {
              "$ref": "#/components/schemas/VisitChannel"
            },
            "type": "array"
          },
          "countries": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "currency": {
            "type": "string"
          },
          "daily": {
            "items": {
              "properties": {
                "date": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "sessions": {
                  "type": "integer"
                },
                "visitors": {
                  "type": "integer"
                }
              },
              "required": [
                "date",
                "visitors",
                "sessions",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "days": {
            "type": "integer"
          },
          "devices": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "from": {
            "format": "date",
            "type": "string"
          },
          "landings": {
            "items": {
              "properties": {
                "orders": {
                  "type": "integer"
                },
                "path": {
                  "type": "string"
                },
                "sessions": {
                  "type": "integer"
                }
              },
              "required": [
                "path",
                "sessions",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "live": {
            "description": "Visits seen in the last two minutes.",
            "type": "integer"
          },
          "orders": {
            "description": "Orders credited to a visit.",
            "type": "integer"
          },
          "pages": {
            "items": {
              "properties": {
                "avg_engaged_ms": {
                  "format": "int64",
                  "type": "integer"
                },
                "path": {
                  "type": "string"
                },
                "views": {
                  "type": "integer"
                }
              },
              "required": [
                "path",
                "views",
                "avg_engaged_ms"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pageviews": {
            "type": "integer"
          },
          "referrers": {
            "items": {
              "$ref": "#/components/schemas/VisitCount"
            },
            "type": "array"
          },
          "revenue": {
            "$ref": "#/components/schemas/Money"
          },
          "sessions": {
            "type": "integer"
          },
          "visitors": {
            "description": "Distinct daily visitor hashes: one person on two days counts twice.",
            "type": "integer"
          }
        },
        "required": [
          "days",
          "from",
          "currency",
          "live",
          "visitors",
          "sessions",
          "pageviews",
          "avg_engaged_ms",
          "bounces",
          "orders",
          "revenue",
          "all_orders",
          "daily",
          "channels",
          "pages",
          "landings",
          "devices",
          "countries",
          "referrers"
        ],
        "type": "object"
      },
      "VolumeSplit": {
        "description": "The target share of the money per POS, for single payments (ADR-0140).",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "period": {
            "enum": [
              "day",
              "month"
            ],
            "type": "string"
          },
          "shares": {
            "additionalProperties": {
              "maximum": 100,
              "minimum": 0,
              "type": "integer"
            },
            "description": "Target percentage per POS; at most 100 together.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "WebhookDelivery": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "available_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "endpoint_id": {
            "format": "int64",
            "type": "integer"
          },
          "event_id": {
            "type": "string"
          },
          "event_name": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "last_status": {
            "type": "integer"
          },
          "state": {
            "enum": [
              "pending",
              "delivered",
              "dead"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookEndpoint": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "previous_secret_expires_at": {
            "description": "While set, the secret replaced by the last rotation still signs deliveries (a second `v1=` in X-NeroCart-Signature) until this time. The previous secret itself is never returned.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "secret_hint": {
            "description": "The last four characters of the signing secret.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookEndpointWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookEndpoint"
          },
          {
            "properties": {
              "secret": {
                "description": "Returned only on create and rotate. Verify with HMAC-SHA256 over `\u003ctimestamp\u003e.\u003cbody\u003e`, the timestamp from `t=` in X-NeroCart-Signature (`t=\u003cts\u003e,v1=\u003chex\u003e[,v1=\u003chex\u003e]`); accept when any `v1=` matches. Every delivery also carries X-NeroCart-Event (the event name), X-NeroCart-Event-Id (the event id, the receiver's idempotency key), X-NeroCart-Event-Version (the payload's schema version, also `v` in the body: the event's `data` follows kernel/events/schemas/\u003cevent\u003e.v\u003cN\u003e.json) and X-NeroCart-Delivery-Id (this store's delivery row, the same on every retry).",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "WebhookEventRow": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "events": {
            "type": "integer"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "last_error": {
            "type": "string"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "processed_at": {
            "format": "date-time",
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "received_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "processed",
              "failed",
              "dead"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "provider",
          "provider_name",
          "status",
          "events",
          "attempts",
          "received_at"
        ],
        "type": "object"
      },
      "WholesaleSettings": {
        "description": "The store's wholesale choices (ADR-0091). The defaults are a store that never opened the screen: prices for everyone, no applications, no quotes.",
        "properties": {
          "applications_open": {
            "description": "Signed-in customers may apply to become dealers.",
            "type": "boolean"
          },
          "default_group_id": {
            "description": "The dealer group an application is approved into unless the operator picks another; null: \"Bayiler\", made on the first approval.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "price_visibility": {
            "description": "\"dealers\": only approved dealers see a price or an add to basket, on every product (a product may also choose it alone: dealer_only).",
            "enum": [
              "everyone",
              "dealers"
            ],
            "type": "string"
          },
          "quotes_enabled": {
            "description": "The product page and the basket offer \"Teklif iste\".",
            "type": "boolean"
          }
        },
        "required": [
          "price_visibility",
          "applications_open",
          "default_group_id",
          "quotes_enabled"
        ],
        "type": "object"
      },
      "Wishlist": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "product_id": {
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "product_id",
                "created_at"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "WishlistCount": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "last_added_at": {
            "format": "date-time",
            "type": "string"
          },
          "product_id": {
            "format": "int64",
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "title",
          "slug",
          "count",
          "last_added_at"
        ],
        "type": "object"
      },
      "WithdrawalAcknowledgement": {
        "description": "The shopper's acknowledgement at checkout that the right of withdrawal ends for the lines it names: the sentence they ticked, word for word (ADR-0088 §1).",
        "properties": {
          "accepted_at": {
            "format": "date-time",
            "type": "string"
          },
          "exceptions": {
            "items": {
              "enum": [
                "instant_digital",
                "instant_service"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "language": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "statement": {
            "type": "string"
          }
        },
        "required": [
          "exceptions",
          "language",
          "statement",
          "sha256",
          "accepted_at"
        ],
        "type": "object"
      },
      "XMLImportResult": {
        "properties": {
          "job": {
            "$ref": "#/components/schemas/ImportJob"
          },
          "report": {
            "properties": {
              "items": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              }
            },
            "required": [
              "items",
              "skipped"
            ],
            "type": "object"
          }
        },
        "required": [
          "job",
          "report"
        ],
        "type": "object"
      },
      "YurticiTestResult": {
        "properties": {
          "error": {
            "description": "Yurtiçi Kargo's reason when the test failed.",
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "adminToken": {
        "description": "Either a static token from Config.AdminTokens — the right credential for a script, since it has no session and no expiry — or a superuser session token from /api/admin/auth-with-password, which is the right credential for a person. Both arrive the same way and satisfy the same middleware.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The NeroCart API. Every store answers it on its own domain: the storefront under /api/v1/store (the catalogue, the cart, checkout, orders, customer accounts, content and legal texts; no credentials) and the merchant admin under /api/v1/admin (orders, products, stock, customers, discounts, shipping, invoices, reports and every module).\n\n**Authentication.** Admin calls carry `Authorization: Bearer \u003ckey\u003e`. A key is made in the store's panel (Settings › API keys), shown once, stored only as its hash, limited to the areas chosen for it (read, write or both), and may end on a date and be bound to IP addresses. Third-party apps use OAuth 2.0 with PKCE.\n\n**Money.** Always an integer count of the currency's minor unit plus its code — never a float.\n\n**Answers.** `{\"data\": …}` or `{\"error\": {\"code\", \"message\", \"details\"}}`; every response carries X-Request-Id.\n\n**Pagination.** Lists take `limit` (≤ 200) and `offset` or `page`, answer `meta` (total, has_more…) and a Link header (RFC 8288) with first, prev, next and last.\n\n**Idempotency.** Any POST, PUT, PATCH or DELETE may carry `Idempotency-Key`: a repeat gets the first answer (Idempotent-Replayed: true) and changes nothing.\n\n**Rate limits.** Per key, per address and per store; RateLimit-Limit, RateLimit-Remaining and, on 429, Retry-After.\n\n**Webhooks.** Signed in X-NeroCart-Signature (`t=\u003cunix\u003e,v1=\u003cHMAC-SHA256 of \"\u003ct\u003e.\u003cbody\u003e\"\u003e`), with X-NeroCart-Event, -Event-Id, -Event-Version and -Delivery-Id; retried with backoff.\n\n**Versions.** /api/v1 only grows: a field or a route is never removed or changed in meaning within v1. Guides: https://nerocart.com/developers\n\nMoney is always an integer count of the currency's minor unit plus its code — never a float, never a formatted string. The number of decimal places belongs to the currency (USD has 2, JPY has 0, KWD has 3) and formatting belongs to the client.\n\nEvery response is `{\"data\": ...}` or `{\"error\": {\"code\", \"message\"}}`. Every collection paginates.\n\nGuest checkout is permanent: a shopper needs a cart token and an email, never an account.",
    "title": "NeroCart API",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/admin/account": {
      "get": {
        "description": "The tenant's status (a suspension, a scheduled deletion), plan entitlements and usage, active platform announcements, resolved feature flags and its export archives. Any operator.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The account."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The account's standing",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/account/exports": {
      "post": {
        "description": "The owner's request for an archive of the account's catalogue, customers, orders and content, built by a job. Needs data.export and the owner role.",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TenantRequest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The request."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export the whole account",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/account/exports/{id}": {
      "get": {
        "description": "The gzip'd JSON archive, while it is ready (7 days). Needs data.export and the owner role.",
        "parameters": [
          {
            "description": "The id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/gzip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The archive."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Download an account export",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/address-assist": {
      "get": {
        "deprecated": true,
        "description": "Retired 2026-10-29 (owner): the Google address help is removed and this operation is no longer served (404). Kept here for the v1 contract only. The checkout's address help (ADR-0048) uses the store's own key (Vitrin eklentileri › Google adres önerisi) when it has one, else NeroCart's, counted per store and month against the platform's limit; past it the help is off until the month turns. `source` is store, platform or none. Right: plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AddressAssistStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The status."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Whose Google key the address help uses",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/address-assist/test": {
      "post": {
        "deprecated": true,
        "description": "Retired 2026-10-29 (owner): the Google address help is removed and this operation is no longer served (404). Kept here for the v1 contract only. Asks Google once for a suggestion (Places API (New)) and once for a validation (Address Validation API) with the typed key, else the store's stored one, and names each outcome in a word. Saves nothing. Right: plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapsKeyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MapsKeyCheck"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Google's verdict."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Check a Google Maps key with Google",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/affiliates": {
      "get": {
        "description": "Each with clicks, credited orders, revenue and commission by state. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Affiliate"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The partners."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List partners",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "Their link is /{locale}/partner/{code}; an order using their discount code is theirs too. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Affiliate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The partner."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a partner",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/affiliates/{id}": {
      "get": {
        "description": "Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Affiliate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The partner."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a partner",
        "tags": [
          "admin:marketing"
        ]
      },
      "put": {
        "description": "Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AffiliateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Affiliate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The partner."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a partner",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/affiliates/{id}/orders": {
      "get": {
        "description": "Newest first, at most 500. Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AffiliateConversion"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The orders."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A partner's credited orders",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/affiliates/{id}/settle": {
      "post": {
        "description": "approve: pending → approved; pay: approved → paid (paid outside the platform). Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "approve",
                      "pay"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Affiliate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The partner."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Settle a partner's commissions",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/ai/hs-code": {
      "post": {
        "description": "Finds the item's six-digit Harmonised System subheading in the tariff list (the open HS 2022 dataset joined with Türkiye's 2026 tariff): the list is searched with the item's name, type and category words; when the store has an AI it only chooses among those lines (it may ask for one more search with words of its own) and a code outside them is never taken; without an AI the list's closest lines are the answer (candidates). Writes nothing. An AI that is not set up or fails is a 200 with error set (not_configured, rate_limited, provider_error, timeout, network, refused, invalid_answer, no_match) and the candidates still filled. Needs catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HSSuggestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HSSuggestion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suggestion (writes nothing)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Suggest an item's HS code from the tariff list",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/ai/providers": {
      "get": {
        "description": "Every provider the AI assistant can use, in the panel's order, with its default model and the page where its API keys are made (the panel opens it in a new tab). Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AIProviderInfo"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The providers."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The AI providers the panel offers",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/ai/test": {
      "post": {
        "description": "One tiny call through the store's AI (its own key, else NeroCart's); spends one call of the store's budget. ok, or the kind of failure: not_configured, provider_error (http_status 401: the key was refused), rate_limited, timeout, network, refused, invalid_answer. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AITestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The outcome."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the store's AI",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/analytics/sessions": {
      "get": {
        "parameters": [
          {
            "description": "true keeps visits seen in the last two minutes.",
            "in": "query",
            "name": "live",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sessions": {
                          "items": {
                            "$ref": "#/components/schemas/VisitSession"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sessions"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Newest first."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The latest visits, or the live ones",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/analytics/sessions/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisitSession"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The visit."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One visit with its pages",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/analytics/summary": {
      "get": {
        "parameters": [
          {
            "description": "1–366, today included; default 30.",
            "in": "query",
            "name": "days",
            "schema": {
              "maximum": 366,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisitSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The summary."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's own visits over a period",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/api-keys": {
      "get": {
        "description": "Revoked keys are listed too, after the active ones: the question asked after an incident is what had access and when it stopped, and a deleted row answers neither. Nothing here can be turned back into a credential — the secret is returned once, when the key is made, and is not stored.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "allowed_ips": {
                            "description": "The addresses the key is accepted from, at most 32; empty: any address. A call from elsewhere is answered 401 like a wrong key.",
                            "items": {
                              "description": "An IPv4 or IPv6 address, or a CIDR range (203.0.113.0/24).",
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "created_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "created_by": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "expires_at": {
                            "description": "When the key stops working by itself, at most two years ahead; absent or null: it works until revoked. An expired key is refused like a revoked one and can be deleted.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "id": {
                            "type": "integer"
                          },
                          "last_used_at": {
                            "description": "Recorded at most once a minute, which is enough to decide whether a key can be revoked.",
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "leaked_at": {
                            "description": "When GitHub secret scanning found the key in public and it was revoked for it; absent otherwise.",
                            "format": "date-time",
                            "readOnly": true,
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "description": "What the key is for, so the list is readable.",
                            "type": "string"
                          },
                          "prefix": {
                            "description": "The visible half of the key, which identifies it in this list and in a log line.",
                            "type": "string"
                          },
                          "revoked_at": {
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "revoked_by": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "role": {
                            "description": "The role the key acts as, the store's own or the engine's. Its rights are this store's, resolved the same way an operator's are.",
                            "type": "string"
                          },
                          "scopes": {
                            "description": "Rights the key is narrowed to: it carries only those its role also carries. Empty means everything the role carries.",
                            "items": {
                              "description": "A right, `resource.verb`, from this build's catalogue (GET /api/admin/roles lists it).",
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "store_id": {
                            "description": "The one store the key may act on; absent means every store.",
                            "format": "int64",
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every key, active first."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The API keys this store has issued",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "Requires apikeys.write, which only owner carries by default: a role that can mint a key can mint one carrying more rights than itself. A key may be bound to one store and narrowed by scopes. The secret comes back here, once: only its hash is stored, and a lost key is revoked and replaced. Revoking removes it from the credential index at once.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "allowed_ips": {
                    "description": "The addresses the key is accepted from, at most 32; empty: any address. A call from elsewhere is answered 401 like a wrong key.",
                    "items": {
                      "description": "An IPv4 or IPv6 address, or a CIDR range (203.0.113.0/24).",
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "expires_at": {
                    "description": "When the key stops working by itself, at most two years ahead; absent or null: it works until revoked. An expired key is refused like a revoked one and can be deleted.",
                    "format": "date-time",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "leaked_at": {
                    "description": "When GitHub secret scanning found the key in public and it was revoked for it; absent otherwise.",
                    "format": "date-time",
                    "readOnly": true,
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "description": "What it is for. At most 80 characters.",
                    "type": "string"
                  },
                  "role": {
                    "description": "The role the key acts as, the store's own or the engine's. Its rights are this store's, resolved the same way an operator's are.",
                    "type": "string"
                  },
                  "scopes": {
                    "description": "Rights the key is narrowed to: it carries only those its role also carries. Empty means everything the role carries.",
                    "items": {
                      "description": "A right, `resource.verb`, from this build's catalogue (GET /api/admin/roles lists it).",
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "store_id": {
                    "description": "The one store the key may act on; absent means every store.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "role"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "properties": {
                            "allowed_ips": {
                              "description": "The addresses the key is accepted from, at most 32; empty: any address. A call from elsewhere is answered 401 like a wrong key.",
                              "items": {
                                "description": "An IPv4 or IPv6 address, or a CIDR range (203.0.113.0/24).",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "created_at": {
                              "format": "date-time",
                              "type": "string"
                            },
                            "created_by": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "expires_at": {
                              "description": "When the key stops working by itself, at most two years ahead; absent or null: it works until revoked. An expired key is refused like a revoked one and can be deleted.",
                              "format": "date-time",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "id": {
                              "type": "integer"
                            },
                            "last_used_at": {
                              "description": "Recorded at most once a minute, which is enough to decide whether a key can be revoked.",
                              "format": "date-time",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "leaked_at": {
                              "description": "When GitHub secret scanning found the key in public and it was revoked for it; absent otherwise.",
                              "format": "date-time",
                              "readOnly": true,
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "description": "What the key is for, so the list is readable.",
                              "type": "string"
                            },
                            "prefix": {
                              "description": "The visible half of the key, which identifies it in this list and in a log line.",
                              "type": "string"
                            },
                            "revoked_at": {
                              "format": "date-time",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "revoked_by": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "role": {
                              "description": "The role the key acts as, the store's own or the engine's. Its rights are this store's, resolved the same way an operator's are.",
                              "type": "string"
                            },
                            "scopes": {
                              "description": "Rights the key is narrowed to: it carries only those its role also carries. Empty means everything the role carries.",
                              "items": {
                                "description": "A right, `resource.verb`, from this build's catalogue (GET /api/admin/roles lists it).",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "store_id": {
                              "description": "The one store the key may act on; absent means every store.",
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            }
                          },
                          "type": "object"
                        },
                        {
                          "properties": {
                            "secret": {
                              "description": "The credential. Never returned again.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The key, with its secret — shown once."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mint an API key",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/api-keys/requests/summary": {
      "get": {
        "description": "Keyed by key id: the calls made and how many answered 4xx or 5xx.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "additionalProperties": {
                        "properties": {
                          "day": {
                            "type": "integer"
                          },
                          "errors": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Calls and errors per key."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Every key's last 24 hours",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/api-keys/{id}": {
      "delete": {
        "description": "Stops the key working and keeps its row, so there is still a record of what had access and when it stopped. Revoking one already revoked succeeds: the caller wanted it off, and it is off.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Revoke an API key",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/api-keys/{id}/remove": {
      "post": {
        "description": "Deletes a revoked or expired key's row for good; the audit log keeps that it existed, was revoked and was removed. An active key is refused (409): revoke it first.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a revoked API key",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/api-keys/{id}/requests": {
      "get": {
        "description": "Newest first, 30 days kept: method, v1 path (never the query), status, duration, caller address and request id. Paginated like every list.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "duration_ms": {
                            "type": "integer"
                          },
                          "ip": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "request_id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of requests."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The calls an API key made",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/api-keys/{id}/secret": {
      "get": {
        "description": "Since M8 a key is stored only as its hash, so its secret cannot be shown again: this answers 409 for a key that exists and 404 for one that does not. Kept so an older panel gets an explanation rather than a missing route.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "secret": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The key."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a key back",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/apps": {
      "get": {
        "description": "Right: apikeys.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppsView"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The apps."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apps listed for stores, and the ones this store let in",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/apps/installs/{id}": {
      "delete": {
        "description": "Revokes the API key the app was given. Right: apikeys.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove an app",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/assistant": {
      "get": {
        "description": "The switch (off by default), the greetings and the tone; whether the store's own AI key is set up (the assistant never runs on NeroCart's key); this month's conversations, answers and answers given without the AI. Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShoppingAssistantAdmin"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings and counters."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The shopping assistant's settings and this month's counts",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "The switch, the greetings per language and the tone. Switching on needs the store's own AI key (409 ai_not_configured otherwise). Audited (plugin.shopping_assistant_set). Needs plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShoppingAssistantSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShoppingAssistantAdmin"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved settings and counters."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`ai_not_configured`: the store has no AI key of its own."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the shopping assistant's settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/assistant/try": {
      "post": {
        "description": "The panel's \"Dene\": one question answered as a visitor would get it, with the store's tone, whether the assistant is on or not. Spends the store's AI budget; not counted. Needs plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantTryInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssistantAnswer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The answer."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`ai_not_configured`: the store has no AI key of its own."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Try the shopping assistant",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/audit": {
      "get": {
        "description": "Every recorded operator action, newest first. Two things a reader has to know: a key present in changes.after and absent from changes.before means the previous value was not recorded rather than that it was empty; and created_at is the transaction's start time, so an audit row and the outbox event from the same transaction carry an identical instant. An unknown actor_kind, action or entity_type answers with an empty page rather than a 400, because a feed that refuses a stale filter is a screen an operator cannot get out of. It sits behind store.operate: filtering the whole store by person is a different question from the history of one record, which follows that record's own read right.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActorID"
          },
          {
            "in": "query",
            "name": "actor_kind",
            "schema": {
              "enum": [
                "operator",
                "token",
                "system"
              ],
              "type": "string"
            }
          },
          {
            "description": "An exact action name, such as order.refund.",
            "in": "query",
            "name": "action",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entity_type",
            "schema": {
              "enum": [
                "order",
                "product",
                "stock",
                "category",
                "collection",
                "discount",
                "campaign",
                "tax_rate",
                "location",
                "superuser",
                "invitation",
                "role",
                "taxonomy_attribute",
                "plugin",
                "notification_template",
                "media",
                "vendor",
                "api_key",
                "customer",
                "carrier_profile",
                "consent",
                "suppression",
                "messaging_profile",
                "invoice",
                "legal_document",
                "market",
                "store",
                "domain",
                "content_page",
                "content_version",
                "content_settings",
                "theme",
                "content_redirect",
                "store_menu",
                "tenant",
                "return_reason",
                "payment_method",
                "translation_glossary",
                "cookie_consent",
                "export_link",
                "job",
                "recurring_job",
                "audit",
                "saved_view",
                "import_job",
                "owner_request",
                "company_profile",
                "kyc_document",
                "chargeback",
                "cart_recovery",
                "customer_group",
                "stock_alerts",
                "product_label",
                "invoice_item",
                "invoice_item",
                "listing_source",
                "tenant_capability",
                "licence_key",
                "dealer_application",
                "site_verification",
                "seo",
                "cross_border",
                "chat",
                "etgb",
                "selling_template"
              ],
              "type": "string"
            }
          },
          {
            "description": "\"42\" for a numbered record, \"manager\" for a role.",
            "in": "query",
            "name": "entity_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The rows one request wrote: its X-Request-Id, the same id as its events' correlation_id.",
            "in": "query",
            "name": "request_id",
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of the trail, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store’s activity",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/audit/actors": {
      "get": {
        "description": "Most recently active first, capped at 200. No meta block: it is a short bounded list, and it is built from the trail rather than from the team table.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditActor"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The actors."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Who appears in the trail",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/auth-google/callback": {
      "post": {
        "description": "Takes `state`, `code` and the `binding` from the start. The state is used once. The ID token is verified (JWKS signature, issuer, audience, expiry, nonce) and must carry a verified address whose `hd` claim is one of the store's allowed Workspace domains and matches the address's domain; the address must belong to an EXISTING active team member (nobody is created). The first Google account a member uses is remembered; a different one is refused. A member with a second factor enrolled gets 403 `google_signin_use_password`. Answers like the password sign-in: a session token and the record. 401 `google_signin_failed` / `google_signin_expired`; 403 `google_signin_not_allowed`; 429 after repeated failures.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffGoogleCallbackInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StaffGoogleSession"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "description": "The sign-in failed or expired."
          },
          "403": {
            "description": "This Google account may not sign in here."
          },
          "409": {
            "description": "Google sign-in is not set up."
          },
          "429": {
            "description": "Too many attempts."
          }
        },
        "summary": "Complete signing in to the panel with Google Workspace",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/auth-google/start": {
      "post": {
        "description": "Public, like the password sign-in. Makes the state, nonce and PKCE pair and returns Google's authorisation URL with `binding` (the PKCE verifier), which the panel keeps in sessionStorage until its callback page loads. `redirect_uri` must be https://\u003cthis panel's host\u003e/admin/sign-in/google/. `tenant_id` names the tenant as the password sign-in does. 409 `google_signin_not_configured` when the store set no client or no allowed domains.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffGoogleStartInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StaffGoogleStarted"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "description": "Google sign-in is not set up."
          }
        },
        "summary": "Begin signing in to the panel with Google Workspace",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/auth-logout": {
      "post": {
        "responses": {
          "204": {
            "description": "Signed out."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "End this session",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/auth-refresh": {
      "post": {
        "description": "The panel calls this on boot to turn a stored token back into an identity, and to learn that a token has expired without waiting for a real request to fail. The old token is revoked. A static admin token is not a session and gets a 400.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/AuthResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Exchange a session for a fresh one",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/auth-state": {
      "get": {
        "description": "Public, because it has to answer before anyone can hold a credential. The panel calls it first so a fresh database offers to create the first superuser instead of presenting a login form nobody could satisfy.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "google_signin": {
                          "description": "The store set up staff sign-in with Google Workspace (its client and allowed domains), so the sign-in page shows the Google button (ADR-0130).",
                          "type": "boolean"
                        },
                        "installed": {
                          "description": "At least one superuser exists.",
                          "type": "boolean"
                        },
                        "password_reset": {
                          "description": "An email notifier is installed, so a reset link can actually be sent. False when the only backend is the built-in logger.",
                          "type": "boolean"
                        },
                        "token_auth": {
                          "description": "A static admin token would also be accepted.",
                          "type": "boolean"
                        },
                        "turnstile_site_key": {
                          "description": "The Cloudflare Turnstile widget the sign-in and the password-reset request show (ADR-0096): the platform's site key on a NeroCart host when the platform set one, else empty (no widget).",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Installation state."
          }
        },
        "summary": "Whether this installation has an operator yet",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/auth-with-password": {
      "post": {
        "description": "Returns a session token to send as `Authorization: Bearer \u003ctoken\u003e`. The session belongs to one tenant — the one the host names, or `tenant_id` — and a person who belongs to several signs in to each. Wrong password, unknown operator and unknown tenant give the identical 400, so the endpoint cannot be used to discover who has an account. Failures are throttled per email and address, per address and per email, in PostgreSQL, so every instance counts the same ones. A user with a second factor must also send `otp` or `recovery_code`. Cloudflare Turnstile (ADR-0096): on a NeroCart host with the platform's keys set, the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). A store's own keys never guard the sign-in.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "identity": {
                    "description": "The operator's email. Named `identity` for PocketBase compatibility; `email` is accepted as a synonym.",
                    "format": "email",
                    "type": "string"
                  },
                  "otp": {
                    "description": "The current six-digit code from the authenticator app (RFC 6238). A code is good once.",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  },
                  "recovery_code": {
                    "description": "One unused recovery code, instead of `otp`. It is spent.",
                    "type": "string"
                  },
                  "tenant_id": {
                    "description": "Sign in to this tenant rather than the one the host names.",
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AuthResponse"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid login credentials."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The password was right and the user has a second factor: send `otp` or `recovery_code` (code `mfa_required`)."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The membership is suspended."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many failed attempts."
          }
        },
        "summary": "Sign in with an email and a password",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/automation-rules": {
      "get": {
        "description": "Triggers order.created, order.paid, order.cancelled; conditions total_minor gt/lt, country eq, payment_method eq, first_order eq true/false, product_tag eq; actions add_tag, assign (a team member's e-mail), email_customer (subject, body; {ad} and {siparis} filled). Each rule runs once per order. Right: orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AutomationRule"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List automations",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Triggers order.created, order.paid, order.cancelled; conditions total_minor gt/lt, country eq, payment_method eq, first_order eq true/false, product_tag eq; actions add_tag, assign (a team member's e-mail), email_customer (subject, body; {ad} and {siparis} filled). Each rule runs once per order. Right: orders.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRule"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutomationRule"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create an automation",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/automation-rules/{id}": {
      "delete": {
        "description": "Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete an automation",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRule"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutomationRule"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace an automation",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/brands": {
      "get": {
        "description": "The vendors of the store's products and the brands saved without products now. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Brand"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brands."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List brands",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "By name (a product's vendor). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Brand"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a brand's page address, logo and words",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/brands/translate": {
      "post": {
        "description": "Machine-translates the brand's words (rich description, search title and description) into every other language of the store through its translation service. The brand's name and the glossary's protected terms stay as they are; a translation written by hand is kept. Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Brand"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brand with its translations."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No brand of this name."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Translate a brand's words",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/builder/export": {
      "post": {
        "description": "A template or kit file (format nerocart.kit, version 1): the templates named by `refs` (starters in `lang`, the store's own) and, with `styles`, the theme draft's global styles. Library pictures travel by reference. Writes nothing. Needs content.read and vb_kits.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KitExportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KitBundle"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Write templates and styles into a file",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/import": {
      "post": {
        "description": "A file is never trusted: decoded strictly (an unknown key is refused), at most 1 MB and 20 templates, every section checked exactly as a page save (as for saving a template), its global styles as the theme's. A library picture this store does not have is left out of its template and listed in `missing`; nothing is fetched. Names already used get \" (2)\", \" (3)\" …. With `styles` the file's global styles go into the theme draft (needs theme.write too). Logged (GET /builder/imports) and audited (content.template_import). Needs content.write and vb_kits.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KitImportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KitImported"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the file added."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Bring a template or kit file in",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/imports": {
      "get": {
        "description": "The files imported and kits applied, newest first (the last 50), with the pictures each left out. Needs content.read and vb_kits.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/KitImportLog"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The log."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The import log",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/kits": {
      "get": {
        "description": "Kits (ADR-0085, VB-7): each a set of starter templates — the page it makes, in order — and global styles. `available` is false while a template of its page waits for a feature (`needs`). Needs content.read and vb_kits.",
        "parameters": [
          {
            "description": "Two-letter language the starters are written in (default tr; a language they lack reads English).",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BuilderKit"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The kits."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The starter kits",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/kits/{id}/apply": {
      "post": {
        "description": "Writes the kit's global styles into the theme draft (unless `styles` is false; needs theme.write too) — previewed and published with the theme — and keeps the kit's page as a template of the store (kind page, origin kit:\u003cid\u003e). Logged and audited (content.kit_apply). Needs content.write and vb_kits.",
        "parameters": [
          {
            "description": "The kit's id (sade, cesur, …).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KitApplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KitApplied"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What it did."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply a kit to the store",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/templates": {
      "get": {
        "description": "\"Hazır şablonlar\" (ADR-0085, VB-7): the starter templates (hero, features, testimonials, pricing, questions, calls to action, a product showcase, about, contact; drawn only with the theme's tokens, with their own licensed pictures) in a language, then the store's own templates (free layout sections and pages, newest first). Each says whether the store can use it now (`available`; `needs` names the features its items wait for). Needs content.read and the store's vb_kits (else 403, reason feature_off).",
        "parameters": [
          {
            "description": "Two-letter language the starters are written in (default tr; a language they lack reads English).",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BuilderTemplate"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The templates."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The template library",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "Keeps one free layout section (kind layout) or a page's sections (kind page) under a name, checked exactly as a page save checks them (no item this release does not know; the store's flags; CSS and HTML need theme.publish; library pictures, discounts, popups and the commerce widgets' references must exist). Shares the saved sections' limit (100) and names (once, any case). Audited (content.template_save). Needs content.write and vb_kits.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuilderTemplateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BuilderTemplate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a free layout section or a page as a template",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/builder/templates/{id}": {
      "delete": {
        "description": "Removes one of the store's templates; pages that took it keep their copy. Needs content.write and vb_kits.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a template",
        "tags": [
          "admin:content"
        ]
      },
      "patch": {
        "description": "Renames one of the store's templates (a starter cannot be). Needs content.write and vb_kits.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BuilderTemplate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename a template",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/campaigns": {
      "get": {
        "description": "The store's campaigns, newest first. Needs discounts.read.",
        "parameters": [
          {
            "description": "Match the name.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Campaign"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Campaigns."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List campaigns",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Needs discounts.write. Audited as campaign.create.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Campaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a campaign",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/campaigns/{id}": {
      "delete": {
        "description": "Its promotions stay, without a campaign. Orders keep their snapshots.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a campaign",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Campaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a campaign",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Only the keys present are written, under the row lock checkout registers usage under. The budget's `used` cannot be written.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Campaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a campaign",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/campaigns/{id}/history": {
      "get": {
        "description": "Budget figures are integers on both sides of a change. A record with no rows answers 200 with an empty array rather than 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A campaign’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/carriers": {
      "get": {
        "description": "Without `tracking`, every carrier the engine can name. With it, the ones whose numbering the number fits, best first.\n\nThat is a list rather than a verdict on purpose. A tracking number is not self-describing: several carriers issue bare ten- to fourteen-digit numbers, so a twelve-digit number is genuinely ambiguous. Where a number carries something distinctive — UPS's `1Z`, the S10 standard's country suffix, DHL's `JJD` — the list has one entry and a client can fill the field in. Where it does not, the operator picks. Guessing would hand the customer a tracking link that goes nowhere, which reads as the shop having lost their parcel.",
        "parameters": [
          {
            "description": "Return only the carriers this number could belong to.",
            "in": "query",
            "name": "tracking",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Carrier"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Carriers, best first."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Carriers, or the ones a tracking number could belong to",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/cart-recovery": {
      "get": {
        "description": "The switch, the steps (defaults when never saved), which channels can send, and the last `days` (default 30) of sequences: started, reached, clicked, recovered and the recovered orders' revenue. Right: carts.read.",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CartRecoveryOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cart reminders: settings and report (Pazarlama › Sepet hatırlatma)",
        "tags": [
          "admin:messaging"
        ]
      },
      "put": {
        "description": "One to three steps; each enabled step comes later than the one before; delays 30 minutes to 14 days; discount 0–50%. Audited (cart_recovery.update). Right: discounts.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartRecoverySettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CartRecoverySettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the cart reminder settings",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/cart-recovery/preview": {
      "post": {
        "description": "Rendered from the store's wording (Ayarlar › Bildirimler) in `language`. Right: carts.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartRecoveryPreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CartRecoveryPreview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A step's message with a sample basket",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/cart-recovery/sequences": {
      "get": {
        "description": "Newest first; `status` active, recovered, stopped or expired. Right: carts.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "active",
                "recovered",
                "stopped",
                "expired"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CartRecoveryItem"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The baskets being reminded",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/cart-recovery/test": {
      "post": {
        "description": "A sample basket to `to` (email or SMS). 409 when no sender is set up. Right: discounts.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartRecoveryPreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sent": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "sent"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a step's message to yourself",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/carts": {
      "get": {
        "description": "Baskets that have not become orders yet: what is in them, what they are worth, and the address to reach the shopper on. Read-only and tokenless - a cart's token is a live credential, so it is never returned here and a cart is addressed by its numeric row id. `state` is derived from the status column AND `expires_at`, so a cart the five-minute sweeper has not reached yet still reports as abandoned.",
        "parameters": [
          {
            "description": "Derived from status and expires_at, not the status column alone.",
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "live",
                "abandoned",
                "converted"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "has_email",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Counts lines rather than value, so a basket of free samples is never silently dropped.",
            "in": "query",
            "name": "has_lines",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Minimum basket value, in the currency's minor units - quantity x the snapshotted unit price.",
            "in": "query",
            "name": "min_value_minor",
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CartSummary"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of carts, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List carts",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/carts/{id}": {
      "get": {
        "description": "One basket and what is in it, addressed by the numeric id the listing reports. Each line carries both coordinates - the price as snapshotted and the price now - so an operator can see whether the basket is still worth chasing. Still no token.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CartDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cart."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a cart",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/categories": {
      "get": {
        "description": "Three shapes from one route. `?q=` searches the whole tree and answers with a bounded flat set of paths, which is the normal way to work once a full taxonomy is imported. `?parent=root` or `?parent={id}` returns one level, the shape a browsable picker asks for, bounded by construction. Neither, and the whole tree comes back, but only while it is small enough to send honestly: past that the response is a bounded slice whose `meta.total` reports the real size, so a client that compares the two can see it holds only a part and switch to searching.",
        "parameters": [
          {
            "description": "Search titles and paths, case-insensitively.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`root`, or a category id: return that node's direct children only.",
            "in": "query",
            "name": "parent",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Depth-first flat list instead of nested children.",
            "in": "query",
            "name": "flat",
            "schema": {
              "enum": [
                1
              ],
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. Honoured only on the `?q=` search branch; sent with `?parent=`, `?flat=1` or a whole-tree listing it is a 400, because a tree's order is the position an operator gave it. The sort is applied before the limit, so `sort=title` returns the alphabetically first matches rather than the shallowest ones alphabetised. `full_name` orders by the rendered path, which is what the row shows.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "created_at",
                "full_name",
                "id",
                "title"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Categories. `meta.total` is the real size of the tree, which can exceed what was sent; on a search it stays the true number of matches even when the requested window is past the end of them."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List, search or browse the tree",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created category."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a category",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/categories/reorder": {
      "put": {
        "description": "Renumbers a whole sibling set in one transaction, giving the ids sent positions 0..n-1 in the order they arrive. One call rather than a PATCH per row because `position` is per-parent and dense — dropping a row above three siblings renumbers four of them, and separate writes can fail part-way and leave an order that is half old and half new (D54).\n\n`parent_id` is required and nullable: send `null` to reorder the roots. Omitting the key is refused rather than treated as null, so a body that forgets it cannot silently reorder the top level.\n\n`ids` must name exactly that parent's children — all of them, each once, and nothing else. A partial list is refused rather than interpreted, because every reading of one is a guess. Moving a category to a different parent is `parent_id` on PATCH /api/admin/categories/{id}, not this.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "ids": {
                    "description": "Every child of that parent, in the order they should sit.",
                    "example": [
                      12,
                      9,
                      11
                    ],
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "parent_id": {
                    "description": "The parent whose children are being ordered. Null is the root level.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "parent_id",
                  "ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "That parent's children, in their new order."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reorder one parent's children",
        "tags": [
          "admin:categories"
        ]
      }
    },
    "/api/v1/admin/categories/{id}": {
      "delete": {
        "description": "Refused while anything still points at it, whether a subcategory or a product filed under it. Deleting a branch is not a way to lose what was in it, so the references have to be moved first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a category",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The category."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a category",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated category."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a category",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/categories/{id}/ancestors": {
      "get": {
        "description": "The chain from the root down to this category, the category itself last. A client that holds one category and needs what the whole branch says about it cannot get there from the listing — a store carrying a full taxonomy has thousands of categories and the listing sends a page — so the chain is asked for by id. Each node carries its metadata, which is where a category declares the fields it asks of a product. An unknown id comes back as an empty list rather than a 404: it is a category deleted while somebody had the product open.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The chain, root first."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The branch a category sits on, root first",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/categories/{id}/history": {
      "get": {
        "description": "Creation, edits and deletion, with parent_id on both sides of a move. A record with no rows answers 200 with an empty array rather than 404: the log knowing nothing about a record is not the record being absent, and everything that existed before this table did has an honestly empty history.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A category’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/categories/{id}/translations": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextTranslations"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every non-default store language."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List a category's translations",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/categories/{id}/translations/{lang}": {
      "delete": {
        "description": "Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a category's translation in one language",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Replaces the language's translation; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextTranslationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextTranslation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The stored translation."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a category's translation in one language",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/categories/{id}/translations/{lang}/status": {
      "post": {
        "description": "Needs categories.write. draft → reviewed → approved → published, one step at a time, or back to draft from any state (reject / withdraw). The same status again is a no-op. Only a published translation is served by store reads. Audited (`category.translation_status`, with the note).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default.",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationStatusInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationReviewItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The translation in the queue's shape."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move a category's translation through review",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/channels": {
      "get": {
        "description": "One catalogue can be served as several storefronts, differing in what is published to them and what it costs. They deliberately do not differ in currency: D14 settled one settlement currency per store and snapshots it onto every order.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Channel"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channels, default first."
          }
        },
        "summary": "Storefronts",
        "tags": [
          "channels"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Channel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channel."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Create a channel",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/v1/admin/channels/{id}": {
      "delete": {
        "description": "Its publication rows go with it, which widens the products that named it back to every channel — the state they were in before somebody narrowed them, and the only honest answer once the narrowing is gone. Carts and orders keep their history and lose only the reference.",
        "parameters": [
          {
            "description": "The channel.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gone."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a channel",
        "tags": [
          "channels"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "The channel.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Channel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channel."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "One channel",
        "tags": [
          "channels"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "The channel.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Channel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channel."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Change a channel",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/v1/admin/chargebacks": {
      "get": {
        "description": "Open disputes first, by deadline. Needs orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "open",
                "responded",
                "won",
                "lost",
                "accepted"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Chargeback"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Chargebacks."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the chargebacks",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Against one of the store's orders; the deadline defaults to seven days after it was opened. Audited as chargeback.create. Needs orders.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargebackInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Chargeback"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The chargeback."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a chargeback",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/chargebacks/{id}": {
      "get": {
        "description": "With its evidence files (never their bytes). Needs orders.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Chargeback"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The chargeback."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a chargeback",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "open → responded, accepted, won, lost; responded → won, lost. Audited as chargeback.update. Needs orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargebackPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Chargeback"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The chargeback."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a chargeback",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/chargebacks/{id}/documents": {
      "post": {
        "description": "multipart/form-data, the file in \"file\": a PDF, JPG or PNG up to 10 MB, kept encrypted like the document vault. Audited as chargeback.document_upload. Needs orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChargebackDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add evidence to a chargeback",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/chargebacks/{id}/documents/{doc}": {
      "get": {
        "description": "A private download; every read is in the audit log (chargeback.document_view). Needs orders.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "doc",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/jpeg": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Download a chargeback's evidence",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/chats": {
      "get": {
        "description": "Open chats first, then the newest; status=open|closed filters. Right: contact.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "open",
                "closed"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ChatConversation"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chats."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The live chat inbox",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/chats/{id}": {
      "delete": {
        "description": "Deletes the chat and its messages for good; the visitor's token reaches nothing after. Right: contact.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a chat",
        "tags": [
          "admin:customers"
        ]
      },
      "get": {
        "description": "Reading marks it read. Right: contact.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A chat with its messages",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/chats/{id}/attachments": {
      "post": {
        "description": "Right: contact.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "A picture or a PDF up to 10 MB, a video up to 25 MB.",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Answer a chat with a file",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/chats/{id}/attachments/{file}": {
      "get": {
        "description": "Right: contact.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "file",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file: a picture or a video inline, a PDF as a download; private, never cached."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A file of a chat",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/chats/{id}/close": {
      "post": {
        "description": "The visitor's next message opens it again. Right: contact.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Closed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close a chat",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/chats/{id}/messages": {
      "post": {
        "description": "Right: contact.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Answer a chat",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/checkout-links": {
      "get": {
        "description": "Newest first, at most 200. Right: orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CheckoutLink"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The links."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List payment links",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Products (variants and quantities), and if wanted a discount code and the customer's e-mail. Whoever opens the link gets a basket of those lines in their market at today's prices and pays with any method. Right: orders.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutLinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckoutLink"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The link."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a payment link",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/checkout-links/{id}": {
      "patch": {
        "description": "Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckoutLink"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The link."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch a payment link on or off",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/cod/remittances": {
      "post": {
        "description": "Rows of a carrier's remittance report. Each row that matches what the courier was to collect marks its order paid (audited as order.cod_remit); a different amount is recorded and leaves the order unpaid; a reference seen before is a no-op. Rows are applied one by one and each says what it did.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "remittances": {
                    "items": {
                      "$ref": "#/components/schemas/CODRemittanceInput"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "remittances"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "results": {
                          "items": {
                            "$ref": "#/components/schemas/CODRemittanceResult"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One result per row."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import cash-on-delivery remittances",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/cod/unremitted": {
      "get": {
        "description": "Delivered cash-on-delivery shipments whose money has not come back, oldest first.",
        "parameters": [
          {
            "description": "Only those delivered at least this many days ago.",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/UnremittedCOD"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The shipments."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delivered, not remitted",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/collections": {
      "get": {
        "description": "Every collection, including the empty ones the public listing hides.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Collection"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of collections, ordered by position then id."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List collections",
        "tags": [
          "admin:collections"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/CollectionResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a collection",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/collections/{id}": {
      "delete": {
        "description": "The products in it survive. A collection groups products, it does not own them, so deleting \"Summer sale\" must not delete the summer stock — only the membership rows go.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a collection",
        "tags": [
          "admin:collections"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CollectionResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a collection",
        "tags": [
          "admin:collections"
        ]
      },
      "patch": {
        "description": "Every field is optional; an omitted field is left alone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "image_media_id": {
                    "description": "A picture from the media library; null removes it.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "position": {
                    "type": "integer"
                  },
                  "seo_description": {
                    "description": "Overrides the description in search results.",
                    "type": "string"
                  },
                  "seo_title": {
                    "description": "Overrides the title in search results; empty falls back to it.",
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "template": {
                    "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
                    "maxLength": 40,
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CollectionResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a collection",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/collections/{id}/products": {
      "get": {
        "description": "In the order the collection was curated, drafts included — staging them is what an operator is doing here. 404 rather than an empty page for a collection that does not exist, which is what a curation screen needs to know before it offers to reorder anything. It takes the same filter vocabulary as the product listing, except `collection_id`: the path already names the collection, so sending one is a 400 rather than a filter nobody would notice being dropped.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "draft",
                "active",
                "archived"
              ],
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "vendor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "product_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Products carrying exactly this tag. Exact rather than case-folded so the match is answered by the index; tags are de-duplicated case-insensitively on write, so one spelling of a tag is the only spelling stored.",
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to a category and everything nested under it. An unparseable value is an error rather than a silently ignored filter, because a filter that quietly matches everything is how a typo turns into \"why is this showing the whole catalogue\".",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of products."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List a collection's products",
        "tags": [
          "admin:collections"
        ]
      },
      "put": {
        "description": "Replace, not merge, for the reason the product-side route gives: the caller holds the whole list — INCLUDING the memberships it never fetched, which are deleted. A screen must hold the entire membership before it saves. The order sent is the order stored, and it is the only way a collection's own order is ever chosen — it writes `member_position`, never the `position` that orders a collection inside one product's own list (D40). `product_ids` is required: omitting it is a 400, and an explicit empty array is how a collection is emptied without being deleted. An unknown product id rejects the whole request. The answer is 204: the useful response would be the whole membership, and a page of it is a list a client could re-save from and lose the tail — read it back with the GET above.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "product_ids": {
                    "example": [
                      7,
                      3,
                      9
                    ],
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "product_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "The membership is what was sent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a collection's products",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/collections/{id}/rules": {
      "get": {
        "description": "Absent rules: a hand-picked collection. Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CollectionRulesView"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The rules and member count."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A collection's rules",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "With rules the members become the products that match them (all or any): tag eq, vendor eq, product_type eq, title contains, category_id eq, price gt/lt (minor units). Worked out now and again after products change. Null rules keep the members, now hand-picked. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "rules": {
                    "$ref": "#/components/schemas/CollectionRules"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CollectionRulesView"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The rules and member count."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make a collection automatic, or hand-picked again",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/collections/{id}/translations": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextTranslations"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every non-default store language."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List a collection's translations",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/collections/{id}/translations/{lang}": {
      "delete": {
        "description": "Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a collection's translation in one language",
        "tags": [
          "admin:collections"
        ]
      },
      "put": {
        "description": "Replaces the language's translation; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TextTranslationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextTranslation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The stored translation."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a collection's translation in one language",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/collections/{id}/translations/{lang}/status": {
      "post": {
        "description": "Needs collections.write. draft → reviewed → approved → published, one step at a time, or back to draft from any state (reject / withdraw). The same status again is a no-op. Only a published translation is served by store reads. Audited (`collection.translation_status`, with the note).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default.",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationStatusInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationReviewItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The translation in the queue's shape."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move a collection's translation through review",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/companies": {
      "get": {
        "description": "Each with its buyers. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Company"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The companies."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List company accounts",
        "tags": [
          "admin:customers"
        ]
      },
      "post": {
        "description": "Its buyers are put in its price group. A buyer belongs to one company. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The company."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a company account",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/companies/{id}": {
      "delete": {
        "description": "Its buyers keep their accounts and price group. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a company account",
        "tags": [
          "admin:customers"
        ]
      },
      "put": {
        "description": "Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Company"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The company."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a company account",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/company-profile": {
      "get": {
        "description": "The company record and document vault (ADR-0136): the company type, what was typed for it (prefilled from the store settings when there is no record yet), what is missing before it can be sent, gentle warnings (an IBAN holder that does not match the title, a number or title read off a document that differs from what was typed, a document about to expire), progress 0–100, the documents and who opened them lately, and every company type's template. `state` is none, incomplete, submitted, approved or rejected; `exempt` means the store sold before this release and the payments gate does not apply to it. Needs store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's company record",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Stores the type and the details as typed, sealed at rest. Never refuses a half-filled form: an invalid number is kept and reported in `missing`. Refused while the platform reviews the record (409, details.reason under_review); a change to an approved or rejected record makes it a draft again (the last approved record stays in force). 409 vault_unavailable when the server has no secrets key. Audited as company_profile.update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the company record (a draft may be incomplete)",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/company-profile/documents": {
      "post": {
        "description": "multipart/form-data with `kind` (one of the type's document kinds), optional `expires_on` (YYYY-MM-DD, for a document that has a validity date) and then `file`: a PDF, JPG or PNG up to 10 MB, checked by its bytes (a picture loses its metadata, a PDF with scripts or embedded files is refused; details.reason type, too_large, empty, damaged, pdf_active). Kept encrypted under a key of its own; read on this server in the background (OCR) and compared with what was typed. Refused while under review. Audited as kyc_document.upload. Needs store.write.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "expires_on": {
                    "format": "date",
                    "type": "string"
                  },
                  "file": {
                    "format": "binary",
                    "type": "string"
                  },
                  "kind": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KYCDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The document as kept."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Upload a company document",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/company-profile/documents/{id}": {
      "delete": {
        "description": "Refused while the platform reviews the record (409). Removing a document after a decision makes the record a draft again. Audited as kyc_document.delete. Needs store.write.",
        "parameters": [
          {
            "description": "The document.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a company document",
        "tags": [
          "admin:settings"
        ]
      },
      "patch": {
        "description": "Only before the document is approved (uploaded or rejected). Needs store.write.",
        "parameters": [
          {
            "description": "The document.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expires_on": {
                    "description": "YYYY-MM-DD; empty clears it.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KYCDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a document's validity date",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/company-profile/documents/{id}/file": {
      "get": {
        "description": "The decrypted file as a private download (`Content-Disposition: attachment`, `Cache-Control: private, no-store`, nosniff, a sandboxing CSP); the read is written to the document log. Never a public address. Needs store.write.",
        "parameters": [
          {
            "description": "The document.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/jpeg": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The document."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Download one of the store's company documents",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/company-profile/submit": {
      "post": {
        "description": "Sends a complete record to the platform: status submitted, the documents not yet read become checking. 400 details.reason incomplete with details.missing when something is missing. Idempotent while submitted. Audited as company_profile.submit. Needs store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send the company record for review",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/consents": {
      "get": {
        "description": "The store's consent register (ETK / İYS), most recently changed first. overdue=true lists changes not yet in İYS past their three-business-day deadline.",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "iys_status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Consent"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The consents."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Consents to commercial messages",
        "tags": [
          "admin:messaging"
        ]
      },
      "post": {
        "description": "A consent taken outside the checkout (a paper form, an import). It is owed to İYS within three business days.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Consent"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The consent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a consent",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/consents/revoke": {
      "post": {
        "description": "Honoured at once; owed to İYS within three business days.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "channel": {
                    "enum": [
                      "sms",
                      "email",
                      "call"
                    ],
                    "type": "string"
                  },
                  "recipient": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "channel",
                  "recipient"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Consent"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The consent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a withdrawal",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/consents/{id}/events": {
      "get": {
        "description": "Every grant and withdrawal, oldest first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ConsentEvent"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The history."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A consent's history",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/contact-messages": {
      "get": {
        "description": "Messages from the storefront's contact form, newest first. `status` new, read, archived or all (absent: everything but archived); `q` matches the name, address, topic and message. Right: contact.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "new",
                "read",
                "archived",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only contact messages or only quote requests (ADR-0091 §4); absent: both.",
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "contact",
                "quote"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ContactMessage"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The messages."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The contact inbox (Müşteriler › Mesajlar)",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/contact-messages/counts": {
      "get": {
        "description": "For the inbox's tabs and the menu's badge. Right: contact.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactCounts"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "How many contact messages are new, read and archived",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/contact-messages/{id}": {
      "get": {
        "description": "Right: contact.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactMessage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One contact message",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "Reading sets read_at once; marking it new again clears it. Right: contact.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "status": {
                    "enum": [
                      "new",
                      "read",
                      "archived"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "status"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactMessage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mark a contact message read, archived or new",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/contact-messages/{id}/reply": {
      "post": {
        "description": "Sends the store's answer to the visitor's address through the store's mail sender — the wording of the form's reply message (contact.auto_reply), the visitor's own message quoted under it — and records it on the message (replies) with who answered and when; a new message becomes read. 409 with details.reason mail_not_configured when the store has no mail sender. Right: contact.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "maxLength": 4000,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactMessage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The message with the answer among its replies."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The store has no mail sender (details.reason mail_not_configured), or the message has too many replies."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Answer a contact message",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/content/blog/authors": {
      "get": {
        "description": "The authors by name, each with its article count. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BlogAuthor"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The authors."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Blog authors",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "A name (≤ 120), a bio per language, a picture (https or a store path); the slug is made from the name when left out. Audited. Needs content.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogAuthorInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogAuthor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The author."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add an author",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/authors/{id}": {
      "delete": {
        "description": "Their articles keep the text byline of each version. Audited. Needs content.publish.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete an author",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "As adding one. Audited. Needs content.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogAuthorInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogAuthor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The author."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change an author",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/categories": {
      "get": {
        "description": "The categories in their order, each with its article count. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BlogCategory"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The categories."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Blog categories",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "A name in at least one language (plain text, ≤ 80), a description per language, an order; the slug is made from the Turkish name when left out (any language's letters, ADR-0066). Audited. Needs content.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogCategoryInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogCategory"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The category."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a blog category",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/categories/{id}": {
      "delete": {
        "description": "Its articles stay, without a category. Audited. Needs content.publish.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a blog category",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "As adding one. Audited. Needs content.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogCategoryInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogCategory"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The category."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a blog category",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/comments": {
      "get": {
        "description": "Comments newest first, filtered by state and article; with the writer's email (personal data, kept for moderation). Needs content.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected",
                "spam"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_id",
            "required": false,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BlogComment"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The comments."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Comment moderation queue",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/comments/counts": {
      "get": {
        "description": "How many comments wait, are shown, rejected or spam. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogCommentCounts"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Comment counts",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/comments/{id}": {
      "delete": {
        "description": "Audited. Needs content.review.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a comment",
        "tags": [
          "admin:content"
        ]
      },
      "patch": {
        "description": "Approve, reject, mark as spam or put back to pending, and/or answer under it (≤ 3000 characters; empty removes the answer). Audited. Needs content.review.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogCommentPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogComment"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The comment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Moderate a comment",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/blog/settings": {
      "get": {
        "description": "The comment mode (off, moderated, auto) and the blog's page size. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Blog settings",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "Comments off, moderated or approved automatically; 3–48 articles a page. Audited. Needs content.publish.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change the blog settings",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/globals": {
      "get": {
        "description": "Global items (pages of kind global, ADR-0085 VB-7b) by name, each with its languages and on how many pages and popups it is placed (their working or live versions). Create, edit, review and publish one through the content page routes (kind global; a new one needs vb_kits). Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "globals": {
                          "items": {
                            "$ref": "#/components/schemas/AdminGlobal"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The global items."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's global items",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/globals/{id}/uses": {
      "get": {
        "description": "The pages and popups whose working or live version places this global item, by language (\"3 sayfada kullanılıyor\"). Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "uses": {
                          "items": {
                            "$ref": "#/components/schemas/GlobalUse"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The uses."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Where a global item is placed",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/layout/convert": {
      "post": {
        "description": "\"Serbest düzene dönüştür\" (ADR-0085 §2, VB-3): the columns section (ADR-0073 container) in, the free layout section out — a row container of N columns, every widget in its column as the node of the same kind — proven to hold the same texts and pictures in the same reading order and to pass the document check. Stores nothing: the editor applies it as one undoable change. A section with a widget the free layout does not have yet (form and newsletter: VB-5; countdown, products, categories, posts: VB-6) is refused with every such block named (details.reason not_convertible, details.refusals). Needs content.read and the store's vb_layout and vb_media_drop (details.reason feature_off).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "section": {
                    "$ref": "#/components/schemas/TemplateSection"
                  }
                },
                "required": [
                  "section"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LayoutConversion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The converted section and what to check."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Convert a columns section into a free layout",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/pages": {
      "get": {
        "description": "Home first, each with its live version and working copy per language. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "languages": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "pages": {
                          "items": {
                            "$ref": "#/components/schemas/ContentPage"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pages."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List pages",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "The home page (kind home, one per store) or a custom page with a slug. Needs content.write; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentPageInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a page",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/pages/{id}": {
      "delete": {
        "description": "Every version goes with it; the home page cannot be deleted. Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a custom page",
        "tags": [
          "admin:content"
        ]
      },
      "get": {
        "description": "Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A page",
        "tags": [
          "admin:content"
        ]
      },
      "patch": {
        "description": "Needs content.write; audited. A patch that changes something emits content.page_changed (the storefront revalidates its page lists and pages); one that changes nothing writes no event and no audit row.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentPagePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename a page or change its slug",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/pages/{id}/draft/{language}": {
      "put": {
        "description": "Stores the editor's work for one language, starting a draft (the next version) when there is none. The document is validated against the section schema set. A version in review or approved is frozen (409). Needs content.write; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "language",
            "required": true,
            "schema": {
              "enum": [
                "tr",
                "en",
                "de",
                "fr",
                "it",
                "es",
                "nl",
                "da",
                "sv",
                "pl",
                "ru",
                "ar"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentDraftInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/pages/{id}/editor": {
      "get": {
        "description": "The page in one language as the customizer's page editor opens it (ADR-0069): the working copy's document (else the live version's) in the section model — a document stored in the older Puck form is converted on the fly without loss (`converted`) — the working copy's revision, the page section schemas with the box every section has, the custom CSS field and whether this operator may change it (theme.publish), the live theme's colour schemes and the areas the working copy changes against the live version. Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "default": "tr",
              "enum": [
                "tr",
                "en",
                "de",
                "fr",
                "it",
                "es",
                "nl",
                "da",
                "sv",
                "pl",
                "ru",
                "ar"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PageEditor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page editor's state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Open a page in the page editor",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/popups": {
      "get": {
        "description": "Popups (pages of kind popup, ADR-0085 §9) by name, each with its languages, its rules (the live version's, else the working copy's, in the first language that has one) and the period's counts — views, closes, conversions and their rate, codes copied, sign-ups and the revenue the popup brought (ADR-0133; each popup of an A/B group is one variant, its rules name the group); with the default rules of a new popup, the page kinds a rule may name and the periods the counts may cover. Create, edit, review and publish a popup through the content page routes (kind popup), or put it live at once with go-live. Needs content.read.",
        "parameters": [
          {
            "description": "The period the counts cover; 30 by default.",
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "enum": [
                7,
                30,
                90
              ],
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "defaults": {
                          "$ref": "#/components/schemas/PopupRules"
                        },
                        "languages": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "page_kinds": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "popups": {
                          "items": {
                            "$ref": "#/components/schemas/AdminPopup"
                          },
                          "type": "array"
                        },
                        "stat_days": {
                          "items": {
                            "type": "integer"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The popups."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's popups",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/popups/{id}/go-live": {
      "post": {
        "description": "The popup studio's \"Yayınla\" (ADR-0133): the working copy of every language that has one (draft, in review or approved) is published in one step and one transaction, without the review the content workflow asks of an editor without the publish right; each version's audit row records go_live. With nothing new to publish, the live versions as they are; with nothing at all, 409. Saving is the editor's ordinary draft save. Needs content.publish.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "versions": {
                          "items": {
                            "$ref": "#/components/schemas/ContentVersion"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The versions now live."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put a popup live at once",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/popups/{id}/pause": {
      "post": {
        "description": "Takes a popup off the store in every language (ADR-0133): each live version is withdrawn — archived where a working copy exists, otherwise turned back into the working copy — so nothing of the work is lost and \"go-live\" brings it back. The storefront hears it as content.page_changed. A popup with nothing live answers the same. Needs content.publish.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "paused": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Paused."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Pause a popup",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/preview-tokens": {
      "post": {
        "description": "A one-hour token the storefront accepts as ?preview= to render the page's working copy and the theme draft. Needs content.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "page_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPreviewToken"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The token."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Issue a preview token",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/redirects": {
      "get": {
        "description": "Every rule, with the allowed statuses and languages. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "languages": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "redirects": {
                          "items": {
                            "$ref": "#/components/schemas/ContentRedirect"
                          },
                          "type": "array"
                        },
                        "statuses": {
                          "items": {
                            "type": "integer"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Redirect rules",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "Adds a 301/302/308 rule; a rule that would close a loop or make a chain longer than five hops is refused (409). Needs content.publish; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentRedirectInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentRedirect"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a redirect",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/redirects/import": {
      "post": {
        "description": "Columns by name: `from` and `to` (required), `status` (301 default, 302, 308), `language` (empty: every language), `note`. A row whose language and from match an existing rule replaces it; any other row is added. Every row is checked like a rule saved by hand, plus duplicates in the file, the store's limit of 2000 rules, and loops and chains over the resulting set. All or nothing: one refused row writes nothing (`applied` false, `errors` by line). `dry_run=1` reports and writes nothing. Needs content.publish; every written rule is audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RedirectImportResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the file did, or would do."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add and replace redirect rules from a CSV",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/redirects/{id}": {
      "delete": {
        "description": "Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a redirect",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "Replaces a rule, with the same checks as adding one. Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentRedirectInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentRedirect"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a redirect",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/sections": {
      "get": {
        "description": "The registered section types and their fields; the editor builds its forms from it. Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SectionSchemaSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The schema set."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The section schema set",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/settings": {
      "get": {
        "description": "Needs content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Editorial settings",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "Self-approval policy and the preview origin. Needs content.publish; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the editorial settings",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions": {
      "get": {
        "description": "Newest first, without documents; status=in_review is the review queue. Needs content.read.",
        "parameters": [
          {
            "in": "query",
            "name": "page_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "versions": {
                          "items": {
                            "$ref": "#/components/schemas/ContentVersion"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The versions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List versions",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}": {
      "get": {
        "description": "With its document. Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A version",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/approve": {
      "post": {
        "description": "in_review → approved. The submitter may approve only when the store allows self-approval (403 otherwise). Needs content.review; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentReviewInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Approve",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/checkpoints": {
      "get": {
        "description": "Save points of a page version, newest first (at most 50 per version). Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "checkpoints": {
                          "items": {
                            "$ref": "#/components/schemas/PageCheckpoint"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The save points."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List a working copy's save points",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "\"Kaydet\" under an area of the page editor (ADR-0069): a save point of the whole draft for an area ('' the whole page, meta, sections, sections/\u003csection id\u003e), at the revision the change was made on. The version must be a draft; a stale revision is refused with 409 (details.reason stale_revision, details.current_revision). Needs content.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageCheckpointInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PageCheckpoint"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The save point."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a save point of a page draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/diff": {
      "get": {
        "description": "Section-level diff (added, removed, changed with the changed fields, moved, unchanged) and page-level field changes between this version and the live version of the same page and language, or another version (?against=\u003cid\u003e). Needs content.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "A version id of the same page and language, or \"published\" (default).",
            "in": "query",
            "name": "against",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentDiff"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The diff."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Compare a version with the live one",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/publish": {
      "post": {
        "description": "approved → published now (the previous live version is archived; emits content.published), or scheduled when `at` is more than a minute ahead (a job publishes it then). Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentPublishInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Publish or schedule",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/reject": {
      "post": {
        "description": "in_review → draft with a required comment. Needs content.review; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentReviewInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reject",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/revert": {
      "post": {
        "description": "\"Bu bölümdeki değişiklikleri geri al\" (ADR-0069): the area goes back to the newest save point that holds it, else to the live version, else to an empty page; one section is replaced where it is, put back at its old place or taken out. The draft as it was is kept as an automatic save point first. Changing a section's own CSS this way needs theme.publish as any save does. Needs content.write; audited (content_version.revert).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageRevertInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft with its document."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put an area of a page draft back",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/rollback": {
      "post": {
        "description": "Publishes a copy of an earlier published version as a new version. Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Restore an earlier version",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/schedule": {
      "delete": {
        "description": "The version stays approved. Needs content.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel a schedule",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/submit": {
      "post": {
        "description": "draft → in_review. Needs content.write; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Submit for review",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/content/versions/{id}/withdraw": {
      "post": {
        "description": "in_review or approved → draft (a schedule is cancelled). Needs content.write; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Withdraw to draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/cookie-consent": {
      "get": {
        "description": "Whether the storefront asks for cookie consent, the current consent version and the optional wording per language (ADR-0038). Defaults (on, version 1, the storefront's own wording) when the store never saved any.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CookieConsentSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's cookie banner settings",
        "tags": [
          "admin:legal"
        ]
      },
      "put": {
        "description": "Switches the banner on or off and replaces the optional wording (per two-letter language: a one-line title up to 120 characters and a plain-text body up to 1000, no markup). `bump_version` raises the consent version by one, which asks every visitor again — for a changed cookie policy or a new tool. The version is never set directly. Switching the banner off also stops every non-essential tag. Audited as cookie_consent.settings_update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CookieConsentSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CookieConsentSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the store's cookie banner settings",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/cookie-consent/stats": {
      "get": {
        "description": "Counts of the choices recorded over the last `days` (1–400, default 30): in total, for the current version, by action and by optional category accepted, and the number of distinct consent ids. Counts only — the records hold no personal data and none is listed. Needs reports.read.",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "schema": {
              "default": 30,
              "maximum": 400,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CookieConsentStats"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Aggregate cookie consent counts",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/create-fulfillment": {
      "post": {
        "description": "Books a shipment against some or all of an order, and lets the order's status follow what has gone out: `shipped` when nothing is left, `partial` while units are still owed. Omitting `lines` ships everything the order still owes, so the same request sent twice ships the whole order and then the remainder. With the built-in `manual` provider an operator packs the box and types the tracking number; a carrier module reads `meta` for its own options, such as courier choice or pickup slot. The shipment is reserved before the carrier is asked and settled after; a carrier that refuses leaves it recorded as failed with its units free again. All lines of one shipment must come from one location (see fulfillment-groups).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "carrier": {
                    "description": "Who is carrying it, as a carrier code. Worked out from the tracking number when left out.",
                    "type": "string"
                  },
                  "lines": {
                    "description": "What goes in this parcel. Omit it to ship everything the order still owes, which on a first shipment is the whole order.",
                    "items": {
                      "properties": {
                        "order_line_id": {
                          "description": "A line the order already has, as returned in line_items[].id.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "quantity": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "order_line_id",
                        "quantity"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "meta": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "order_id": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "parcels": {
                    "description": "The boxes the shipment goes out in, when more than one. Omit for a single box measured from the lines.",
                    "items": {
                      "properties": {
                        "weight_grams": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "provider": {
                    "default": "manual",
                    "type": "string"
                  },
                  "tracking": {
                    "type": "string"
                  }
                },
                "required": [
                  "order_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ship an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/cross-border": {
      "get": {
        "description": "Ayarlar › Pazarlar › Gümrük dahil fiyat (DDP): each market's duties mode, the DAP note, the preferential-origin switch, where parcels leave from, the default duty and the duty rules by HS / GTİP prefix, with the embedded EU standard VAT table (read-only). Off for a store that never saved it. Right: taxes.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrossBorderSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Duties-inclusive pricing (DDP)",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Replaces everything the GET returns except the read-only fields (effective_origin, eu_vat_rates). A market code the store does not have, a mode other than ddp / dap / off, an HS prefix outside 2–12 digits, a rate outside 0–10000 basis points or a prefix listed twice is a 400. Audited as cross_border.update. Right: taxes.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrossBorderSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CrossBorderSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the duties-inclusive pricing settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/cross-border/preview": {
      "post": {
        "description": "The duties and import VAT one product would cost sent to a country, in the store's base currency, the price taken as net (without VAT): the same estimate the checkout charges in a DDP market (ADR-0123), with each assumption named. `settings` previews the form before it is saved. Writes nothing. A variant the store does not have is a 404. Right: taxes.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LandedCostPreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LandedCost"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The estimate."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The landed-cost calculator",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/currencies": {
      "get": {
        "description": "Needs catalog.read. The base currency and every extra currency the store's markets sell in, each priced by hand (manual) or from the European Central Bank's daily reference rate (auto) with a markup and a rounding rule; the last rate, when the prices were last updated, and how many prices are automatic or set by hand.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CurrencySettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The currencies."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's currencies and exchange rates",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/currencies/refresh": {
      "post": {
        "description": "Needs catalog.write. Queues the currency.rates job for the store (it also runs every six hours by itself): fetches the day's ECB rates and rewrites the automatic prices.",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "job_id": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update the rates and automatic prices now",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/currencies/{code}": {
      "put": {
        "description": "Needs catalog.write. manual: prices by hand (the product editor, the CSV). auto: every variant's price in the currency follows the base price × the rate × (1 + markup %), rounded by the rule — a price set by hand is never overwritten. Switching to auto queues a refresh. Audited.",
        "parameters": [
          {
            "description": "An extra currency of the store (ISO 4217).",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreCurrencyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreCurrency"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The currency as it now is."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set how a currency's prices are made",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/currencies/{code}/release-hand-prices": {
      "post": {
        "description": "Needs catalog.write. Every price set by hand in the currency becomes automatic, so the next refresh rewrites it from the rate (an imported price list the store now wants to follow the rate). Audited; queues a refresh when the currency is automatic.",
        "parameters": [
          {
            "description": "An extra currency of the store (ISO 4217).",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "released": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many prices were handed over."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Hand the prices set by hand over to the rate",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/customer-groups": {
      "get": {
        "description": "Groups a price list can be aimed at. Membership is by email address, because this engine has no customers table — a customer is an address that has ordered.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerGroup"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The groups, by name."
          }
        },
        "summary": "Customer groups",
        "tags": [
          "pricing"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Create a customer group",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/customer-groups/{id}": {
      "delete": {
        "description": "Takes its membership and the price lists aimed at it with it. Cascading rather than refusing, unlike a category with products under it: a product orphaned by a deleted category is still valuable and has merely lost its filing, while a price list whose audience has gone is meaningless — it would price for nobody and could never be reached again.",
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gone."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a customer group",
        "tags": [
          "pricing"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "One customer group",
        "tags": [
          "pricing"
        ]
      },
      "patch": {
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "dealer": {
                    "description": "Whether its members are dealers (ADR-0091 §2).",
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Rename or re-code a group",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/customer-groups/{id}/members": {
      "delete": {
        "description": "Removing one that is not in leaves the world as the caller asked, so it is not an error.",
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Out of the group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Remove an address from a group",
        "tags": [
          "pricing"
        ]
      },
      "get": {
        "description": "Takes `customers.read` rather than the discounts right the rest of these routes take: it answers with the shop's customer addresses, and somebody trusted to write a promotion is not thereby trusted to page through the customer list.",
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "format": "email",
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The addresses, folded to lower case."
          }
        },
        "summary": "Who is in a group",
        "tags": [
          "pricing"
        ]
      },
      "post": {
        "description": "Adding one twice is not an error: the caller asked for it to be a member, and it is. The address travels in the body rather than the path because an email in a URL is an email in an access log.",
        "parameters": [
          {
            "description": "The group.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "In the group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Add an address to a group",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/customer-groups/{id}/members/bulk": {
      "post": {
        "description": "A paste or a CSV column; invalid entries are listed back. 409 AUTOMATIC_GROUP for the registered-customers group. Audited (customer_group.members). Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupMembersInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GroupMembersResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add or remove many addresses",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/customer-records": {
      "get": {
        "description": "Newest first. `q` matches an email or a name. Records belong to the store the request acts on (X-Store-Id). Requires customers.read.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "yes keeps the records with a storefront account (ADR-0049), no those without.",
            "in": "query",
            "name": "account",
            "schema": {
              "enum": [
                "any",
                "yes",
                "no"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerRecord"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of records."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's customer records",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Unique by email within the store (409 otherwise). Requires customers.write; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerRecordInput"
                  },
                  {
                    "required": [
                      "email"
                    ]
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The record."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a customer record",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customer-records/{id}": {
      "delete": {
        "description": "Their orders keep their own snapshot. Requires customers.write; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a customer record",
        "tags": [
          "admin:orders"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The record."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One customer record",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "Requires customers.write; audited with what changed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRecordInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The record."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Edit a customer record",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customer-records/{id}/addresses": {
      "get": {
        "description": "The addresses the shopper keeps under Adreslerim (ADR-0049), read on the customer's record by the store's operator — for a customer without an account too. Defaults first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerAddress"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The addresses."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A customer's address book",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "The same rules as the shopper's own edit: the first address is the default for delivery and for the invoice, one default of each kind, at most 20 addresses. The audit row names the operator and never holds the address.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAddress"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Added."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The address book is full."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add an address to a customer's address book",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customer-records/{id}/addresses/{addressId}": {
      "delete": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove an address from a customer's address book",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "A field left out stays as it is.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAddress"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Changed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change an address of a customer's address book",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customer-records/{id}/password-reset": {
      "post": {
        "description": "For a customer record with a storefront account (ADR-0049). Nobody at the store ever sees or sets a shopper's password; this sends the shopper the same link \"forgot my password\" does (1 hour, single use). Audited. Requires customers.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Sent (or, with delivery none, the store cannot send email)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The record does not exist in this store or has no account."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Email the customer a password reset link",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customers": {
      "get": {
        "description": "There is no customer resource behind this. Guest checkout is a permanent guarantee (D22), so a shopper never has an account and an order carries its own snapshot of who bought it — which means a customer can only be every order sharing an email. Name, phone and address come from that person's most recent order. Orders counts everything they placed that was not cancelled; spent totals only what was actually paid, so an order awaiting cash on delivery is a real order and not yet money. Correcting a customer means correcting an order, which is why there is no GET by id, PATCH or DELETE here.\n\nScoped like the orders list: the current store's orders (X-Store-Id, or the tenant's first store); a request with no store (the static token without one) reads the tenant's.",
        "parameters": [
          {
            "description": "Matches an email or a name, case-insensitively.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. Every key is the grouping key or an aggregate over it, so the ordering is on the same number the row shows. There is no `id` key: the listing has no id.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "email",
                "first_order_at",
                "last_order_at",
                "orders",
                "spent"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "account_verified": {
                            "description": "That account has proved its email address.",
                            "type": "boolean"
                          },
                          "address": {
                            "$ref": "#/components/schemas/Address"
                          },
                          "email": {
                            "type": "string"
                          },
                          "first_order_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "has_account": {
                            "description": "The address has a storefront account in the store (ADR-0049).",
                            "type": "boolean"
                          },
                          "last_order_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "orders": {
                            "description": "Orders placed that were not cancelled.",
                            "type": "integer"
                          },
                          "phone": {
                            "type": "string"
                          },
                          "spent": {
                            "$ref": "#/components/schemas/Money",
                            "description": "Totalled over paid orders only."
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One entry per email."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The orders, grouped by who placed them",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/customers/data-export": {
      "post": {
        "description": "Everything the store holds about one email address (customer record, orders with lines, consents, suppressions, notifications, carts, group memberships) as one JSON document for a KVKK/GDPR access request. Logged in privacy requests (hash only) and audited. Needs customers.read and data.export.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerDataExport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The export."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export a customer's data",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/customers/erasure": {
      "post": {
        "description": "Anonymises one email address across the store without rewriting order history: orders keep their number, lines and amounts and lose the email (replaced), name, phone and street address (the country stays). Deletes the customer record and group memberships; anonymises the notification log and carts. Invoices, the buyer tax id, accepted legal texts, consent records, the do-not-send list and the audit trail are retained. Refused while an order is in progress, a return is open or a refund is pending. confirm_email must repeat the address. Logged (hash only) and audited. Needs customers.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "confirm_email": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "note": {
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "confirm_email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ErasureResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What changed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Erase a customer's personal data",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/customs/hs": {
      "get": {
        "description": "The tariff list by code or by words: a code or the start of one (0902, 0902.10, 0904.21.90) lists the lines one level under it in code order (a subheading lists Türkiye's 12-digit GTİP lines); words (green tea, yeşil çay) list the subheadings whose text matches best, Turkish and English folded. At most 10 lines; exact is q's own line when q is a code the list holds. The same for every store. Needs catalog.read.",
        "parameters": [
          {
            "description": "A code (separators . space - allowed) or words.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "tr reads Türkiye's tariff text; anything else the English.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HSSearchResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The lines found."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Look up the tariff list (HS / GTİP)",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/dashboard": {
      "get": {
        "description": "One read for the admin's home screen (MERCHANT_ADMIN §1): counts of orders to ship, payments to check, refunds and returns in progress, failed invoices and deliveries, low stock, and today's orders. Needs orders.read; `low_stock` is null for an operator without inventory.read.",
        "parameters": [
          {
            "description": "Low-stock threshold. Absent: the store's own (GET /inventory/settings, default 5).",
            "in": "query",
            "name": "threshold",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Dashboard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What needs the operator today",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/dealer-applications": {
      "get": {
        "description": "Newest first. `status` pending (the default), approved, rejected, revoked or all; `q` matches the company, the address and the tax number. Right: customers.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected",
                "revoked",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DealerApplication"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The applications."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Dealer applications (Müşteriler › Bayi başvuruları)",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/dealer-applications/counts": {
      "get": {
        "description": "Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerApplicationCounts"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Dealer applications per status",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/dealer-applications/{id}": {
      "get": {
        "description": "Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerApplication"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One dealer application",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/dealer-applications/{id}/approve": {
      "post": {
        "description": "A waiting application's address joins a dealer group (`group_id`, else the store's default, else \"Bayiler\", made and made the default). From then on the dealer sees hidden prices and the group's prices; their open baskets are priced again in the same transaction. The applicant is emailed. Audited (dealer_application.approve). 409 unless waiting. Right: customers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealerDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerApplication"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Approve a dealer application",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/dealer-applications/{id}/reject": {
      "post": {
        "description": "A waiting application is closed with a `reason` the applicant reads (required). The applicant is emailed. Audited (dealer_application.reject). 409 unless waiting. Right: customers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealerDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerApplication"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reject a dealer application",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/dealer-applications/{id}/revoke": {
      "post": {
        "description": "An approved application ends with a `reason`: the address leaves every dealer group of the store and its open baskets are priced again at once — hidden prices are gone, and the checkout refuses a dealer-only line still in a basket (dealer_only). Audited (dealer_application.revoke). 409 unless approved. Right: customers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealerDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerApplication"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Revoke a dealership",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/diagnostics": {
      "get": {
        "description": "The same checks `nerocart doctor` runs and the MCP `store_health` tool returns — the database, the migration ledger, admin access, the outbox, stock reservations, carts, the catalog, the registered providers, this contract, admin route gating, fulfillment, refunds, returns, the stock ledger and discounts.\n\nIt answers 200 even when `ok` is false, because the report is the answer rather than the error: a non-2xx would send a client down its error path at the one moment the detail matters most. `/health/ready` keeps its 503 because an orchestrator needs a status code; a person needs the detail.\n\nA check that failed because it could not run records the underlying driver text separately from its finding, and this response never carries it — a pgx error names a host, a port and a user, and the rest of this API refuses to send those to a client. It is written to the store's log instead. `nerocart doctor` and `doctor -json` still print it.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DiagnosticReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The report, whether or not the store is well."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's health report",
        "tags": [
          "admin:ops"
        ]
      }
    },
    "/api/v1/admin/discounts": {
      "get": {
        "parameters": [
          {
            "description": "Match the title or the code.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "active",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only the discounts of this campaign (a campaign's own page lists them).",
            "in": "query",
            "name": "campaign_id",
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. Automatic discounts have no code and sort last in both directions. There is no key for the state chip or for what the rule takes off: the first is derived from five columns at once, and the second mixes basis points with minor units.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "code",
                "created_at",
                "id",
                "title",
                "used_count"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Discount"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Discounts, newest first unless `sort` says otherwise."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List discounts",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Discount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created discount."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a discount",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}": {
      "delete": {
        "description": "Orders that used it keep their snapshot and read correctly.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a discount",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DiscountDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The discount, plus what it has actually cost."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a discount",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "`used_count` cannot be written: it is a fact about what happened, and letting an operator type over it would silently reopen a promotion that has been fully used. `target_ids` absent leaves the stored set alone; a list replaces it whole, because the caller holds the whole list; `[]` clears it, which is refused while the resulting scope is still products, collections or categories. Setting `scope` to `order` clears the targets in the same transaction without needing `target_ids`. Moving the scope to or between the other three requires `target_ids` in the same body — the targets it would otherwise inherit are of the wrong kind. A patch that changes only `target_ids` is a real edit and bumps `updated_at`. (This operation still references DiscountInput rather than a DiscountPatch schema, so the field documents both verbs by accident rather than by design.)",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Discount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated discount."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a discount",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/codes": {
      "get": {
        "description": "Oldest first, each with whether it was used. Right: discounts.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DiscountCode"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The codes."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A discount's single-use codes",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "count (1–1000) codes, each usable once and giving what the discount gives; prefix (up to 16 letters, digits, dashes; default the discount's own code) starts each. Each code is a copy of the discount with usage limit 1, left out of the discounts list. At most 1000 per discount. Right: discounts.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountCodesInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DiscountCode"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "All the discount's codes."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make single-use codes of a discount",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/coupon-uses": {
      "get": {
        "description": "The pages and popups whose working or live version holds a coupon widget for this discount, by language (\"3 sayfada kullanılıyor\" before it is deleted). Needs discounts.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "uses": {
                          "items": {
                            "$ref": "#/components/schemas/CouponUse"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The uses."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Where a discount's coupon is shown",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/history": {
      "get": {
        "description": "value_bp and value_minor are integers on both sides of a change, never a percentage and never a formatted amount. A record with no rows answers 200 with an empty array rather than 404: the log knowing nothing about a record is not the record being absent, and everything that existed before this table did has an honestly empty history.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A discount’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/orders": {
      "get": {
        "description": "What a promotion has actually been spent on, newest first. The rows are the snapshots taken at checkout, so a rule that has since been renamed still reads as what it was.\n\nCancelled orders are listed here, marked by their status, and excluded from the detail's `redeemed_total` — so `meta.total` counts more orders than `redeemed_orders` whenever any were cancelled.\n\nNeeds both `discounts.read` and `orders.read`: the row carries an order number, an email address and a total.\n\nA deleted rule's redemptions are unreachable here, because `order_discounts.discount_id` is `ON DELETE SET NULL` and the snapshots stay with their orders.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DiscountRedemption"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Redemptions, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Orders that used this discount",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/preview": {
      "post": {
        "description": "A dry run, so a new promotion's first test is not a real customer. Nothing is locked, nothing is written and no usage is claimed, so a preview can never exhaust a code.\n\nA rule that would not apply comes back as `applies: false` with the reason, not as an error — the question was whether it works, and \"no, it expired on Friday\" is a successful answer to it. Reasons include an expired or unstarted window, an inactive rule, a usage limit reached, a basket below the minimum, a code already used by that email address, a scope holding nothing in this basket, and a codeless automatic rule, which nothing evaluates at checkout yet.\n\nSend `subtotal_minor` for an order-wide rule, or `lines` for a scoped one — a scoped rule comes off the lines its targets reach, which a bare total cannot say. Sending both is a 400.\n\nThe request being wrong is still an error: an unknown id is 404 and a negative amount is 400.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "description": "Optional. `once_per_email` cannot be previewed without it.",
                    "type": "string"
                  },
                  "lines": {
                    "description": "The basket line by line, for a scoped rule. A scoped rule previewed with a bare subtotal answers `applies: false` saying the lines are missing, rather than reporting an amount it cannot know.",
                    "items": {
                      "properties": {
                        "product_id": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "total_minor": {
                          "format": "int64",
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "subtotal_minor": {
                    "description": "The basket to try it against, in minor units. Use this or `lines`, not both.",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DiscountPreview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the rule would do, or why it would not."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Try a discount against a basket",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/discounts/{id}/products": {
      "get": {
        "description": "The products this promotion applies to, resolved the way checkout resolves them: the products a rule names, the members of its collections, or everything filed under its categories (descendants included); an order-wide rule reaches every product. Newest first, best match first under `q`. Assigning products is the discount's own PATCH (`target_ids`). Needs both `discounts.read` and `catalog.read`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "Narrows to products matching this text, as the product listing searches.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DiscountProduct"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The products, one page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Products a discount reaches",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/domain-redirect": {
      "put": {
        "description": "none, www_to_apex or apex_to_www; enforced at the edge. Needs store.write. Audited (`domain.redirect`).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "redirect": {
                    "type": "string"
                  }
                },
                "required": [
                  "redirect"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreDomainInfo"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The canonical host."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the www/apex policy",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains": {
      "get": {
        "description": "Hosts routed (active) or waiting for verification (pending) to the store, primary first, with the DNS records to create. `target` is the host custom domains point at (empty when the platform has not configured one). Needs store.write. With an edge configured (W8) a verified host goes on through dns_pending and ssl_pending to active; `edge` names it, `steps` are its instructions per host not yet active, `redirect` is the store's www/apex policy. With the route53 edge and the Cloudflare for SaaS layer on (ADR-0106) a domain passes cf_pending (still routing) after ssl_pending, and its www host appears beside it (provider cloudflare_saas).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "domains": {
                          "items": {
                            "$ref": "#/components/schemas/StoreDomain"
                          },
                          "type": "array"
                        },
                        "edge": {
                          "enum": [
                            "none",
                            "manual",
                            "cloudflare",
                            "bunny"
                          ],
                          "type": "string"
                        },
                        "nameservers": {
                          "description": "With the bunny edge: the nameservers a merchant sets at the registrar (ns1–ns4.nerocart.com); null with any other edge.",
                          "items": {
                            "type": "string"
                          },
                          "type": [
                            "array",
                            "null"
                          ]
                        },
                        "redirect": {
                          "enum": [
                            "none",
                            "www_to_apex",
                            "apex_to_www"
                          ],
                          "type": "string"
                        },
                        "steps": {
                          "additionalProperties": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "type": "object"
                        },
                        "target": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "domains",
                        "target",
                        "redirect",
                        "edge",
                        "steps"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The domains."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the store's domains",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "Adds a host as pending with a verification token; it routes nothing until POST /domains/{host}/verify finds the TXT record. A host already connected to any store is refused without naming the store. Needs store.write. Audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "host": {
                    "type": "string"
                  }
                },
                "required": [
                  "host"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreDomain"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pending domain."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a domain",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}": {
      "delete": {
        "description": "Stops routing the host to the store. The primary domain cannot be removed. Needs store.write. Audited.",
        "parameters": [
          {
            "description": "The host name, lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a domain",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/check": {
      "post": {
        "description": "Takes the host as far along its lifecycle as it goes now: ownership, DNS, certificate (with an edge configured). Needs store.write.",
        "parameters": [
          {
            "description": "The host name, lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainCheck"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The check."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Check a domain again",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/mail-setup": {
      "post": {
        "description": "Computes the diff again against the zone as it is now and writes it: adds and replaces first, removals last (the domain always has an MX host). Idempotent: a second call writes nothing (`pending` 0). Audited as domain.mail_setup. Writes only the apex MX and TXT, _dmarc, \u003cselector\u003e._domainkey and autodiscover. Needs store.write.",
        "parameters": [
          {
            "description": "One of the store's domains (the apex or its www), lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailSetupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailSetupPlan"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The diff, applied."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The DNS service did not answer (code provider_error)."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply a mail-provider setup",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/mail-setup/check": {
      "get": {
        "description": "Looks the domain's MX, SPF, DKIM (the selectors in its zone, or the provider's usual ones) and DMARC up in public DNS, as a mail server sees them; each is ok, warn, missing, error or unchecked. Needs store.write.",
        "parameters": [
          {
            "description": "One of the store's domains (the apex or its www), lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailCheck"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The check."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Live check of a domain's mail records",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/mail-setup/preview": {
      "post": {
        "description": "The diff the setup would write in the domain's DNS zone, nothing written: each record to add, replace (with the value it replaces), remove (other MX hosts, SPF records folded into the one) or keep. The SPF include is merged into the one v=spf1 record; a starter DMARC (p=none) only where none exists. 400 for a pasted value of the wrong shape; 404 for a host that is not the store's; 409 when the domain is not on NeroCart's nameservers. Needs store.write.",
        "parameters": [
          {
            "description": "One of the store's domains (the apex or its www), lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailSetupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailSetupPlan"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The diff."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The DNS service did not answer (code provider_error)."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview a mail-provider setup",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/primary": {
      "post": {
        "description": "The storefront's canonical host. Only an active host can be primary. Needs store.write. Audited.",
        "parameters": [
          {
            "description": "The host name, lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreDomain"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The domain."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make a domain primary",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/domains/{host}/verify": {
      "post": {
        "description": "Looks up the TXT record _cos-verify.\u003chost\u003e and activates the host when it carries the token. A lookup failure is reported in `error`, not as an HTTP error. Needs store.write. Audited when it activates.",
        "parameters": [
          {
            "description": "The host name, lower-case.",
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainCheck"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The outcome."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Verify a domain",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/email-campaigns": {
      "get": {
        "description": "Newest first, at most 500. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/EmailCampaign"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaigns."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List e-mail campaigns",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "A draft; nothing is sent until send. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/email-campaigns/{id}": {
      "delete": {
        "description": "Not while it is sending; its recipient list goes with it. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      },
      "get": {
        "description": "Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      },
      "patch": {
        "description": "Only a draft or a scheduled one. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Edit an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/email-campaigns/{id}/cancel": {
      "post": {
        "description": "A scheduled one, or one sending: who has had it keeps it. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stop an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/email-campaigns/{id}/send": {
      "post": {
        "description": "Now, or at `at` (at most a year ahead). Each recipient's copy is a commercial message: only those who consent receive it, with the opt-out link. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "at": {
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmailCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The campaign, sending or scheduled."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send an e-mail campaign",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/email-campaigns/{id}/test": {
      "post": {
        "description": "Marked as a test; not counted, not in the recipient list. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Sent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a campaign to one address",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/etgb/days": {
      "get": {
        "description": "The days the store closed or changed, newest first: the daily record (günlük kayıt). Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ETGBDaySummary"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One page of days."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The ETGB days",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}": {
      "get": {
        "description": "A closed day as it was recorded; an open day built now from its export shipments (outside Türkiye, not digital, not gifts or samples — those are listed under `gifts`), with the typed cells over the automatic values, rows added by hand and rows left out. Each row says whether it is prepared (e-invoice, label and commercial invoice present) and whether it needs an A.TR. Needs orders.read.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A day's ETGB sheet",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/cells": {
      "put": {
        "description": "A typed value survives every refill of the automatic values; `clear` takes it off. 404 for a row or column the day does not have, 409 for a closed day. Audited (etgb.cell_set). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ETGBCellInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Type over a cell of a day's sheet",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/close": {
      "post": {
        "description": "Records the day as it stands — its rows and the papers of its shipments; a shipment it recorded is in no later day, and a shipment booked after the closing goes to the next day. Audited (etgb.day_close). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close a day",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/exclude": {
      "post": {
        "description": "A shipment left off is in neither the sheet nor the folder, and a closed day keeps it so no later day takes it. Audited (etgb.row_exclude). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ETGBExcludeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Leave a shipment off a day's sheet, or put it back",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/folder": {
      "get": {
        "description": "A zip laid out as DD.MM.YYYY/: each export shipment's commercial invoice and e-invoice, the sheet, labels/, atr/ (the A.TR shipments' papers again and the A.TR sheet) and gift/ (gifts and samples, with label/). A paper that could not be fetched is listed in eksik_belgeler.txt. Needs orders.read.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The folder."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Download a day's folder",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/reopen": {
      "post": {
        "description": "Typed cells and rows are kept; the automatic values are filled anew. 409 when the day is not closed. Audited (etgb.day_reopen). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Open a closed day again",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/rows": {
      "post": {
        "description": "An empty row; its cells are typed. 409 for a closed day. Audited (etgb.row_add). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a row by hand to a day's sheet",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/rows/{row}": {
      "delete": {
        "description": "Only a row added by hand (`m…`); a shipment's row is left out with /exclude instead. Audited (etgb.row_remove). Needs orders.fulfill.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "The row's key.",
            "in": "path",
            "name": "row",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBDay"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The day's sheet as it stands now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a row typed by hand",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/days/{day}/sheet": {
      "get": {
        "description": "The sheet as an .xlsx file (numbers as numbers, the invoice date as a date); `kind=atr` keeps the rows that need an A.TR. Needs orders.read.",
        "parameters": [
          {
            "description": "The day, YYYY-MM-DD (the store's calendar).",
            "in": "path",
            "name": "day",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "etgb",
                "atr"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The workbook."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Download a day's sheet",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/mail-log": {
      "get": {
        "description": "Every send time evaluated, newest first: queued (with each recipient's delivery status), skipped (nothing prepared) or failed. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ETGBMailLogEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One page of sends."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The scheduled ETGB e-mails",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/settings": {
      "get": {
        "description": "ADR-0144: the sheet's columns (each filled from a field of the catalog, a fixed text or typed by hand), sheet and file names, the defaults for the goods description, GTİP and Incoterm, the A.TR rule, the daily closing time and the scheduled e-mail. The owner's 19-column form until the store changes it. `fields` is the catalog; `mail_ready` says whether the store has an e-mail sender. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The set-up."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The ETGB workspace set-up",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "Replaces the whole set-up; `columns` empty puts the owner's form back, `atr_countries` empty is the 27 EU member states and `atr_threshold_minor` 0 is 150 (in `atr_currency`, EUR by default). The signature is sanitised HTML. Switching the daily e-mail on needs at least one recipient and one send time. Audited (etgb.settings_update). Needs shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ETGBSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The set-up."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the ETGB workspace set-up",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/etgb/settings/reset": {
      "post": {
        "description": "The owner's 19 columns, sheet name and file name again; typed cells stay with their column keys. Audited (etgb.columns_reset). Needs shipping.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ETGBSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The set-up."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put the ETGB sheet back to the default form",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/events": {
      "get": {
        "description": "A page of `outbox_events`, newest first, behind `store.operate`. The three states partition the table: `published` is `published_at IS NOT NULL`, `dead` is `dead AND published_at IS NULL`, `pending` is the rest — so a row that raced into both flags is counted once, as published. Rows omit `payload`, because a page of order payloads is megabytes and the list is for finding the row rather than reading it; `last_error` is included, because it is what an operator scans the list for. An empty page is `\"data\": []` and never null.",
        "parameters": [
          {
            "description": "One of the three derived states. Anything else is a 400.",
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "pending",
                "dead",
                "published"
              ],
              "type": "string"
            }
          },
          {
            "description": "An exact event name, such as order.paid.",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The kind of thing the event is about, such as order or cart.",
            "in": "query",
            "name": "aggregate_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One record's events. Requires aggregate_type: the index is on the pair, and the second column alone is a sequential scan of every event ever delivered.",
            "in": "query",
            "name": "aggregate_id",
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The events one request caused: its X-Request-Id, as shown on the event, on its audit rows (request_id) and in the request's log line.",
            "in": "query",
            "name": "correlation_id",
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OutboxEvent"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of the outbox, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What the outbox has tried to deliver",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/events/retry-dead": {
      "post": {
        "description": "Requeues up to 500 dead letters per call, optionally narrowed to one event name — the same `UPDATE … SET dead = false, attempts = 0` an operator used to run in psql, run by the engine and logged with their name. `remaining` is counted inside the same transaction, so the pair cannot disagree and the panel can say \"Retried 500 of 3,214\" rather than a bare 500; a non-zero `remaining` means call it again. The claim takes `FOR UPDATE SKIP LOCKED`, so two operators clearing a backlog take disjoint sets and neither can stall the dispatcher. No request body is read.",
        "parameters": [
          {
            "description": "Only dead letters of this event name.",
            "in": "query",
            "name": "name",
            "schema": {
              "example": "order.paid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RequeueResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many moved, and how many are still parked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Un-park the dead letters",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/events/{id}": {
      "get": {
        "description": "The row the list found, plus the `payload` the handlers were given. The payload is the event verbatim, so for an order it carries the buyer's email, phone and name and every line they bought — which is why `store.operate` is owner-only by default.",
        "parameters": [
          {
            "$ref": "#/components/parameters/EventID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OutboxEvent"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The event."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One event, with its payload",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/events/{id}/retry": {
      "post": {
        "description": "Two repairs behind one verb, chosen by the row's state under the lock. A **dead** row is un-parked — `dead = false, attempts = 0, available_at = now()` — with a fresh twelve-attempt budget; nothing else can recover it, because the dispatcher's claim filters `NOT dead`. A **pending** row is only brought forward: `available_at = now()`, attempts untouched, because backoff reaches fifteen minutes but the twelve-attempt bound is the whole dead-letter policy and an operator must not be able to hold a broken event in retry forever. A **published** row is refused 409: redelivering a delivered event is a replay, and this engine has no verb for that. Neither act clears `last_error`. No request body is read. The dispatcher is nudged after the commit, so delivery normally follows within milliseconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/EventID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OutboxEvent"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The row after the repair."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make one event deliverable again",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/export-downloads/{token}": {
      "get": {
        "description": "Unauthenticated: the link is the credential. The first request spends it; the operator who asked for it is loaded again and must still hold the export's rights (a role narrowed since is refused with 403). The file streams as it is written (`Cache-Control: no-store`, `Referrer-Policy: no-referrer`). An unknown or malformed link is a 404; a used or expired one a 410. Audited (`export.download`).",
        "parameters": [
          {
            "description": "`\u003ctenant id\u003e.\u003csecret\u003e` as returned in the link's url.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The link was used or has expired."
          }
        },
        "summary": "Download an export through its link",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export-links": {
      "post": {
        "description": "Needs data.export. `kind` is products, orders, customers, inventory or categories; `params` are the filters the matching `GET /export/admin-*` route takes in its query string (products: q, status, collection_id, category_id; orders: every orders-list filter and `ids`; customers: q, sort, order), checked now — a bad filter is a 400 here, not a broken file later. `format` is nerocart (default) or shopify (not for categories). The link is bound to this tenant and store, expires in five minutes, works once and is served without credentials to whoever holds it; only a hash of it is stored. Audited (`export_link.create`). Customers are the current store's.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportLinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ExportLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link. Open `url` (relative to the API origin) within five minutes; it works once."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ask for a one-shot download link to a data export",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export/admin-categories": {
      "get": {
        "description": "The tree written down: one row per category, the trail from the root in one cell — `Apparel / Clothing / Shirts`, the same thing the product file's `category` column says. Columns are `path, slug, position, products, metadata`. Rows come depth first, so a parent is always above its children and the file reads back in one pass. `products` is counted from the products filed directly under the category; it is written for the reader and ignored on the way in. The tree has one dialect: `format=shopify` is refused, because Shopify's category export is its taxonomy file, which `/api/admin/import/taxonomy` reads.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Format"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export the category tree as CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export/admin-customers": {
      "get": {
        "description": "One row per person who ordered from the current store (the listing's scope: X-Store-Id, or the tenant's first store) — the mailing list a shop actually asks this screen for. A customer is a reading of the orders and not a table (see GET /api/admin/customers), so the columns are the same aggregates the listing shows: name, phone and address from that person's most recent order, orders not cancelled, and lifetime spend as `spent_minor` plus `currency` rather than a formatted amount. `q` and `sort` are the listing's own, so a file taken off a filtered screen is the rows on that screen. This reading has no import of its own; customer records (with consent) are imported by the import job, `kind=customers`.\n\n`format=shopify` writes Shopify's customers export column for column, the name split at its last space into First Name and Last Name, Total Spent as a decimal, and `no` in every consent column, because nothing here has recorded a consent.",
        "parameters": [
          {
            "description": "Matches an email or a name, case-insensitively — the same predicate the listing uses.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Order the file by one of these fields; omit for the listing's own order, most recent buyer first. Anything else is a 400 — issued before a byte of CSV is written, which is the only moment it still can be.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "email",
                "first_order_at",
                "last_order_at",
                "orders",
                "spent"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "$ref": "#/components/parameters/Format"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export customers as CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export/admin-inventory": {
      "get": {
        "description": "The stock-take's file: one row per variant per location, whether or not the shelf has a row yet, so there is a cell for the empty one. The store's own layout is `sku, product_title, variant_label, location, on_hand, reserved, available`, the location by code. `format=shopify` writes Shopify's inventory export column for column — Handle, Title, the option columns, SKU, HS Code, COO, Location (the location's name), Incoming, Unavailable, Committed (what is reserved here), Available, On hand.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Format"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export every count at every location as CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export/admin-orders": {
      "get": {
        "description": "One row per order line, with the order's columns repeated — the shape an accountant's pivot table wants.\n\n`format=shopify` writes Shopify's orders export column for column — Name (`#` and the number), Financial Status, Fulfillment Status, decimal amounts, Lineitem columns, billing and shipping blocks — with the order's own columns on its first line only, as Shopify writes them. Columns this store has no value for (risk level, employee, note attributes) are present and blank. The filters are the orders list's own (one function parses both), and the file is the current store's orders, as the list is.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Format"
          },
          {
            "description": "The list's search: order number prefix, email or name.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "pending",
                "open",
                "completed",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "payment_status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fulfillment_status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "needs",
            "schema": {
              "enum": [
                "returns",
                "payment",
                "delivery",
                "transfer"
              ],
              "type": "string"
            }
          },
          {
            "description": "Comma-separated order ids (at most 500): the panel's bulk export of a selection.",
            "in": "query",
            "name": "ids",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true exports only the orders in the trash. Without it trashed orders are left out, unless `ids` names them.",
            "in": "query",
            "name": "in_trash",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A CSV file."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export orders as CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/export/admin-products": {
      "get": {
        "description": "One row per variant. Cells beginning with =, +, - or @ are prefixed with an apostrophe, because a spreadsheet executes those on open; import strips exactly one back, so the round trip stays lossless. It takes the same filters as the admin product listing — q, status, vendor, product_type, tag, category_id and collection_id — so a reconciliation can export exactly the rows a screen is showing. There is no paging: an export streams every row that matched. Row order stays p.id, v.position, v.id whatever the filters are, because the importer requires a product's variant rows to be contiguous.\n\nTwo dialects, one model: `format=shopify` writes Shopify's product export column for column (Handle, Title, Body (HTML), Option1 Name … Variant Price, Image Src, Variant Image, Cost per item, Status), with prices as decimals in the store's currency, one row per variant and a row of nothing but a picture for each one past the last variant. The store's own layout carries the same fields — vendor, product_type, tags, category, seo_title, seo_description, cost_minor, taxable, weight_unit — plus `images`, `image_alts` and `variant_images`, which are picture URLs; site-relative ones leave as absolute addresses under the request's own host.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "draft",
                "active",
                "archived"
              ],
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "vendor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "product_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Products carrying exactly this tag. Exact rather than case-folded so the match is answered by the index; tags are de-duplicated case-insensitively on write, so one spelling of a tag is the only spelling stored.",
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to a category and everything nested under it. An unparseable value is an error rather than a silently ignored filter, because a filter that quietly matches everything is how a typo turns into \"why is this showing the whole catalogue\".",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Restrict to one collection's members, and order them the way that collection was curated rather than newest-first. An unparseable value is an error rather than a silently ignored filter. A collection nobody has is an empty page, not a 404. If a sort parameter is ever added to this listing, sending it together with collection_id must be a validation error rather than a silent override: a collection's order is the curation (D40).",
            "in": "query",
            "name": "collection_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Format"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export the catalog as CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/free-design/convert": {
      "post": {
        "description": "\"Bu sayfayı serbest tasarıma çevir\" (ADR-0104 §4): the area's current sections — a page's working copy (else its live version; the home page inside the theme's home template), or a theme area's template or section group (the draft's, else the live theme's) — drawn as markup and unscoped CSS in the language, with the sections it drew and the ones it left out and why. Writes nothing: the editor loads the result, and saving it is the area's ordinary save. Needs content.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FreeDesignConvertInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FreeDesignConversion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The design."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Serbest Tasarım: an area's sections drawn as a starting design",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/free-design/starters": {
      "get": {
        "description": "The ready designs a merchant may begin an area with (ADR-0104 §4), in the picker's order, with their names in the asked language (else Turkish) and the storefront path of their 960×600 preview; page:\u003cid\u003e lists the page starters. The designs themselves are read one at a time. Writes nothing. Needs content.read.",
        "parameters": [
          {
            "in": "query",
            "name": "area",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/FreeDesignStarter"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The starters."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Serbest Tasarım: the starter designs of an area",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/free-design/starters/{id}": {
      "get": {
        "description": "One starter's design (GrapesJS project data, markup, unscoped CSS) to load into the editor; taking it is an ordinary save of the area, checked like any design. Writes nothing. Needs content.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FreeDesignStarterDesign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The starter."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Serbest Tasarım: one starter design",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/fulfillments/{id}": {
      "delete": {
        "description": "The order follows it. \"Shipped\" was true because that record existed, so removing the last one that says so puts the order back to confirmed — leaving it shipped with nothing shipping it would be a state no operation could explain and no operator could correct.\n\nRefused on a delivered order: a parcel somebody received is not a record to erase, and undoing the delivery first is the operation that says so.\n\nReturns the order, whose status may have moved with the shipment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a shipment recorded in error",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "Typing a tracking number is the one step of shipping a parcel nobody else checks, so it is the one that gets mistyped. This changes what was recorded about the shipment and nothing about the order: the parcel left either way, and correcting the number is not un-shipping it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FulfillmentPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "additionalProperties": true,
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The corrected shipment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Correct a shipment's tracking number",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/fulfillments/{id}/deliver": {
      "post": {
        "description": "One parcel reached the customer. When it is the last parcel of an order that shipped in full, the order is delivered too. Usually recorded by the tracking job.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a shipment as delivered",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/fulfillments/{id}/delivery-failed": {
      "post": {
        "description": "The carrier could not hand the parcel over. The units still count as sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a failed delivery",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/fulfillments/{id}/labels/{position}": {
      "get": {
        "description": "The label bytes the carrier returned, stored by the engine and served as an attachment to staff only — a label carries the customer's name, phone and address.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "position",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file, as an attachment."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A shipment's label",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/gift-cards": {
      "get": {
        "description": "The store's gift cards, newest first; q matches the last four characters, the recipient or the note. Right: discounts.read.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GiftCard"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List gift cards",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "Issues a card by hand; send e-mails the code to the recipient. The answer carries the whole code, once — the store keeps only its hash. Right: discounts.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftCardInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftCard"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The card, with its code."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Issue a gift card",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/gift-cards/{id}": {
      "get": {
        "description": "Right: discounts.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftCard"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A gift card with its movements",
        "tags": [
          "admin:marketing"
        ]
      },
      "patch": {
        "description": "Status (active, disabled), expiry, note, or a hand adjustment of the balance (adjust_minor, signed). Right: discounts.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftCardPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftCard"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a gift card",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/gift-shipping": {
      "get": {
        "description": "Whether gift orders are offered on the order page, and whether automatic invoicing leaves them out. Right: orders.read (the order page reads it too).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's gift shipping settings",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Right: shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The saved settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the gift shipping settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/image-generation": {
      "get": {
        "description": "Media \u003e Create with AI (ADR-0129). The four providers (openai, imagen, stability, fal) with whether the store entered a key, whether the ai-images plugin is on and at least one provider is ready (`ready`), the store's monthly limit and what it used this month, and the styles and aspects offered. Keys are never returned. Right: media.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImageGenStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "AI logo and banner generation: state",
        "tags": [
          "admin:media"
        ]
      },
      "post": {
        "description": "Makes 1 to 4 pictures from a description with the chosen provider and the store's own key, and stores each in the media library as a PNG or WebP upload tagged yapay-zeka. The month's count is reserved first (429 image_limit_reached over the limit) and handed back for a picture that fails. 409 image_generation_not_configured without a key; 422 image_key_refused / image_prompt_declined; 402 image_provider_quota; 429 image_provider_busy; 502 image_provider_error. Right: media.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageGenInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImageGenResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The pictures, now in the library."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "The provider account has no credit."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "No key is entered for this provider."
          },
          "422": {
            "description": "The provider refused the key or declined the description."
          },
          "429": {
            "description": "The monthly limit is reached or the provider is busy."
          },
          "502": {
            "description": "The provider failed."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make logos or banners with AI",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/import-jobs": {
      "get": {
        "description": "Needs data.import. The tenant's recent imports, newest first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ImportJob"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The imports."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List CSV imports",
        "tags": [
          "admin:data"
        ]
      },
      "post": {
        "description": "Needs data.import, and for a translation file catalog.write, collections.write and categories.write, for a stock file inventory.write, a category file categories.write, a customer file customers.write. The request body is the CSV file itself (at most 32 MiB). The import is stored and a background job checks it: the real importer runs in rehearsal (in transactions that are rolled back) and its report — rows to create and to update, row errors, and a row-by-row `plan` — becomes `report`. Nothing changes until `POST /import-jobs/{id}/apply`. Every kind sets rather than adds, so applying the same file twice converges.\n\n`kind`:\n- `products` — products, variants, prices per currency as `price_minor:\u003cCUR\u003e` / `compare_at_price_minor:\u003cCUR\u003e`, stock per location.\n- `inventory` — counts per SKU and location (`sku`, `location`, `on_hand` or `available`, optional `reason_code`; Shopify's inventory file too). `reason_code` (query) is required and labels every stock movement; a row's own `reason_code` cell overrides it. The plan shows the count before and after (`sku@location`).\n- `categories` — the tree by path (`path` as `Parent / Child`, `slug`, `position`, `metadata`); missing steps are built, nothing is moved or deleted.\n- `customers` — customer records of the current store keyed by `email` (`first_name`, `last_name`, `phone`, `note`; a blank cell changes nothing) and commercial-message consent: `email_consent` / `sms_consent` = yes | no | empty, `consent_note`, `consent_date` (YYYY-MM-DD, not in the future), `recipient_type` (BIREYSEL | TACIR). A consent is granted only with a note saying where it was given — the row's `consent_note` or the import's `consent_note` (query); a row without one is a row error. Imported consents have source `import`, the note, file name and import id as proof, `consent_date` as their date, and are queued for İYS. `no` withdraws a consent the store holds; it needs no note.\n\nAudited (`import_job.create`); customer and consent changes write their own audit rows.\n\n`kind=translations` takes a translation file (`GET /translations/export`: columns entity, id, handle, language, field, source_text, translation, status, source — one row per record, language and field) and needs catalog.write, collections.write and categories.write as well; each record is written as an imported translation — a draft published through review. An empty translation cell changes nothing and a record whose text is unchanged is skipped; the dry run checks entity, id, language, field and explicit slugs and lists glossary warnings.",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "default": "products",
              "enum": [
                "products",
                "translations",
                "inventory",
                "categories",
                "customers"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filename",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Stock files: the reason every movement is recorded with. Required for kind=inventory.",
            "in": "query",
            "name": "reason_code",
            "schema": {
              "enum": [
                "counted",
                "received",
                "damaged",
                "lost",
                "returned",
                "correction",
                "other"
              ],
              "type": "string"
            }
          },
          {
            "description": "Customer files: where the consents in the file were given (at most 500 characters), for rows without their own consent_note.",
            "in": "query",
            "name": "consent_note",
            "schema": {
              "maxLength": 500,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Format"
          },
          {
            "$ref": "#/components/parameters/Overwrite"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportJob"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import, validating."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Upload a CSV for import",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import-jobs/{id}": {
      "get": {
        "description": "Needs data.import. `rows_done` of `rows_total` is the progress of the step running now; `report` is the dry run's result, `result` the real run's.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportJob"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a CSV import",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import-jobs/{id}/apply": {
      "post": {
        "description": "Needs data.import. Only a `validated` import; a background job runs the importer for real and the file's bytes are dropped when it is done. Audited (`import_job.apply`). The kind's own right is checked again (inventory.write, categories.write or customers.write).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportJob"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import, applying."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply a checked CSV import",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import-jobs/{id}/cancel": {
      "post": {
        "description": "Needs data.import. Only a `validated` import; its file is dropped. Audited (`import_job.cancel`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportJob"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import, cancelled."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel a checked CSV import",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/categories": {
      "post": {
        "description": "`path` is required and is the identity: a row whose trail already exists updates that category's position, slug and metadata, and a row whose trail does not builds every missing step on the way to it. Either separator is read, `/` or `\u003e`. Running the same file twice therefore changes nothing the second time. The file cannot move or delete a category — a typo in a path would otherwise drag a subtree and the products under it somewhere else with no undo; moving stays on the screen that has the cycle check and the product count. A blank cell leaves a field alone, a slug another category already holds is a row error, and the whole file is one transaction, so a tree is never half built. `dry_run=1` reports what would happen and writes nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add and update categories from a CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/category-attributes": {
      "post": {
        "description": "An empty body imports the embedded dictionary; a body is the operator's own file in the two-section `handle = Label : v | v` then `gid : handle, handle` format. It attaches field lists to categories already carrying a taxonomy id, so it follows the tree rather than preceding it — against a tree from somewhere else every line is unmatched. The dictionary rows themselves are upserted, so a store's own entries survive. Same extended deadlines as the tree import.",
        "requestBody": {
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxonomyAttributeImport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the import did."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import the attribute dictionary",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/collections": {
      "post": {
        "description": "For migrating brands, look-books and other groupings from another platform. Columns: `title` (required), `slug`, `description`, `seo_title`, `seo_description`, `position` and `products` (product slugs separated by `|`, in the order shown). A row adds the collection, or updates the columns the file has when the slug exists. A product slug the store does not have is a row error and leaves that collection as it was. `dry_run=1` reports what would happen and writes nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add and update handpicked collections from a CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/content": {
      "post": {
        "description": "For migrating WordPress posts and pages with their languages. `items` are pages or articles with a `languages` map (title, description, TipTap `document`, excerpt, cover image, author, seo_title, `published_at`); every language goes in published, dated as the old site dated it. An article has one address for all languages, a page its own per language (`slugs`). `blog_categories` are added when missing. An item whose address already belongs to a page is skipped, so a file can be run again; one that fails is removed again so no half-built page stays. `dry_run=1` validates everything and writes nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "blog_categories": {
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "items": {
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import pages and blog articles from a JSON file",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/inventory": {
      "post": {
        "description": "One row per variant per location, each in its own transaction, keyed by SKU and location — the code in the store's own layout (blank for the default), the name or the code in Shopify's. `on_hand` (On hand) is the count; when it is blank, `available` (Available) is read against what is reserved there right now. The rules are the product file's: a count cannot drop below what is reserved, a closed location takes nothing in, and a row naming a SKU or location the store does not have is a row error, not a failed file. Shopify's `not stocked` leaves the row alone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          },
          {
            "$ref": "#/components/parameters/Format"
          },
          {
            "description": "Optional: the reason every movement is recorded with; a row's reason_code cell overrides it.",
            "in": "query",
            "name": "reason_code",
            "schema": {
              "enum": [
                "counted",
                "received",
                "damaged",
                "lost",
                "returned",
                "correction",
                "other"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set counts from a CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/orders": {
      "post": {
        "description": "For migrating from another platform. It does not touch inventory — those stock movements happened on the old system — and it fires no events unless `fire_events` is set, because importing five thousand orders must not send five thousand confirmation emails. An order whose number already exists is skipped, so re-importing an export is a no-op.\n\nShopify's orders export is read as it is — the dialect is recognised by its Name and Lineitem columns — so a store moving here brings its history unchanged: `#1001` becomes order 1001, Financial Status becomes the payment status, a fulfilled order arrives shipped, a Cancelled at makes it cancelled, amounts are read as decimals in the file's currency, and the shipping address is used, or the billing one when there is only that.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          },
          {
            "in": "query",
            "name": "fire_events",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Format"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import historical orders from CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/products": {
      "post": {
        "description": "Upserts by SKU. Rows for one product must be contiguous — which is what export produces — so a large file streams instead of being held in memory. A bad row is reported with its line number and never aborts the file.\n\nA `stock_on_hand:\u003ccode\u003e` cell that raises the count at a closed location fails that row, naming the code: stock moves out of a closed location, never into it. A cell at or below the current count is accepted, so an unedited export of a closed location's zeros still imports.\n\nThe dialect is read off the header — a Shopify file has a Handle column — unless `format` says. A column the file does not have says nothing about that field, so a price list updates prices and leaves everything else as it was. Pictures are linked by URL: `images` (or Image Src rows) replace the product's list in the file's order, `variant_images` (Variant Image) set a variant's own, and a URL the media library already holds is reused. In Shopify's dialect a blank Variant SKU is given the handle, numbered when the product has options; Variant Inventory Qty lands at the default location; Product Category is matched to the store's tree by its full path.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          },
          {
            "$ref": "#/components/parameters/Format"
          },
          {
            "$ref": "#/components/parameters/Overwrite"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import products from CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/reviews": {
      "post": {
        "description": "For migrating from another platform: reviews and star ratings with the date, rating, text and name the shopper gave. Columns: `product_slug` (or `sku`), `rating` (1-5), `body` (may be empty: the old shop counted stars alone), `author_name`, and optionally `title`, `email`, `verified` (the old shop's statement, not checked here), `status` (approved by default, pending or rejected), `locale`, `created_at` (RFC 3339 or YYYY-MM-DD) and `source_id`. A review without an email gets a placeholder at import.invalid derived from `source_id`, so a second run of the same file creates nothing. Nothing is generated. The whole file is one transaction; `dry_run=1` reports what would happen and writes nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/DryRun"
          }
        ],
        "requestBody": {
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ImportResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import product reviews from CSV",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/taxonomy": {
      "post": {
        "description": "An empty body imports the embedded Shopify taxonomy — ~14,000 categories, idempotent on (parent, title), so running it twice adds only what is missing. A body is the operator's own file in the published `gid : A \u003e B \u003e C` format. The embedded set also imports the field definitions in the same call, because they match on the taxonomy id this import writes and a tree from anywhere else has nothing to match. One transaction: half a taxonomy is worse than none. It can take minutes; the request extends its own read and write deadlines past the server's, and a client that disconnects rolls the transaction back.",
        "requestBody": {
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxonomyImportResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the import did."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import a category tree",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/import/xml": {
      "post": {
        "description": "A supplier's or another platform's product feed (Ticimax, IdeaSoft, ikas, Google Merchant…), by address (fetched over the public internet, no redirects, 90 s) or pasted, up to 20 MB. The repeating product element is found and its fields read by the names such feeds use; the result is an ordinary product import job (dry run first, then apply). Right: data.import.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/XMLImportResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The import job."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import products from an XML feed",
        "tags": [
          "admin:data"
        ]
      }
    },
    "/api/v1/admin/install": {
      "post": {
        "description": "Public only while no superuser exists; afterwards it is 409 for everyone. This is the one-time window that lets a fresh install become usable without shell access.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/AuthResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Create the first superuser",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/inventory/hidden-stock": {
      "get": {
        "description": "The tenant's shipped variants with their hidden count (ADR-0142), those holding some first, then by product. Needs inventory.read.",
        "parameters": [
          {
            "description": "Matches the SKU or the product's title.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only variants with a hidden count above zero.",
            "in": "query",
            "name": "held",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/HiddenStockRow"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One page of variants."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Hidden stock by variant",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/inventory/low-stock": {
      "get": {
        "parameters": [
          {
            "description": "Low-stock threshold. Absent: the store's own (GET /inventory/settings, default 5).",
            "in": "query",
            "name": "threshold",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Without it the threshold is against the store's total, which is what a single-location store means: a variant with one unit in each of five shops is not low by that reading, even though every shelf looks it. With it, the threshold is against that location alone and each row carries `at_location`. Only variants the location already has a stock row for are considered.",
            "in": "query",
            "name": "location_id",
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Order the page by one of these fields; omit for the report's own order, which is emptiest first. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on the variant id, so two pages of one report never repeat or skip a row. The three stock keys follow `location_id`: without it they are the store-wide sums shown on the row, and with it they are that one location's own numbers — the same figures `at_location` carries, so the column being sorted is always the column being read.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "available",
                "on_hand",
                "price",
                "reserved",
                "sku"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Variant"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Variants running out."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Variants at or below a stock threshold",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/inventory/settings": {
      "get": {
        "description": "The store's low-stock threshold and the stock adjustment reason codes. Needs inventory.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventorySettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Inventory settings",
        "tags": [
          "admin:inventory"
        ]
      },
      "put": {
        "description": "Needs inventory.write. Audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "low_stock_threshold": {
                    "maximum": 1000000,
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "low_stock_threshold"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventorySettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the low-stock threshold",
        "tags": [
          "admin:inventory"
        ]
      }
    },
    "/api/v1/admin/invitations": {
      "get": {
        "description": "Outstanding first, then accepted ones most recent first. Accepted invitations are kept so the team screen can answer who let somebody in.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Invitation"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Invitations."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List invitations",
        "tags": [
          "admin:auth"
        ]
      },
      "post": {
        "description": "Returns the invitation with its `token` and `accept_url` — the only response that ever carries them. Send the link; the invitee chooses their own password and nobody else ever sees it.\n\nRe-inviting an address replaces the outstanding invitation, so the previous link stops working. An address that already belongs to an operator is refused: changing somebody's role has its own endpoint, and it cannot be used to hand out a fresh password.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "example": "new.person@example.com",
                    "type": "string"
                  },
                  "role": {
                    "default": "staff",
                    "description": "A system role (owner, manager, staff) or a custom role's key.",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invitation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The invitation, with its link."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Invite somebody to the team",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/invitations/accept/{token}": {
      "get": {
        "description": "Unauthenticated, necessarily: the invitee has no account yet. Holding the token is the credential, and the response says only what somebody with the link is about to be told anyway. An expired, used or unknown token resolves to nothing.",
        "parameters": [
          {
            "description": "The secret from the invitation link.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invitation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Who it is for and what it grants."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "See what an invitation is for",
        "tags": [
          "admin:auth"
        ]
      },
      "post": {
        "description": "Creates the operator with the password they choose and signs them in, returning the same token/record shape as signing in does. An invitee who has just chosen a password should not then be shown a login form.\n\nThe invitation is claimed with a conditional update inside the same transaction, so two people opening one link cannot both become operators.",
        "parameters": [
          {
            "description": "The secret from the invitation link.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "minLength": 8,
                    "type": "string"
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/AuthResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Accept an invitation",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/invitations/{id}": {
      "delete": {
        "description": "Closes an outstanding link. An accepted invitation is history and cannot be revoked — remove the operator instead.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Revoke an invitation",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/invoice-items": {
      "get": {
        "description": "The store's list: the name on the invoice, the customs description and the tariff number (GTİP), by name. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/InvoiceItem"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Invoice items (what products are invoiced as)",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Name 1–120 characters, unique in the store; customs at most 105; hs_code empty or 6–12 digits (dots are dropped). At most 100 per store. Audited (invoice_item.create). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceItemInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create an invoice item",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/invoice-items/assignments": {
      "get": {
        "description": "A product invoiced under its own name is absent. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/InvoiceItemAssignment"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The invoice item of each product",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Puts 1–1000 products on an item, or (item_id null) back on their own names. Audited (invoice_item.assign). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceItemAssignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/InvoiceItemAssignment"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Invoice products as an item",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/invoice-items/{id}": {
      "delete": {
        "description": "Its products are invoiced under their own names again. Audited (invoice_item.delete). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete an invoice item",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Audited (invoice_item.update). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceItemInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoiceItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace an invoice item",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/invoices": {
      "get": {
        "description": "Newest first.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Invoice"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of invoices."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List invoices",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoices/{id}": {
      "get": {
        "description": "With its return documents and the cancel deadline.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The invoice."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read an invoice",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoices/{id}/cancel": {
      "post": {
        "description": "Only inside the 8-day window from delivery; after it the answer is 409 and a return document is recorded instead. An e-Fatura is cancelled outside the integrator and recorded here with external_reference.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "external_reference": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "reason"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cancelled invoice."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel an invoice",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoices/{id}/pdf": {
      "get": {
        "description": "The PDF from the integrator, to print into the parcel.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The PDF."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The invoice's printable copy",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoices/{id}/retry": {
      "post": {
        "description": "Optionally with the TCMB exchange rate a foreign-currency invoice was missing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "exchange_rate": {
                    "description": "TRY per unit, e.g. 34.1234.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The invoice, pending."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a failed invoice again",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoices/{id}/return-documents": {
      "post": {
        "description": "After the cancel window: the business buyer's iade faturası or the seller's own document for a consumer return.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceReturnDocumentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The invoice."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a return document",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoicing": {
      "get": {
        "description": "Installed providers, whether invoicing is live for this store, and its settings.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoicingStatus"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Invoicing status and settings",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/invoicing/settings": {
      "put": {
        "description": "Carrier map (code → unvan, VKN), payment types, exemption code. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicingSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InvoicingSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the invoicing settings",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/jobs": {
      "get": {
        "description": "A page of the tenant's `jobs`, newest first, behind `store.operate` (P1-11, ADR-0014). Rows omit `payload`: the list is for finding a job, the single read is for reading it. `last_error` is included, because it is what an operator scans the list for. `failed` is a valid filter but nothing writes it: a failure that will be retried is `queued` again and one that will not is `dead`. An empty page is `\"data\": []`.",
        "parameters": [
          {
            "description": "An exact job type, such as notify.send.",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One of the six states. Anything else is a 400.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "queued",
                "running",
                "succeeded",
                "failed",
                "dead",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only jobs enqueued for this store. Tenant-wide work (recurring passes, nudges) records no store and is left out by this filter.",
            "in": "query",
            "name": "store_id",
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Created at or after: YYYY-MM-DD or RFC 3339.",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Created before: an RFC 3339 instant (exclusive), or YYYY-MM-DD for that whole day.",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The jobs one request caused: its X-Request-Id, as shown on its audit rows (request_id) and events (correlation_id).",
            "in": "query",
            "name": "correlation_id",
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of jobs, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's background jobs",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/jobs/{id}": {
      "get": {
        "description": "The row the list found, plus its `payload` with every secret-looking value replaced by `[redacted]`: any value whose key names a token, secret, password, key, credential, signature, session or the like, and any string that is a sealed secret (`enc:v1:`) or an Authorization value, at any depth. The stored payload is untouched; the handler still receives it.",
        "parameters": [
          {
            "description": "The job's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Job"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The job."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One job, with its payload redacted",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/jobs/{id}/cancel": {
      "post": {
        "description": "Only a `queued` job; a running one is a 409 (its handler is already doing the work). Race-safe with the worker's claim: whichever takes the row lock first wins, and a cancelled job is never claimed. Audited as `job.cancel`. No request body is read.",
        "parameters": [
          {
            "description": "The job's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Job"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The job, cancelled."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stop a queued job before it runs",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/jobs/{id}/retry": {
      "post": {
        "description": "Only a `dead` job: it is queued to run now with `max_attempts = attempts + 1`, so it runs exactly once more and, if its cause is not fixed, is dead again rather than retried on its backoff. Of two clicks racing, one wins and the other is a 409. `last_error` is kept until the next run. Audited as `job.retry`. No request body is read.",
        "parameters": [
          {
            "description": "The job's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Job"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The job, queued."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Give a dead job one more run",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/kdv/categories": {
      "get": {
        "description": "The platform's list of product kinds with their Turkish KDV rate and legal basis (2007/13033 and its amendments to 2026-11-04), groups first, each group's entries after it. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/KDVCategory"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The KDV list",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/kdv/classes": {
      "get": {
        "description": "The store's classes that carry a rate, by name. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/KDVClass"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The classes."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's KDV classes",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Returns the store's class for a list entry (made the first time it is picked), or makes the merchant's own class with any rate. Audited (tax_class.create). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KDVClassInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/KDVClass"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The class."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a KDV class",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/launch-checklist": {
      "get": {
        "description": "What the store still needs before it can sell (MERCHANT_ADMIN, constitution §12B onboarding): store details, a tax rate, a shipping zone with a rate, a payment method switched on, the legal texts published, a listed product, a routed domain, email sending; İYS and SMS as optional. Each item is computed from the store's own state and names the admin screen that fixes it. Reads only. Needs store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LaunchChecklist"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The checklist."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The launch checklist",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Puts the launch checklist away on the store's home screen, or shows it again (owner 2026-10-26). Only this is written; the checklist is still computed. Returns the checklist. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchChecklistVisibility"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LaunchChecklist"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The checklist."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Hide or show the launch checklist",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/legal-contract-identity": {
      "get": {
        "description": "Whose details the contracts name as the seller. Reading carries no right, like the legal settings.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContractIdentity"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The contracts' seller."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The contracts' seller",
        "tags": [
          "admin:legal"
        ]
      },
      "put": {
        "description": "Chooses the company details or details written for the contracts alone. Audited (legal.contract_identity_update). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContractIdentity"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContractIdentity"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The contracts' seller."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the contracts' seller",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-documents": {
      "get": {
        "description": "Every version, newest first per kind and language, with the placeholder catalogue.",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "documents": {
                          "items": {
                            "$ref": "#/components/schemas/LegalDocument"
                          },
                          "type": "array"
                        },
                        "placeholder_aliases": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Short Turkish names a text may use for the seller's facts ({{unvan}} → seller.legal_name, {{magaza_adi}} → seller.name, …), filled exactly like the name they stand for (ADR-0086).",
                          "type": "object"
                        },
                        "placeholders": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "public_paths": {
                          "additionalProperties": {
                            "additionalProperties": {
                              "type": "string"
                            },
                            "type": "object"
                          },
                          "description": "The storefront URL of each kind that has a public address of its own, per language (privacy_policy: /gizlilik-politikasi, /en/privacy-policy, /de/datenschutz; terms_of_use: /kullanim-sartlari, /en/terms-of-use, /de/nutzungsbedingungen). Other kinds live at /{locale}/legal/{kind}.",
                          "type": "object"
                        },
                        "required_at_checkout": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The documents."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List legal documents",
        "tags": [
          "admin:legal"
        ]
      },
      "post": {
        "description": "Creates the next version of its kind and language as a draft. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalDocumentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Draft a legal document",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-documents/{id}": {
      "get": {
        "description": "One version.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The document."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a legal document",
        "tags": [
          "admin:legal"
        ]
      },
      "patch": {
        "description": "Only a draft changes; published text is never edited because orders point at it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalDocumentPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Edit a draft",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-documents/{id}/preview": {
      "get": {
        "description": "Rendered with the store's details; order placeholders show as dashes.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RenderedLegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rendered text."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview a version",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-documents/{id}/publish": {
      "post": {
        "description": "Makes the draft the live version of its kind and language and archives the one it replaces. Checkout then requires acceptance of the required kinds. A contract engine draft (ADR-0148) is the owner's approval: its placeholders are filled in now (the owner's values, the store's details, the approval date); one that nothing fills refuses the publish with 400 legal_fields_missing, details.placeholders naming them.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The published document."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Publish a draft",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine": {
      "get": {
        "description": "The contract engine (ADR-0148, Sözleşme Motoru) for the store: whether it is on, whether an AI key is set (the store's own or the platform's), every category that holds an active product with its legal class (EK-C) — `needs_review` when the AI was unsure (confidence below 0.5) or named an obstacle to selling it online, until the owner confirms it — the last pass and its progress, the last document plan (EK-D), the newest draft of each document type with its audit against the checklist (EK-A: verdicts, legal basis, a proposed text per finding), the newest audit of each published text, and the fields the drafts leave for the owner with the values they will be filled with at publishing. No right needed, like the legal texts.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The contract engine's state",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/audits": {
      "post": {
        "description": "Mevcut metni denetle: ÖZ-DENETİM on the text as rendered (with the store's details), the template-residue check without the model, and a proposed text per finding, in the background (202). 400 for a text the engine does not draft (its kind and language map to no document type). 409 as for a pass. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEngineAuditInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Started; the state with the new pass."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Audit one of the store's texts as it reads now",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/classes/{category_id}": {
      "put": {
        "description": "The owner's class (and optional second class) for a category; 0 is the active products in no category. Confirms it. An obstacle the AI named stays while the class is unchanged. 404 for a category the store does not have. Audited. Needs store.write.",
        "parameters": [
          {
            "description": "The category's id; 0 for the products in none.",
            "in": "path",
            "name": "category_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEngineClassInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Confirm or change a category's legal class",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/documents/{id}/findings/{code}/apply": {
      "post": {
        "description": "Into the engine's draft of the document while it is a draft; otherwise (an audited published text, or a draft since published) into a new draft made from the live text. The paragraph the finding was about is replaced while it is still there word for word, else the clause is added at the end. Nothing is published. 409 without a proposal, or for a draft written with the document editor. Needs store.write.",
        "parameters": [
          {
            "description": "The engine document's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "The checklist item, e.g. MS-05.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineApplied"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft and the engine document."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put a finding's proposed text into a draft",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/documents/{id}/findings/{code}/suggest": {
      "post": {
        "description": "Asks the store's AI now for a clause that meets the checklist item: the problem, the item's own legal basis, the proposed text and why. Replaces an earlier proposal. 409 for an item that is met; 409 ai_not_configured without a key; 502 when the AI fails or answers out of form. Needs store.write.",
        "parameters": [
          {
            "description": "The engine document's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "The checklist item, e.g. MS-05.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The document with the new proposal."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Propose a text for one finding (DÜZELTME ÖNERİSİ)",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/fields": {
      "put": {
        "description": "The owner's values for the placeholders the drafts leave ([MERSİS NO], [KEP ADRESİ], …), filled in when a draft is published. An empty value removes the owner's value (the store's details fill it again where they can). Values may not contain brackets. Audited. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEngineValuesInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the values of the drafts' fields",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/runs": {
      "post": {
        "description": "`classify` puts every category but those the owner set into a legal class (SINIFLANDIRMA, 20 categories with up to five sample products per call); a pass that leaves a category for the owner ends `waiting`. `prepare` classifies the categories still without a class, then plans the documents (BELGE PLANI, settled against EK-D) and drafts each one (ÜRETİM, continued with DEVAM when cut), audits it in batches of twelve items (ÖZ-DENETİM), revises it once when an item is not met (REVİZYON), audits it again and proposes a text per finding left (DÜZELTME ÖNERİSİ). Drafts land among the store's legal texts as drafts; publishing them is the owner's approval. Runs in the background (202). 409 while the engine is off, with no AI key (code ai_not_configured) or while another pass runs. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEngineRunInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Started; the state with the new pass."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start a contract engine pass",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-engine/settings": {
      "put": {
        "description": "Opts the store in or out. Off stops the regeneration sweep; drafts and classes stay. Audited as legal_document.settings_update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEngineSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEngineState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch the contract engine on or off",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-settings": {
      "get": {
        "description": "MERSİS, tax office, KEP, web address and the periods printed into the texts.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The seller's legal details",
        "tags": [
          "admin:legal"
        ]
      },
      "put": {
        "description": "Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the seller's legal details",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/legal-templates/{kind}": {
      "get": {
        "description": "The engine's standard text in Turkish (default), English or German, with placeholders and a review banner ('hukukçu tarafından gözden geçirilmelidir' / 'must be reviewed by a lawyer' / 'von einem Rechtsanwalt geprüft werden'). Not legal advice; other languages answer 404.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "distance_sales",
                "preliminary_info",
                "kvkk_notice",
                "cookie_policy",
                "return_policy",
                "privacy_policy",
                "terms_of_use"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalDocumentInput"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The template, ready to post as a draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The engine's skeleton for a kind",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/licence-keys/{id}/restore": {
      "post": {
        "description": "For a code the store knows was never used (a refund before it was redeemed, a code burned by mistake); its unit goes back on the shelf. A reason is required. Audited as licence_key.restore. Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "reason": {
                    "maxLength": 300,
                    "type": "string"
                  }
                },
                "required": [
                  "reason"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicenceKey"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The code, masked."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put a burned code back into its pool",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/licence-keys/{id}/reveal": {
      "post": {
        "description": "Every call writes a licence_key.reveal audit row naming the operator, in the same transaction as the read; the code is not in the row. Answered no-store. Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RevealedLicenceKey"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The code."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a code in the clear",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/locations": {
      "get": {
        "description": "In the order stock is drawn from them: lowest priority first.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Location"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Locations."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List locations",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "A new location holds nothing and is not made default — that would silently redirect every future reservation as a side effect of adding a shelf. Move stock into it with the variant transfer endpoint.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created location."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Open a location",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/locations/{id}": {
      "delete": {
        "description": "Refused while it holds stock, and refused for the default one — something has to answer \"where does this land\". Orders already filled from here keep reading; their lines simply stop naming a place.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Closed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close a location",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The location."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a location",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Deactivating one that still holds stock is refused, and the error names how many units are stranded: an inactive location would have its units counted in `stock_on_hand` while nothing could reserve them.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated location."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a location",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/locations/{id}/default": {
      "post": {
        "description": "The default is where stock lands when nothing names a place: new variants, CSV imports, and every client written before locations existed. Exactly one location is the default, so this moves it rather than adding one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Location"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The new default."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make this the default location",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/locations/{id}/history": {
      "get": {
        "description": "Includes location.set_default, which silently redirects every future reservation in the store. A record with no rows answers 200 with an empty array rather than 404: the log knowing nothing about a record is not the record being absent, and everything that existed before this table did has an honestly empty history.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A location’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/locations/{id}/movements": {
      "get": {
        "description": "The same ledger from the other end: everything that has moved at one location, newest first. A location that has been deleted answers 404 — its rows stay readable on the variant route, where the location_code snapshot still names where the units were.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "description": "Narrow to one SKU.",
            "in": "query",
            "name": "variant_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Only what one order caused.",
            "in": "query",
            "name": "order_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "One or more movement kinds, comma-separated or repeated. An unknown kind is a 400 rather than an empty page.",
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "opening",
                "adjust",
                "stock_take",
                "import",
                "transfer_out",
                "transfer_in",
                "reserve",
                "commit",
                "release",
                "restock",
                "sell"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only movements with these coded reasons (comma-separated or repeated).",
            "in": "query",
            "name": "reason_code",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StockMovement"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Movements, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Everything that moved at one location",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/locations/{id}/stock": {
      "get": {
        "description": "The inverse of `GET /api/admin/variants/{id}/stock`: what one place is holding, rather than where one variant is. Each row carries `at_location` beside the variant's store-wide figures, so \"the store has 40, this shelf has none\" is one row rather than two requests. Only variants this location already has a stock row for appear — one it has never carried is not a shelf it can restock.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "Defaults to true. A row is held when `on_hand` or `reserved` is non-zero, the same test that refuses a close, so this listing and that refusal always agree about what is there. `nonzero=0` adds the rows sitting at zero.",
            "in": "query",
            "name": "nonzero",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Variant"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Variants held here, most units first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What one location holds",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/loyalty": {
      "get": {
        "description": "Its defaults when never saved. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyProgram"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The programme."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's loyalty programme",
        "tags": [
          "admin:marketing"
        ]
      },
      "put": {
        "description": "Points per unit of the base currency on paid orders (what gift cards and store credit did not pay), a point's worth as store credit, the least to redeem, and referral points. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoyaltyProgram"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyProgram"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The programme."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the store's loyalty programme",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/loyalty/adjust": {
      "post": {
        "description": "Signed: positive gives, negative takes. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "points": {
                    "type": "integer"
                  }
                },
                "required": [
                  "email",
                  "points"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyAccount"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The points."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move a customer's points by hand",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/loyalty/customer": {
      "get": {
        "description": "Balance, its worth and the last 50 movements. Right: customers.read.",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "format": "email",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyAccount"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The points."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A customer's points",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/mail-contacts": {
      "get": {
        "description": "Every contact and group, by name. Right: notifications.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailBook"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The address book."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's e-mail address book",
        "tags": [
          "admin:notifications"
        ]
      },
      "post": {
        "description": "An address once per store; at most 1000. Audited. Right: notifications.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailContactInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailContact"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a contact",
        "tags": [
          "admin:notifications"
        ]
      }
    },
    "/api/v1/admin/mail-contacts/{id}": {
      "delete": {
        "description": "Audited. Right: notifications.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a contact",
        "tags": [
          "admin:notifications"
        ]
      },
      "put": {
        "description": "Audited. Right: notifications.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailContactInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailContact"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The contact."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a contact",
        "tags": [
          "admin:notifications"
        ]
      }
    },
    "/api/v1/admin/mail-groups": {
      "post": {
        "description": "A name once per store; at most 100. Audited. Right: notifications.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a group",
        "tags": [
          "admin:notifications"
        ]
      }
    },
    "/api/v1/admin/mail-groups/{id}": {
      "delete": {
        "description": "Its contacts stay, out of it; a mail naming it reaches no one through it. Audited. Right: notifications.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a group",
        "tags": [
          "admin:notifications"
        ]
      },
      "put": {
        "description": "Audited. Right: notifications.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The group."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename a group",
        "tags": [
          "admin:notifications"
        ]
      }
    },
    "/api/v1/admin/mail-setup": {
      "get": {
        "description": "Ayarlar › Alan adları › E-posta (MX) kurulumu (ADR-0118): the catalogue of mailbox providers (Google Workspace, Microsoft 365, Yandex 360, Zoho Mail EU and global, Other) with their documented MX set, SPF include, verification shape, DKIM selectors and signup/admin links, and the store's own domains (`managed`: on NeroCart's nameservers, so the setup can write it). Needs store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailSetupPage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The catalogue and the domains."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ready mail-provider setups",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/maintenance/drain-outbox": {
      "post": {
        "description": "Delivers every event that is due, synchronously, instead of waiting for the dispatcher's poll. It is the same delivery path the background dispatcher runs, and the two can run at once: `FOR UPDATE SKIP LOCKED` keeps their claims disjoint.\n\n`delivered` counts rows claimed, not rows a handler accepted. A handler that errors leaves its row for the dispatcher's backoff, which is what at-least-once means. And a drain does not resurrect dead-lettered rows — those are excluded from the claim by design, and requeueing one is a separate act.\n\nThe pass has a 30-second budget, checked between batches and never inside one: a batch is claimed whole before any of it is dispatched, so cutting one short would burn a retry on every event it had claimed and not yet reached. `capped: true` therefore means a partial pass, not a failure. One pass at a time per process; a second request while one is running is refused rather than queued.\n\nThe body is ignored — send `{}`.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "capped": {
                          "description": "The 30-second budget ran out with work still due. A partial pass, not a failure.",
                          "type": "boolean"
                        },
                        "delivered": {
                          "description": "Outbox rows claimed across every batch in this pass.",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the pass delivered."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Force a delivery pass on the outbox",
        "tags": [
          "admin:ops"
        ]
      }
    },
    "/api/v1/admin/maintenance/sweep-carts": {
      "post": {
        "description": "Runs the three cart phases in one pass: an expired basket holding something is marked abandoned and announced as `cart.abandoned`, an expired basket holding nothing is deleted, and an abandoned one is deleted once `Config.CartRetention` has run out. The route runs the same service method the engine's own five-minute ticker runs — there is no second state machine and no panel-only maintenance path.\n\nEach phase is bounded, so a store carrying a backlog clears it over successive presses rather than in one statement; `capped` says a phase filled its batch and there is more to do.\n\nThe body is ignored — send `{}`.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "abandoned": {
                          "description": "Expired baskets with lines in them, marked abandoned and announced.",
                          "type": "integer"
                        },
                        "capped": {
                          "description": "A phase filled its batch; press again for the rest.",
                          "type": "boolean"
                        },
                        "purged": {
                          "description": "Abandoned baskets deleted because they are past Config.CartRetention.",
                          "type": "integer"
                        },
                        "removed": {
                          "description": "Expired baskets holding nothing, deleted.",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the pass moved."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sweep the carts now",
        "tags": [
          "admin:ops"
        ]
      }
    },
    "/api/v1/admin/maintenance/sweep-unpaid": {
      "post": {
        "description": "Cancels pending orders whose payment never settled — pending or failed — past their reservation window, returning their stock to the shelf. Each cancellation is its own transaction and emits the ordinary `order.cancelled` event with the reason \"payment not completed in time\". The route runs the same service method the engine's own five-minute ticker runs — there is no second state machine and no panel-only maintenance path.\n\nOne pass, never a loop, and safe to press twice: cancelling an already-cancelled order does nothing. An order the service could not cancel is logged and skipped, which lowers `cancelled` without lowering what the pass found — which is why `capped` is derived from what was found.\n\nThe body is ignored — send `{}`.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "cancelled": {
                          "description": "Expired unsettled orders this pass actually cancelled.",
                          "type": "integer"
                        },
                        "capped": {
                          "description": "The pass examined a full batch of 200 expired orders, so there may be more. Derived from what it found, not from what it cancelled: a backlog where some cancellations failed still says \"press again\" rather than \"queue clear\".",
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the pass moved."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Release stock held by unpaid orders",
        "tags": [
          "admin:ops"
        ]
      }
    },
    "/api/v1/admin/marketing-automations": {
      "get": {
        "description": "Every kind — welcome, win_back, birthday, post_purchase — saved or with its starting text, and how many went out in the last 30 days. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketingAutomation"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The automations."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the automatic e-mails",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/marketing-automations/{kind}": {
      "put": {
        "description": "Sent hourly to those who became due in the last 3 days, once per reason (account, order, year); only to customers who accept marketing e-mail. A win-back waits at least 7 days; a birthday e-mail goes on the day. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "welcome",
                "win_back",
                "birthday",
                "post_purchase"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingAutomationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketingAutomation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The automation."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save an automatic e-mail",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/marketing-automations/{kind}/test": {
      "post": {
        "description": "Marked as a test. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "welcome",
                "win_back",
                "birthday",
                "post_purchase"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Sent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send an automatic e-mail to one address",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/markets": {
      "get": {
        "description": "Where the store sells (M3, ADR-0004): countries, currency and languages, the default first. Needs catalog.read, because the product editor prices a variant per market currency.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Market"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The markets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the store's markets",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "Needs store.write. Country codes are upper-cased and de-duplicated, language tags lower-cased. The store's first market is its default whatever the input says; `is_default` on a later one moves the flag. Audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Market"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created market."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a market",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/markets/{id}": {
      "delete": {
        "description": "Needs store.write. The default market cannot be removed (409). Orders placed in the market keep their snapshot. Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a market",
        "tags": [
          "admin:settings"
        ]
      },
      "get": {
        "description": "Needs catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Market"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The market."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a market",
        "tags": [
          "admin:settings"
        ]
      },
      "patch": {
        "description": "Needs store.write. An absent field is kept. Setting `is_default` true moves the flag from the old default; setting it false on the default is a 409 — make another market the default instead. Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Market"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated market."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a market",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/me": {
      "get": {
        "description": "Any signed-in operator, whatever their role. The static admin token has no person behind it and gets a 403.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "newest_session": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "sessions": {
                          "description": "Live sessions, i.e. devices signed in.",
                          "type": "integer"
                        },
                        "superuser": {
                          "$ref": "#/components/schemas/Superuser"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The caller."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Who am I, and where am I signed in",
        "tags": [
          "admin:auth"
        ]
      },
      "patch": {
        "description": "Deliberately not behind `team.write` — that is also the right to change everybody's role, and gating this behind it means a staff member must ask an owner to choose a password for them.\n\n`current_password` is required for either change: a session left open on an unlocked laptop should not be enough to take the account over. Changing the password ends every other session and keeps this one.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "current_password": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "minLength": 8,
                    "type": "string"
                  }
                },
                "required": [
                  "current_password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SuperuserResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change your own email or password",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/mfa": {
      "delete": {
        "description": "Needs the password and a code. Refused (403) when the membership or the role requires a second factor: that is the store's policy to change.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "otp": {
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  },
                  "recovery_code": {
                    "type": "string"
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The code is not valid."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove the second factor",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/mfa/confirm": {
      "post": {
        "description": "The first correct code from the authenticator confirms the enrollment and returns the recovery codes. Wrong codes are throttled.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "otp": {
                    "description": "The current code (`code` is accepted as a synonym).",
                    "type": "string"
                  },
                  "recovery_code": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "recovery_codes": {
                          "description": "Ten single-use codes, shown once and stored only as hashes.",
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "On, with recovery codes."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The code is not valid (`invalid_mfa_code`)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many wrong codes."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Turn the second factor on",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/mfa/enroll": {
      "post": {
        "description": "Returns a TOTP secret (RFC 6238: HMAC-SHA1, 30 s, 6 digits) and its otpauth:// URI, once. Nothing is on until the first code is confirmed. Refused (409) when a second factor is already set up.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "algorithm": {
                          "type": "string"
                        },
                        "digits": {
                          "type": "integer"
                        },
                        "otpauth_url": {
                          "type": "string"
                        },
                        "period": {
                          "type": "integer"
                        },
                        "secret": {
                          "description": "Base32, no padding.",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The secret to scan."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start setting up a second factor",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/mfa/recovery-codes": {
      "post": {
        "description": "Proven by a current code or an unused recovery code; every earlier recovery code stops working.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "otp": {
                    "description": "The current code (`code` is accepted as a synonym).",
                    "type": "string"
                  },
                  "recovery_code": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "recovery_codes": {
                          "description": "Ten single-use codes, shown once and stored only as hashes.",
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The new codes."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The code is not valid."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many wrong codes."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the recovery codes",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/platform-access": {
      "get": {
        "description": "google_cloud is true only when the signed-in merchant user is also an active platform staff member with a second factor whose roles read the Google Cloud page. It decides whether the admin shows a link; the control plane asks for its own sign-in and checks its own rights on every route. Always false for an API key, the static token or a vendor. Any operator.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlatformAccess"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The links."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Control-plane links for the signed-in person",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/me/revoke-sessions": {
      "post": {
        "description": "Ends every session including this one. \"Everywhere\" that quietly excepted the device you are on would not be what it says. Since M8 this ends the user's sessions in every tenant they belong to.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "revoked": {
                      "description": "How many sessions ended. 0 and 4 mean different things to somebody who has lost a laptop.",
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many sessions ended."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sign yourself out everywhere",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/me/tenants": {
      "get": {
        "description": "For a tenant switcher: sign in to another with `tenant_id` on /api/admin/auth-with-password. Read through the platform role, which may see who belongs where and nothing else.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Membership"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every membership of the user."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The tenants the signed-in user belongs to",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/measurement/check": {
      "get": {
        "description": "The store's GA4 measurement id, Tag Manager container and tracking method, whether a Measurement Protocol API secret is set and whether the store is in test mode; and its last 20 orders with the purchase mark the storefront served on each confirmation and every refund or cancellation queued for, sent to or skipped by GA4 (ADR-0137). Ids, amounts and states only. Needs reports.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MeasurementCheck"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The check."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The measurement check (Ölçüm doğrulama)",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/measurement/orders/{id}/purchase-preview": {
      "get": {
        "description": "What the storefront pushes to the data layer for this order's purchase, in order: `{ecommerce: null}`, then `{event: \"purchase\", ecommerce: {...}}` — the order number as transaction_id, the total as value, tax, shipping (0 for an order with nothing to send), a discount code and the lines (SKU, title, variant, unit price, quantity). Never anything personal. Needs reports.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PurchasePreview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The push."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview an order's purchase push",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/media": {
      "get": {
        "description": "Newest first, which is what \"select existing\" wants: the file you just uploaded is usually the one you want. Every filter narrows in the store, so a page of results is a page of the whole library rather than of what a client already holds. The usage filter and usage_count count every place a file is used (ADR-0065): by key live, by name in text through an index the kernel rebuilds when that text changed.",
        "parameters": [
          {
            "description": "Case-insensitive substring of the filename, the alt text, the title, the caption, the tags, the texts in other languages or the URL. A substring rather than full text, because a library is names, not prose.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`used` is media used in at least one place (a product, a collection or category picture, a vendor logo, a video poster, a theme, a page …); `unused` is the files nothing uses, which is the reason the filter exists. Anything else is a 400 rather than an ignored filter.",
            "in": "query",
            "name": "usage",
            "required": false,
            "schema": {
              "enum": [
                "used",
                "unused"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only media the given product displays.",
            "in": "query",
            "name": "product_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Lower bound on file size. Media recorded by URL reports zero bytes, so any lower bound excludes it.",
            "in": "query",
            "name": "min_bytes",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Upper bound on file size. Omit for no upper bound — which is what makes \"over 5 MB\" expressible without a sentinel value.",
            "in": "query",
            "name": "max_bytes",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Filter by kind.",
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "image",
                "video",
                "model",
                "document"
              ],
              "type": "string"
            }
          },
          {
            "description": "A folder's id, or `none` for the files filed in no folder. Omit for every folder.",
            "in": "query",
            "name": "folder",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only files carrying this tag (case-insensitive).",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Fill usage_count on each item.",
            "in": "query",
            "name": "with_usage",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. Media recorded by URL has an empty filename and sorts last under `filename` in both directions.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "created_at",
                "filename",
                "id",
                "kind",
                "size_bytes",
                "updated_at",
                "usage_count"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Media"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of the library, newest first unless `sort` says otherwise."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the media library",
        "tags": [
          "admin:media"
        ]
      },
      "post": {
        "description": "A multipart form with a `file` field, and optionally `alt`, `title`, `language` (the texts' language; the store's default when empty), `folder_id`, `tags` (comma separated) and `keep_duplicate`. What the file is comes from its bytes: JPEG, PNG, GIF, WebP and AVIF images (20 MiB, 40 MP), MP4, MOV and WebM video and GLB, glTF and USDZ models (64 MiB in one request; up to 500 MiB through /media/uploads), and PDF documents (100 MiB) without active content (scripts, embedded files, automatic actions) — served as downloads only. SVG, HEIC and anything else are refused (details.reason: type, too_large, image_size, damaged, pdf_active, pdf_web_code). Private metadata is removed from a stored JPEG, PNG or WebP (EXIF with GPS, XMP, IPTC, text chunks; the orientation is kept) before it is hashed. When the library already holds the same bytes, nothing is stored and 200 answers {duplicate: true, media} — unless keep_duplicate. A JPEG or PNG gets responsive variants at the standard widths narrower than itself, made before it is stored, and its URL then ends in -\u003cw\u003ex\u003ch\u003e.\u003cext\u003e (ADR-0039); stored bytes, variants and kept revisions included, count against the max_media_bytes entitlement. The uploaded filename is never used as a path — it is kept for display only. At most 60 uploads a minute per store (429). Returns 501 when the store has nowhere to put files; the library still records media by URL in that case.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "alt": {
                    "type": "string"
                  },
                  "file": {
                    "format": "binary",
                    "type": "string"
                  },
                  "folder_id": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "keep_duplicate": {
                    "type": "boolean"
                  },
                  "language": {
                    "type": "string"
                  },
                  "tags": {
                    "description": "Comma separated.",
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaDuplicate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The library already holds these bytes: nothing was stored, and the existing item is answered (send keep_duplicate to store the file anyway)."
          },
          "201": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "entitlement_exceeded: the upload (with its responsive variants) would take the tenant past its max_media_bytes entitlement. details carries key, limit, used and adding (bytes)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "rate_limited: too many uploads in a short time."
          },
          "501": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "This store has nowhere to put uploads."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Upload a file",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/bulk": {
      "post": {
        "description": "At most 100 ids. Each item stands alone: one refusal does not undo the others, and each comes back with ok or a reason (not_found …). `move` takes folder_id (null: the top level), `tag`/`untag` take tags, `set_alt` takes alt (and language). Right: media.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "move",
                      "tag",
                      "untag",
                      "set_alt"
                    ],
                    "type": "string"
                  },
                  "alt": {
                    "type": "string"
                  },
                  "folder_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "maxItems": 100,
                    "type": "array"
                  },
                  "language": {
                    "type": "string"
                  },
                  "tags": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "ids",
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MediaBulkResult"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One result per id."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move, tag or write alt text for many files",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/bulk-delete": {
      "post": {
        "description": "At most 100 ids. Each file nothing uses is deleted (with its stored files and earlier revisions, audited as media.delete); each file still in use is refused with reason in_use and the places it is used. Right: media.delete.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "maxItems": 100,
                    "type": "array"
                  }
                },
                "required": [
                  "ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MediaBulkResult"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One result per id."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete many files",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/folders": {
      "get": {
        "description": "Every folder, by position and name, with how many files each holds directly. Right: media.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MediaFolder"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The folders."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The library's folders",
        "tags": [
          "admin:media"
        ]
      },
      "post": {
        "description": "At most three levels deep; a name (1–80 characters) unique among its siblings (409 folder_exists). Right: media.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "maxLength": 80,
                    "type": "string"
                  },
                  "parent_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaFolder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a folder",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/folders/{id}": {
      "delete": {
        "description": "Refused (409 folder_not_empty) while it holds files or folders. Right: media.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete an empty folder",
        "tags": [
          "admin:media"
        ]
      },
      "patch": {
        "description": "Each field changes only when sent; parent_id null moves it to the top. Never into itself or below its own folders, never deeper than three levels. Right: media.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "maxLength": 80,
                    "type": "string"
                  },
                  "parent_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "position": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaFolder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The folder."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename, move or reorder a folder",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/link": {
      "post": {
        "description": "Adds a library entry for a file this store does not hold. No storage key is recorded, so deleting it only ever removes the row — nothing is ever deleted from someone else's server.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "alt": {
                    "type": "string"
                  },
                  "kind": {
                    "default": "image",
                    "enum": [
                      "image",
                      "video",
                      "model",
                      "document"
                    ],
                    "type": "string"
                  },
                  "url": {
                    "description": "Absolute or site-relative.",
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record media hosted elsewhere",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/nextgen": {
      "get": {
        "description": "Media › Modern formats (ADR-0128). Whether the store switched the formats on (plugin media-nextgen), what the server can write (`formats`), how many library files still wait for a copy (`pending`), how many copies were made, not kept because they were not smaller (`larger`), skipped (colour profile, animation, transparency for AVIF) or failed, and the bytes saved. Right: media.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NextgenStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Modern image formats: state",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/nextgen/run": {
      "post": {
        "description": "Forgets the skipped and failed files so the background job looks at them again and queues a pass. The job converts a few pictures at a time at the lowest priority and steps aside while the server is busy. Right: media.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NextgenStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Convert the library now",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/uploads": {
      "post": {
        "description": "For a file of up to 500 MiB (a video, a long PDF), sent in chunks of chunk_size bytes (8 MiB; the last one shorter). The quota (max_media_bytes) is checked against the declared size plus the uploads in flight; at most 10 uploads and 2 GiB may be in flight per store (429 too_many_uploads). The options are applied when it completes; replace_media_id makes it a new file for that item. Expires after 24 hours. Right: media.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "alt": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "folder_id": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "keep_duplicate": {
                    "type": "boolean"
                  },
                  "language": {
                    "type": "string"
                  },
                  "replace_media_id": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "size": {
                    "format": "int64",
                    "maximum": 524288000,
                    "type": "integer"
                  },
                  "tags": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "filename",
                  "size"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaUploadSession"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The session."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "entitlement_exceeded: media storage is full."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "too_many_uploads or rate_limited."
          },
          "501": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "This store has nowhere to put uploads."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start a resumable upload",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/uploads/{id}": {
      "delete": {
        "description": "Removes the session and its chunks. Right: media.write.",
        "parameters": [
          {
            "description": "The upload session's id (32 hexadecimal characters).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{32}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Cancelled."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel a resumable upload",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/uploads/{id}/chunks/{n}": {
      "put": {
        "description": "The body is the chunk's bytes (application/octet-stream): exactly chunk_size bytes, the last chunk the rest. Sending a chunk again rewrites it (idempotent). Right: media.write.",
        "parameters": [
          {
            "description": "The upload session's id (32 hexadecimal characters).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{32}$",
              "type": "string"
            }
          },
          {
            "description": "The chunk's number, from 0.",
            "in": "path",
            "name": "n",
            "required": true,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaUploadSession"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The session."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "upload_expired."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send one chunk",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/uploads/{id}/complete": {
      "post": {
        "description": "Runs the upload pipeline on the assembled file (sniffed, metadata stripped, checked, quota under its lock) and answers the new item — or the existing one when the library holds the same bytes. 409 upload_incomplete lists the missing chunks. Completing again answers the item again. Right: media.write.",
        "parameters": [
          {
            "description": "The upload session's id (32 hexadecimal characters).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{32}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaDuplicate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The library already holds these bytes: nothing was stored, and the existing item is answered (send keep_duplicate to store the file anyway)."
          },
          "201": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "entitlement_exceeded: media storage is full."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "upload_expired."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Finish a resumable upload",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/uploads/{id}/status": {
      "get": {
        "description": "Which chunks arrived, so a client resumes with the missing ones. 410 upload_expired after 24 hours. Right: media.write.",
        "parameters": [
          {
            "description": "The upload session's id (32 hexadecimal characters).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{32}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MediaUploadSession"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The session."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "upload_expired."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a resumable upload",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/{id}": {
      "delete": {
        "description": "Refused with 409 (details.reason in_use, details.uses the places) while anything uses the file: a product or variant, a collection's or category's picture, a vendor's logo, a video's poster, the theme (draft or live), a theme instance, the store identity or menus, a page version other than an archived one, or catalogue text that embeds it. With `drafts=1` it goes ahead when every remaining use is a draft nobody sees. The file, its variants and its earlier revisions are removed only when this store holds them. Audited (media.delete). Right: media.delete (owner by default, ADR-0065).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "Also delete when every remaining use is a draft.",
            "in": "query",
            "name": "drafts",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove media",
        "tags": [
          "admin:media"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get one library item",
        "tags": [
          "admin:media"
        ]
      },
      "patch": {
        "description": "Each field changes only when it is sent (at least one is required). The texts (alt, title, caption, description) are in `language` (the store's default when empty); `translations` sets other languages' texts whole (all empty removes one). `filename` is the display and download name — the address never changes. folder_id null is the top level; poster_media_id (a picture) is a video's poster; focal_point null clears it back to the centre. Text changes are audited (media.alt_set when only the default alt changed, else media.update); a move, tags and the focal point are not.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "alt": {
                    "type": "string"
                  },
                  "caption": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "focal_point": {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/FocalPoint"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "folder_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "language": {
                    "type": "string"
                  },
                  "poster_media_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "tags": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "title": {
                    "type": "string"
                  },
                  "translations": {
                    "additionalProperties": {
                      "$ref": "#/components/schemas/MediaText"
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a file's texts, folder, tags, poster or focal point",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/{id}/restore-original": {
      "post": {
        "description": "The first upload becomes the item's file again; the edited file is kept as a revision, so this too can be undone by editing. 409 `not_edited` when the item shows its original, `original_gone` when it is no longer kept. Audited (media.restore). Right: media.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Bring the first uploaded file back",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/{id}/revisions": {
      "post": {
        "description": "A multipart form with `file` and `reason` (`edit` from the image editor, or `replace`). The new file goes through the upload pipeline (sniffed, metadata stripped, variants made) and must be the same kind as the item. The item keeps its id, so every place that names it by id shows the new file; its address changes (stored files are cached as immutable), the previous file is kept as a revision (a page that pasted its address keeps working; counted in media storage), and the first upload is kept for restore-original. Audited (media.replace). Right: media.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  },
                  "reason": {
                    "default": "replace",
                    "enum": [
                      "edit",
                      "replace"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MediaResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "entitlement_exceeded: media storage is full."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "rate_limited: too many uploads in a short time (60 a minute per store)."
          },
          "501": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "This store has nowhere to put uploads."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Give an item a new file (edit or replace)",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/media/{id}/usage": {
      "get": {
        "description": "Every place that uses the file, read live: by key (a product's or a variant's pictures, a vendor's logo, a collection's or a category's picture, a video's poster) and by name in text (the live and draft theme — logo, favicon, share picture —, theme instances, store identity and menus, page versions other than archived ones, product and catalogue text that embeds its address, also an earlier revision's). `live` says whether shoppers see the place now. Right: media.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MediaUse"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The places, at most 50 per source."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Where a file is used",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/menus": {
      "get": {
        "description": "The theme's two menus (main, footer) first, then the store's own named menus (ADR-0071), with their link counts. The footer panel's columns are not listed. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StoreMenuSummary"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The menus."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the store's menus",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "A menu with a name and links (three levels at most), live at once; emits content.menus_changed; audited (store_menu.create). The handle is made from the name (Turkish letters to plain ones) unless given. Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreMenuInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreMenuDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created menu."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a named menu",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/menus/{handle}": {
      "delete": {
        "description": "One of the store's own menus; the theme's two cannot be deleted (409 builtin_menu). A builder or section that named it shows nothing in its place. Emits content.menus_changed; audited. Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a named menu",
        "tags": [
          "admin:content"
        ]
      },
      "get": {
        "description": "Its links with library pictures resolved; for main and footer whether the theme draft holds other links. Needs theme.read.",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreMenuDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The menu."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a menu with its links",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "Name, links and place in the list; live at once. main and footer are checked against the theme's limits and the theme draft's copy follows (its revision moves on). Emits content.menus_changed; audited (store_menu.update). Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreMenuInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreMenuDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved menu."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a menu",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/messaging/profile": {
      "get": {
        "description": "The unvan, MERSİS number and contact every commercial message must carry.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessagingProfile"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The profile."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sender identity of commercial messages",
        "tags": [
          "admin:messaging"
        ]
      },
      "put": {
        "description": "Commercial messages are refused until the legal name and the MERSİS number are set.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagingProfile"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessagingProfile"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The profile."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the sender identity",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/metrics": {
      "get": {
        "description": "OpenMetrics text: outbox and job queue depth and age, dead events and jobs, payments awaiting their provider or flagged for an amount mismatch, shipments being booked, refunds in flight, and responses served by status class. Only the requesting tenant's numbers.",
        "responses": {
          "200": {
            "content": {
              "application/openmetrics-text": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The metrics."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Metrics for this store's tenant",
        "tags": [
          "admin:ops"
        ]
      }
    },
    "/api/v1/admin/neropay": {
      "get": {
        "description": "NeroPay (ADR-0138) as the store sees it: documents_missing, reviewing or active (from the company record, ADR-0136, and the store's sub-merchant record at the institution NeroPay runs on); whether NeroCart has an institution switched on; checkout_ready (an institution on, the payments gate passed and the store an active sub-merchant — the checkout offers NeroPay only from Faz 5b); the rate that applies; the store's own balances per currency by settlement state (Hakediş) and its latest journals, its own entries only. Needs payouts.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NeroPayMerchantState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's NeroPay card and balances",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notification-suppressions": {
      "get": {
        "description": "Recipients the store must not write to: commercial messages only, or everything.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Suppression"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Do-not-send list",
        "tags": [
          "admin:messaging"
        ]
      },
      "post": {
        "description": "Adds or replaces a suppression.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuppressionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Suppression"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suppression."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stop writing to a recipient",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/notification-suppressions/{id}": {
      "delete": {
        "description": "",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Lift a suppression",
        "tags": [
          "admin:messaging"
        ]
      }
    },
    "/api/v1/admin/notifications": {
      "get": {
        "description": "Every notification the store sent — or tried to, or only logged — newest first. Filter by channel, status, event, or search by recipient or order number. Needs orders.read: a notification is an order's communication.",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "sent",
                "logged",
                "failed",
                "queued",
                "cancelled",
                "unknown"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "event",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A recipient fragment, or an order number.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/NotificationRecord"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of notifications."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What the store told its shoppers",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/notifications/order-emails": {
      "get": {
        "description": "Every order email with how the store has it: the messages to the store (a new order, a cancelled order, a card payment that failed — never sent to the shopper) with their recipients, and the messages to the customer. With nothing set each is on, and a message to the store goes to the store profile's email (else the contract archive address, else the published theme's contact address). The wording of each is under /api/admin/notifications/templates. Needs notifications.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderEmail"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order emails, in the panel's order."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The order emails, to the store and to the customer",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/order-emails/{event}": {
      "put": {
        "description": "`enabled` switches the message on or off; `recipients` (a message to the store only) replaces its list of the store's addresses — at most 10; an entry may hold several separated by commas — and an empty list returns it to the default. An absent field stays. Audited as notification_template.update (key order_email/{event}). Needs notifications.write.",
        "parameters": [
          {
            "description": "The order email.",
            "in": "path",
            "name": "event",
            "required": true,
            "schema": {
              "enum": [
                "order.staff_new",
                "order.staff_cancelled",
                "order.staff_payment_failed",
                "order.created",
                "order.paid",
                "order.shipped",
                "order.delivered",
                "order.cancelled",
                "order.refunded",
                "order.returned",
                "order.note_added"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderEmailInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderEmail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order email as it now stands."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch an order email on or off, address a message to the store",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/templates": {
      "get": {
        "description": "Every message the store can send — the engine's order events and the ones modules add — with its effective subject and body: the operator's wording where one is stored, the default otherwise. Needs notifications.read.",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "description": "A language code (tr, en, de). Empty for the wording that applies to every language.",
            "in": "query",
            "name": "locale",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/NotifyTemplate"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The messages, in registration order."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The wording of what the store sends",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/templates/{channel}/{event}": {
      "delete": {
        "description": "Drops the operator's wording; the default in code stands again. Needs notifications.write.",
        "parameters": [
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "description": "The event name, e.g. order.shipped.",
            "in": "path",
            "name": "event",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A language code (tr, en, de). Empty for the wording that applies to every language.",
            "in": "query",
            "name": "locale",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotifyTemplate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The message, back to its default."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Restore a message's default wording",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Stores the operator's subject and body for one message. Both are Go text/template over the event's data and are parsed before they are stored, so a typo is refused here rather than on the next sale. Needs notifications.write; audited as notification_template.update.",
        "parameters": [
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "description": "The event name, e.g. order.shipped.",
            "in": "path",
            "name": "event",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "locale": {
                    "description": "The language the wording is for (tr, en, de, fr, it, es, nl, da, sv, pl, ru, ar); empty or absent for every language.",
                    "type": "string"
                  },
                  "preheader": {
                    "description": "Email only: the preview line. Empty or absent uses the message's first line.",
                    "type": "string"
                  },
                  "subject": {
                    "description": "Required for email; ignored for SMS.",
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotifyTemplate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The message, now customized."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reword one message",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/templates/{channel}/{event}/preview": {
      "post": {
        "description": "Renders a draft (subject/body; empty body means the effective wording) with sample data for the event's variables, merged with `data`. With `locale` (tr, en, de) it renders that language's effective wording and formats amounts as that language writes them; empty is the every-language wording. Needs notifications.read.",
        "parameters": [
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "data": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "locale": {
                    "description": "A language code (tr, en, de, fr, it, es, nl, da, sv, pl, ru, ar); empty for the every-language wording.",
                    "type": "string"
                  },
                  "preheader": {
                    "description": "The draft's preview line; absent previews the stored one, empty uses the first line.",
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotifyPreview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rendered message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview a notification template",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/templates/{channel}/{event}/test": {
      "post": {
        "description": "Sends the effective wording filled with sample data (and data.test = \"true\") to one address through the store's backends; the attempt is in the delivery log and is returned. With `locale` it sends that language's wording; empty is the store's message language. Needs notifications.write. Audited.",
        "parameters": [
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "enum": [
                "email",
                "sms"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "locale": {
                    "description": "A language code (tr, en, de, fr, it, es, nl, da, sv, pl, ru, ar); empty for the store's message language.",
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "to"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The logged attempt."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a test notification",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/usage": {
      "get": {
        "description": "What the tenant sent this calendar month (UTC), per channel, against its sending limits (NOTIFICATIONS §10): a monthly quota, a hard ceiling for transactional messages (a percentage of the quota) and a per-minute burst cap. The limits are the platform's defaults (kernel configuration) unless the platform set the tenant's own; no tenant route changes them. Marketing messages stop at the quota; order and shipping messages go on to the ceiling and the store's contact address is emailed once when the quota is passed and once at the ceiling; an operator's password reset, an invitation and the alert itself are never stopped and not counted. A message over the burst cap waits for the next minute. `sent` counts messages a provider accepted, `over_quota` those among them sent past the quota, `blocked` those not sent because of a limit. Needs notifications.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotifyUsageReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The month and each channel."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "This month's sending against the limits",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/notifications/{id}": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The notification."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One notification",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/notifications/{id}/resend": {
      "post": {
        "description": "Delivers the recorded message again through whatever backends the store has now — the one that failed last week may be fixed, and one that only reached the log may have an email module behind it today. The new attempt is its own row, pointing at this one, and is what comes back. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NotificationRecord"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The notification."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a notification again",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/oauth/authorize": {
      "get": {
        "description": "Checks the app's client id, return address and requested rights (space-separated; empty: all it registered). Right: apikeys.write.",
        "parameters": [
          {
            "in": "query",
            "name": "client_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirect_uri",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scope",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OAuthConsent"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The consent."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What an app asks for (the consent page)",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "Makes a one-time code (ten minutes; PKCE S256 when the app sent a challenge) and answers the address to send the owner back to with it. Right: apikeys.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthApproval"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "redirect_url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "redirect_url"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Where to go."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Approve an app",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/option-sets": {
      "get": {
        "description": "By name. A set fills a product option in the panel; it is never read by the storefront. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedOptionSet"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The sets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's variant option sets",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Audited. At most 200 sets per store. Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedOptionSetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedOptionSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a variant option set",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/option-sets/{id}": {
      "delete": {
        "description": "Audited; products filled from it keep their options. Right: catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a variant option set",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Audited; products filled from it keep their options. Right: catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedOptionSetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedOptionSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The set."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a variant option set",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/order-minimums": {
      "get": {
        "description": "The smallest basket the store takes, per market currency; none listed: no minimum. Right: store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderMinimumsBody"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The order minimum per currency",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Replaces them; an empty list removes the minimum. The cart answers minimum_order and below_minimum; the checkout refuses a basket below it with 409 and BelowMinimum details (an operator's order is not held to it). Audited (store.order_minimum). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderMinimumsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderMinimumsBody"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the order minimums",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/order-tags": {
      "get": {
        "description": "Most used first, at most 200. Right: orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderTagCount"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The tags."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's order tags",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/order-tags/orders": {
      "get": {
        "description": "For the ids given (comma separated, at most 500); orders with neither are left out. Right: orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "ids",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderTagging"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The taggings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Tags and assignees of orders",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/order-tags/search": {
      "get": {
        "description": "Their ids, newest first, at most 500. Right: orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "assignee",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The order ids."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Orders with a tag or an assignee",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/order-views": {
      "get": {
        "description": "Needs orders.read. The signed-in operator's own views of the orders list, by name.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedView"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The views."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List your saved order views",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Needs orders.read. `query` is the list's query string as the panel writes it; `id`, `page` and token-like keys are dropped. The same name replaces the operator's view. At most 50 per list. Audited (`saved_view.create`).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedViewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The view."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a order view",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/order-views/{id}": {
      "delete": {
        "description": "Needs orders.read. Only the operator's own view. Audited (`saved_view.delete`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a saved order view",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders": {
      "get": {
        "description": " In a multi-store tenant the list is the current store's (X-Store-Id), matching the dashboard's counts.",
        "parameters": [
          {
            "description": "One status, or several comma-separated (confirmed,partial): an order matching any of them.",
            "in": "query",
            "name": "status",
            "schema": {
              "example": "confirmed,partial",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "payment_status",
            "schema": {
              "enum": [
                "pending",
                "paid",
                "failed",
                "refunded"
              ],
              "type": "string"
            }
          },
          {
            "description": "The lifecycle axis, derived from status: pending, open (accepted and not finished), completed (delivered) or cancelled.",
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "pending",
                "open",
                "completed",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "description": "The fulfillment axis.",
            "in": "query",
            "name": "fulfillment_status",
            "schema": {
              "enum": [
                "unfulfilled",
                "partially_fulfilled",
                "fulfilled",
                "partially_delivered",
                "delivered"
              ],
              "type": "string"
            }
          },
          {
            "description": "Orders waiting on the operator: `returns` (a return not closed or a refund pending), `payment` (a failed payment or an uncaptured authorization), `delivery` (a failed delivery), `transfer` (a bank transfer order still awaiting its money). `preorder` (a line sold as a pre-order, ADR-0074), `shipping` (to be sent: confirmed or partly sent, and not refunded in full).",
            "in": "query",
            "name": "needs",
            "schema": {
              "enum": [
                "returns",
                "payment",
                "delivery",
                "transfer",
                "preorder",
                "shipping"
              ],
              "type": "string"
            }
          },
          {
            "description": "The operator's search box. Matches an order number from the start, or, containing it, an email, the shopper's or an address's name, a shipment's or parcel's tracking number, an invoice number or the marketplace's order number, case-insensitively; a telephone number (seven digits or more, written in any form) matches by its digits. `email` is the exact-match filter and still works beside it; the two are ANDed, never ORed.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. `number` orders by the id the number is built from, which stays true past six digits where a text sort does not; `total` orders by `total_minor`. Orders with no customer name sort last in both directions.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "created_at",
                "email",
                "id",
                "name",
                "number",
                "payment_status",
                "status",
                "total"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "description": "Orders a marketplace sold (ADR-0094): one marketplace's code, or any for every marketplace.",
            "in": "query",
            "name": "marketplace",
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "description": "true lists only the orders in the trash. Without it the list leaves trashed orders out, unless `ids` names them.",
            "in": "query",
            "name": "in_trash",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only orders carrying this tag (0187).",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only orders assigned to this team member (0187).",
            "in": "query",
            "name": "assignee",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of orders."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List orders",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "The phone order, the trade counter, the replacement parcel. It builds a cart and checks it out rather than inserting an order, so the result is indistinguishable from one a shopper placed: stock is reserved under the same lock, prices are snapshotted the same way, and the same order.created event reaches every notifier. The order carries an access token, so the customer can look it up without an account. Distinct from POST /api/admin/import/orders, which records orders that already happened elsewhere and deliberately moves no stock.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "address": {
                    "$ref": "#/components/schemas/Address"
                  },
                  "billing_address": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Address"
                      }
                    ],
                    "description": "The invoice address, when it is not the delivery address."
                  },
                  "buyer_tax": {
                    "$ref": "#/components/schemas/BuyerTax"
                  },
                  "discount_code": {
                    "description": "Optional. A promotion code the operator is honouring — the one the customer quoted on the telephone. It is judged by the checkout under its own lock, exactly as a shopper's is, so an expired, exhausted or ineligible code refuses the whole request with 422 and no order is created and no stock is reserved.",
                    "example": "SPRING20",
                    "type": "string"
                  },
                  "email": {
                    "description": "Required: the order is looked up by it, and notifications go to it.",
                    "type": "string"
                  },
                  "gift": {
                    "description": "Place the order as a present (see the gift settings, GET /api/admin/gift-shipping).",
                    "type": "boolean"
                  },
                  "gift_kind": {
                    "description": "Place the order as a present or a free sample; either is not a sale.",
                    "enum": [
                      "gift",
                      "sample"
                    ],
                    "type": "string"
                  },
                  "lines": {
                    "items": {
                      "properties": {
                        "personalisation": {
                          "description": "What the customer asked for on the line (ADR-0089): texts, options, ticks and dates; a picture is uploaded by the shopper, never by an operator.",
                          "items": {
                            "$ref": "#/components/schemas/PersonalisationValue"
                          },
                          "maxItems": 20,
                          "type": "array"
                        },
                        "quantity": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "variant_id": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "variant_id",
                        "quantity"
                      ],
                      "type": "object"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "description": "A `notes` key is refused with a 400: it is reserved for the shop's own note on the order, which is set through PATCH /api/admin/orders/{id}.",
                    "type": "object"
                  },
                  "name": {
                    "type": "string"
                  },
                  "payment_method": {
                    "default": "cod",
                    "description": "Code of a registered payment method.",
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "lines"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "payment": {
                          "$ref": "#/components/schemas/PaymentIntent"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and what must happen to pay for it. `data.order.access_token` is returned here and in no other admin *read*: it is the guest's only credential for their own order, so no listing and no GET carries it. A customer who has lost their link is helped with POST /api/admin/orders/{id}/access-token, which reads the same token back out under `orders.write` and writes an audit row saying who asked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Place an order on a customer's behalf",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/bulk": {
      "post": {
        "description": "Applies the verb an operator has on one order to each order named, in turn, each in its own transaction, and reports every order's outcome; one refusal never stops the rest. `mark_paid` is POST /api/admin/orders/{id}/mark-paid, `fulfill` ships everything an order still owes by hand (POST /api/admin/create-fulfillment with the manual provider; needs `orders.fulfill` as well), `deliver` is POST /api/admin/orders/{id}/deliver, `cancel` is POST /api/admin/orders/{id}/cancel, `cancel_refund` is POST /api/admin/orders/{id}/cancel-and-refund (money at a gateway voided before the bank's end of day, refunded after; needs `orders.refund` as well). `ship` and `complete` are the WooCommerce-style \"set the status to\" choices: each runs only the steps the order still needs, in order — marked paid when it is not, shipped by hand — and `complete` then marks it delivered; both need `orders.fulfill`. `trash` cancels the order first through the same cancellation (its stock goes back; an order that has shipped, holds money or has goods returned is refused) and moves it to the trash; `restore` takes it back out, still cancelled; `delete` deletes a trashed order for good, refused when money ever moved for it or it has an invoice, a shipment, a return, licence codes or a marketplace behind it. Trashed orders are deleted for good after 30 days by the same rule. The verbs that move an order on refuse one in the trash. A refused order carries `reason`, a stable code: order_shipped, order_paid, order_paid_offline, order_returned, order_cancelled, order_refunded, order_not_confirmed, order_not_shipped, order_in_trash, order_not_in_trash, order_keeps_records, not_found, approval_required (the refund waits for a second approval, ADR-0135) — or none, when `message` is all there is. Another tenant's order is not_found.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "mark_paid",
                      "ship",
                      "complete",
                      "fulfill",
                      "deliver",
                      "cancel",
                      "cancel_refund",
                      "trash",
                      "restore",
                      "delete"
                    ],
                    "type": "string"
                  },
                  "ids": {
                    "description": "The orders, at most 200; a repeated id is acted on once.",
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "maxItems": 200,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "action",
                  "ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderBulkOutcome"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every order's outcome, in the order the ids were given."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply one action to several orders",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get an order",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "An email with a typo in it means the customer never hears from the shop again; an address with the wrong house number means the parcel goes to the wrong door; a payment reference is what somebody reconciles against a bank statement. None of them is a state change, and each is a field a person typed once.\n\nCorrecting an address does not move a parcel that has already gone out.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Correct an order's contact details and payment record",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/access-token": {
      "post": {
        "description": "The customer rang: they have lost the \"view your order\" link. The access token is their only credential — guest checkout is permanent (D22), so there is no account to sign into — and it is returned at checkout and by nothing else, which left a support desk with no answer at all.\n\nIt reveals the existing token rather than issuing a new one. Rotating would answer the same question while silently breaking the link in the confirmation mail the customer already has, so an operator helping with a mislaid link would be destroying the mislaid copy.\n\nPOST, not GET, and `orders.write`, not `orders.read`: handing out a bearer credential is an act, and it is recorded as one. Every call writes an `order.token_reveal` row naming the operator, in the same transaction as the read — the token itself is deliberately not in that row, because an append-only table nothing can delete from is the last place a live credential should be copied into. No body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "access_token": {
                          "description": "Pass it to GET /api/orders/{number}?token=… — that is the whole of the customer's flow.",
                          "type": "string"
                        },
                        "number": {
                          "example": "1001",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order's number and its access token."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read an order's guest access token back out",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/auto-preparation": {
      "get": {
        "description": "The order's automatic preparation (ADR-0142): its state, the reason it left the order to the operator (a word the panel says in a sentence, with a detail such as the SKUs that fell short or the carrier's refusal), the hidden stock taken, the shipment and invoice it made. `data` is null when the order was never handed to it. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/AutoPreparation"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order's preparation, or null."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What the automatic preparation did with an order",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Queues the order again: one that waited (the hidden stock was short) or failed, or a paid order from before the switch was on. The background job decides as it does for a new paid order. 409 `auto_preparation_off` while the store's switch is off; 409 for a test order or one already prepared. Audited (order.auto_prepare). Needs orders.fulfill.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutoPreparation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order's preparation, queued."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Hand an order to the automatic preparation",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/cancel": {
      "post": {
        "description": "Returns the inventory. Which movement is correct depends on how far the order got: a pending order only ever reserved stock, while a confirmed one has already taken it off the shelf. An order that has shipped cannot be cancelled — that is a return.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/cancel-and-refund": {
      "post": {
        "description": "ADR-0007's cancel saga for an order whose money is still at the payment provider: everything `/cancel` refuses for goods (shipped, returned) is refused first, before any money moves; then every payment is settled — an authorization with nothing captured is voided, a capture is refunded for what it captured less what was already refunded — and the order is cancelled. Idempotent: a retry skips what is settled. An order paid outside a gateway (cash on delivery marked paid) is refused: record the manual refund, then cancel. Needs orders.write and orders.refund. A refund at or above the store's second-approval threshold, asked by anyone but the owner, does not run: the answer is a 409 with code approval_required and the waiting approval in details.approval (ADR-0135).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel an order and give its money back",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/changes": {
      "get": {
        "description": "Every order change of the order, oldest first — edits (EditLines records each as a confirmed edit), exchanges and claims.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderChangeSet"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The changes."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List an order's changes",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Creates a pending edit, exchange or claim and prices it against the order as it stands: the same code confirming runs, inside a savepoint that is rolled back, so stock, tax and the return cap are checked now. An order has at most one pending change. Each action is validated by the engine against the state the actions before it left (Medusa's calculateOrderChange). Announces order_change.requested.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "actions": {
                    "items": {
                      "$ref": "#/components/schemas/OrderChangeActionInput"
                    },
                    "type": "array"
                  },
                  "kind": {
                    "description": "An exchange returns something (RETURN_ITEM) and sends something (ITEM_ADD); a claim sends a replacement or gives a credit.",
                    "enum": [
                      "edit",
                      "exchange",
                      "claim"
                    ],
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "actions"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderChangeSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pending change and its figures."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Open an order change",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/changes/{changeId}": {
      "get": {
        "description": "One change of the order.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ChangeID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderChangeSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The change."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read an order change",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/changes/{changeId}/cancel": {
      "post": {
        "description": "Drops a pending change; nothing it described happens. Announces order_change.cancelled. A confirmed change is refused — a new change undoes it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ChangeID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderChangeSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cancelled change."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel an order change",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/changes/{changeId}/confirm": {
      "post": {
        "description": "Applies a pending change: new lines (stock sold, each taxed on its own, the order total moved by exactly them), the returns it asks for (authorized, and received when the change receives them), added or removed shipping charges, credit lines — and an edit's lines through the EditLines path. One transaction with order_change.confirmed and the audit row. Confirming again is a no-op; a cancelled change is refused.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ChangeID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderChangeSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The confirmed change."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Confirm an order change",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/changes/{changeId}/preview": {
      "post": {
        "description": "Prices a pending change again against the order as it stands now and keeps the figures on it. Writes no event: nothing about the order changed. A change no longer pending is returned as it is.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ChangeID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderChangeSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The change and its figures."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview an order change",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/deliver": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mark an order delivered",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/export": {
      "delete": {
        "description": "IN4: the order's invoice is the plain export-exempt one again. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Take an order's export customs details off",
        "tags": [
          "admin:orders"
        ]
      },
      "get": {
        "description": "IN4: the Incoterms delivery term and place, the transport mode, the ETGB or GTB customs declaration and office, and the foreign buyer's own tax number, recorded for an order delivered abroad. `data` is null when none were entered. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/OrderExport"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The details, or null."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's export (İHRACAT) customs details",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "IN4: with these details the order's invoice is an export (İHRACAT) e-Fatura to the GTB's mailbox, issued through the e-invoice integrator the store has configured — provided that integrator can issue export invoices, and every product has its GTIP (the variant's hs_code or its invoice item's tariff number). Without them the invoice stays the plain export-exempt one. 409 for an order delivered at home. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderExportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderExport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The details."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record an order's export customs details",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/fulfillment-groups": {
      "get": {
        "description": "The order's lines grouped by their source — the location they were allocated to, or for a supplied line the supplier and its location (ADR-0082) — with what each line still owes and each group's status (unfulfilled, partially_fulfilled, fulfilled). A shipment leaves from one group.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "groups": {
                          "items": {
                            "properties": {
                              "lines": {
                                "items": {
                                  "properties": {
                                    "dimensions": {
                                      "$ref": "#/components/schemas/Dimensions"
                                    },
                                    "order_line_id": {
                                      "format": "int64",
                                      "type": "integer"
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "remaining": {
                                      "type": "integer"
                                    },
                                    "shipped": {
                                      "type": "integer"
                                    },
                                    "sku": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "weight_grams": {
                                      "description": "One unit's weight from the variant; absent when it has none.",
                                      "type": "integer"
                                    }
                                  },
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "location_code": {
                                "type": "string"
                              },
                              "location_id": {
                                "format": "int64",
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "location_name": {
                                "type": "string"
                              },
                              "preorder": {
                                "$ref": "#/components/schemas/LinePreorder"
                              },
                              "source": {
                                "description": "The supplier a group of supplied lines ships from (ADR-0082); absent for the store's own inventory.",
                                "properties": {
                                  "location_id": {
                                    "format": "int64",
                                    "type": "integer"
                                  },
                                  "tenant_id": {
                                    "format": "int64",
                                    "type": "integer"
                                  },
                                  "type": {
                                    "enum": [
                                      "offer"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "type": "object"
                              },
                              "status": {
                                "enum": [
                                  "unfulfilled",
                                  "partially_fulfilled",
                                  "fulfilled"
                                ],
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The groups."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List an order's fulfillment groups",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/gift": {
      "put": {
        "description": "kind gift (a present) or sample (a free sample) marks the order as not a sale: its customs invoice says GIFT or SAMPLE, and automatic invoicing leaves it out when the gift settings say so; kind \"\" makes it a sale again. Without kind, gift true is a present. Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "gift": {
                    "type": "boolean"
                  },
                  "kind": {
                    "enum": [
                      "",
                      "gift",
                      "sample"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The order."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mark an order as a gift or a sample",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/invoices": {
      "get": {
        "description": "Every invoice of the order, cancelled ones included.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "invoices": {
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The invoices."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's invoices",
        "tags": [
          "admin:invoicing"
        ]
      },
      "post": {
        "description": "For an order that shipped before invoicing was set up, or whose invoice was cancelled.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Invoice"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pending invoice."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Issue an invoice by hand",
        "tags": [
          "admin:invoicing"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/legal-acceptances": {
      "get": {
        "description": "Each accepted text as rendered at checkout, with its hash and time, and the contract emails sent for the order.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "acceptances": {
                          "items": {
                            "$ref": "#/components/schemas/LegalAcceptance"
                          },
                          "type": "array"
                        },
                        "deliveries": {
                          "description": "The contract emails planned for this order: to whom and how far they got.",
                          "items": {
                            "$ref": "#/components/schemas/ContractDelivery"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The acceptances."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What an order accepted",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/legal-acceptances/{kind}/file": {
      "get": {
        "description": "The accepted contract as a PDF (HTML for a right-to-left language such as Arabic). Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "distance_sales",
                "preliminary_info"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The contract as a PDF, or HTML for a right-to-left language."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's accepted contract as a file",
        "tags": [
          "admin:legal"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/licence-keys/burn": {
      "post": {
        "description": "Every code the order holds is burned, delivered or not, and never sold again; the money is the refund's business. A reason is required. Audited as licence_key.burn. Needs orders.write and orders.refund.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "reason": {
                    "maxLength": 300,
                    "type": "string"
                  }
                },
                "required": [
                  "reason"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Burn an order's codes (chargeback, fraud)",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/licence-keys/release": {
      "post": {
        "description": "The operator's approval of an order held for review (the pool's review_before_delivery), and the way to fill codes a short pool left missing: the lines get the codes they lack (409 when the pool is still short), the hold is lifted, and a paid order's codes are delivered — the shopper is e-mailed and the digital delivery completes. Audited as licence_key.release. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Release an order's codes",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/licence-keys/{keyId}/replace": {
      "post": {
        "description": "The code is burned and the line gets another from the pool, delivered at once when the order is paid (6502 m.11: a code that does not work is a defective good); one more unit leaves the pool's shelf (409 when the pool is empty). The shopper is e-mailed the order's codes again (licence_key.replaced). Audited as licence_key.replace. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "A licence key's id (`line_items[].licence_keys.codes[].id`).",
            "in": "path",
            "name": "keyId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "reason": {
                    "description": "What is wrong with the code, in the operator's words.",
                    "maxLength": 300,
                    "type": "string"
                  }
                },
                "required": [
                  "reason"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a code that does not work",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/licence-keys/{keyId}/reveal": {
      "post": {
        "description": "Audited (licence_key.reveal) in the same transaction as the read; answered no-store. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "A licence key's id (`line_items[].licence_keys.codes[].id`).",
            "in": "path",
            "name": "keyId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RevealedLicenceKey"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The code."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read one of an order's codes in the clear",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/lines": {
      "put": {
        "description": "Replaces the order's lines with the set given. A line the order already has is named by its id; one being added names a variant instead, and is priced as that variant is priced today. A line the request leaves out is removed, and an order may not be left with none — cancel it instead. Stock moves with the change: an order that has only reserved its stock has its reservation adjusted, one that has already taken the units off the shelf gives them back or takes more. The money is not settled here — the response reports the totals either side of the edit and the balance between them, and collecting or refunding it is a payment operation with its own record. An order that has shipped, been cancelled or been refunded cannot be edited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "lines": {
                    "items": {
                      "properties": {
                        "id": {
                          "description": "A line the order already has. Omit for a new one.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "quantity": {
                          "description": "Zero removes a line the order already has.",
                          "type": "integer"
                        },
                        "variant_id": {
                          "description": "The variant to add. Required when id is absent.",
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "lines"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "changed": {
                          "$ref": "#/components/schemas/OrderChange"
                        },
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order, and what the edit changed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change what is on an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/manual-refund": {
      "post": {
        "description": "Records money the merchant sent back outside the store — a bank transfer back to the customer, cash — against an order paid by an offline method (cash on delivery, bank transfer; see ProviderInfo.refunds = manual). Nothing is sent to a provider: the refund is reserved under the order lock, bound by what is still refundable (the total less what went back and what is in flight) and by a captured payment when the order has one, then settled exactly as a gateway refund — refunded, payment_status and the order.refunded event (with refund.method = manual) move together, audited as order.refund_manual. A method the store refunds through is refused with 409. An Idempotency-Key header is required: the same key on the same order answers with the first record; with a different amount it is a 400. Needs orders.refund.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One key per refund being recorded; a retry sends the same key.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManualRefundRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a manual refund",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/mark-paid": {
      "post": {
        "description": "How cash on delivery is settled, and the same call a gateway module makes from its webhook. It also confirms a pending order — without that, a paid order would wait forever for a step nobody performs. Idempotent: a replayed webhook does not commit stock twice.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reference": {
                    "description": "The provider's payment id.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record payment",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/mark-payment-failed": {
      "post": {
        "description": "The order stays where it is — it is not cancelled and its stock is not released — so the shopper can try again. Its reservation stays in the sweeper's reach, so an attempt nobody retries eventually cancels the order and returns the stock on its own.\n\nTwo deliberate no-ops answer 200 and change nothing: an order whose payment is already failed, and an order that has been cancelled. The cancelled case is checked first, so a late gateway callback for an order the sweeper already cancelled is recorded as nothing rather than refused — a 409 there is a webhook retried forever.\n\nRefused with 409 on an order that is already paid, and on one that was refunded, where money really did move.\n\n`POST /api/admin/orders/{id}/mark-unpaid` takes a recorded failure back.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "description": "Optional. Written to the store's log and nowhere else: it is not stored on the order and never returned. The panel sends a fixed string rather than prompting for prose it would discard.",
                    "example": "card declined",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a payment attempt that did not succeed",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/mark-unpaid": {
      "post": {
        "description": "A correction, not a refund: it says the money never arrived and somebody marked the wrong order, so it leaves no refund behind. It moves the payment status and nothing else — a confirmed order awaiting payment is not a broken state, it is what every cash-on-delivery order already is, and un-confirming would put stock back on the shelf while the order is still live. An operator who wants the stock back cancels the order instead.\n\nRefused on a refunded order, where money really did move, and on a cancelled one.\n\nIt clears a recorded failure as well: an order whose payment is `failed` goes back to `pending` and loses its payment reference, silently — the failure was never announced, so its reversal announces nothing. On an already-pending order it does nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Take back a payment status recorded in error",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/notes": {
      "get": {
        "description": "Needs orders.read. Oldest first, internal and customer notes together.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderNote"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The notes."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List an order's notes",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Needs orders.write. `internal` notes are staff-only; `customer` notes are shown to the buyer with the order (behind the order's access token). Notes are never edited: delete and write again. Audited (`order.note_add`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderNoteInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderNote"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The note."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Write a note on an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/notes/{noteId}": {
      "delete": {
        "description": "Needs orders.write. The audit row (`order.note_delete`) keeps the text.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "noteId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a note from an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/payment-link": {
      "post": {
        "description": "Sends the order's own pay page (with its access token) to the shopper by e-mail or SMS, in the order's language. Only while the order waits for its payment. Audited as order.payment_link. Needs orders.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "channel": {
                    "enum": [
                      "email",
                      "sms"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "channel"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentLinkResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Where it went."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send an unpaid order's payment link",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/payment-panel": {
      "get": {
        "description": "Every payment with its POS, kind, receipt, end-of-day state, captured/refunded/refundable, the estimated commission and net, and every call made to the provider with who made it; the refunds waiting for a second approval and the channels a payment link can go on. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentPanel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The panel."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read an order's payment panel",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/payments": {
      "get": {
        "description": "Every provider payment opened for the order, newest last.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "payments": {
                          "items": {
                            "$ref": "#/components/schemas/Payment"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The payments."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List an order's payments",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/presence": {
      "delete": {
        "description": "Needs orders.read. Takes the caller off the order and lets go of their edit claim.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close an order (leave)",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "Needs orders.read; asking for the edit claim needs orders.write. A soft lock: the panel sends this while the order is open (well within `ttl_seconds`), and the answer names everybody present and who is editing. At most one operator holds the edit claim; a second one stays a viewer and is told who has it, unless `take_over` is set (audited, `order.edit_takeover`). An expired claim never blocks. Nothing on the commerce path reads it: presence warns, it does not lock order writes. Needs a signed-in operator (the static token has no person).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderPresenceInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderPresence"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Who is on the order now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Say you have an order open (heartbeat)",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/refund": {
      "post": {
        "description": "Goes back through the provider that took the money. A method that cannot refund — cash on delivery, for one — reports that plainly rather than pretending. Omit the amount to send back everything that has not been refunded yet. An order may be refunded in parts; payment_status stays paid until they add up to the total, and refunded carries the running figure. This moves money only: goods coming back are recorded as a return, which is what puts them on the shelf. A refund at or above the store's second-approval threshold, asked by anyone but the owner, does not run: the answer is a 409 with code approval_required and the waiting approval in details.approval (ADR-0135).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_minor": {
                    "description": "Omitted, zero or negative means everything still refundable, counting a refund already in flight.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "lines": {
                    "description": "Refund these lines' units: the amount is worked out from them (refund-quote); amount_minor, when also given, must agree.",
                    "items": {
                      "$ref": "#/components/schemas/RefundLine"
                    },
                    "type": "array"
                  },
                  "reason": {
                    "description": "Why the money went back. Recorded on the refund and carried on the event, so whatever tells the customer can say it.",
                    "maxLength": 500,
                    "type": "string"
                  },
                  "shipping": {
                    "description": "With lines (or alone): add the order's shipping.",
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Refund an order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/refund-quote": {
      "post": {
        "description": "What refunding these lines' units (and the shipping) comes to: each line net of its own promotions, plus its tax share where prices exclude it. Moves nothing. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundQuoteInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RefundQuote"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The quote."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Price a refund by lines",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/refunds/{refund_id}/settle": {
      "post": {
        "description": "The recovery path for a process that died between the gateway accepting a refund and the store recording it. The engine cannot know whether the money left; a person looking at the gateway can, and this is how they say so — rather than by writing SQL against the ledger. A refund younger than fifteen minutes may still be in flight and is refused.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "refund_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "description": "What the gateway said, when it did not.",
                    "type": "string"
                  },
                  "outcome": {
                    "enum": [
                      "succeeded",
                      "failed"
                    ],
                    "type": "string"
                  },
                  "provider_reference": {
                    "description": "The gateway's id for the refund, when it did go out.",
                    "type": "string"
                  }
                },
                "required": [
                  "outcome"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Settle a refund that was never heard back about",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/return-requests": {
      "post": {
        "description": "Starts the return lifecycle: a return in requested, holding its units against each line — two requests cannot claim the same unit, and the cap counts every return that still stands against what went out. No stock moves until the goods are received. shipping_refund_minor is the shipping refund policy for this return, decided by the operator: how much of the order's shipping to offer back, at most what the order charged less what other returns already offer. Announces return.requested. POST /api/admin/orders/{id}/returns records a return already in hand in one step.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "lines": {
                    "items": {
                      "properties": {
                        "line_id": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "quantity": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "reason_id": {
                          "description": "One of the store's return reasons (`/api/admin/return-reasons`); not a reason that has sub-reasons. The line keeps its label.",
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "line_id",
                        "quantity"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "reason": {
                    "description": "Customer-visible, as on the one-step return.",
                    "type": "string"
                  },
                  "shipping_refund_minor": {
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "lines"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the requested return."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Request a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns": {
      "post": {
        "description": "Records goods coming back off a shipped, partly shipped or delivered order, and puts back on the shelf the lines marked to restock. It moves no money: refunding is POST /api/admin/orders/{id}/refund, a separate operation with its own right and its own record, and the two are recorded separately on purpose. Quantities are per line and cumulative across returns — more than is still owed is refused — and on a partly shipped order only what has actually gone out can come back. The order's status and payment_status are untouched, because the delivery still happened.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "lines": {
                    "description": "What came back. At least one, each naming a line of this order at most once.",
                    "items": {
                      "properties": {
                        "line_id": {
                          "description": "A line of this order, as returned in line_items[].id.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "location_id": {
                          "description": "Which shelf they go back on. Absent or 0 means the one the line was picked from. A named location must be active.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "quantity": {
                          "description": "How many units came back. No more than what is still returnable: what went out, less what has already come back on returns that still stand.",
                          "minimum": 1,
                          "type": "integer"
                        },
                        "reason_id": {
                          "description": "One of the store's return reasons (`/api/admin/return-reasons`); not a reason that has sub-reasons. The line keeps its label.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "restock": {
                          "default": false,
                          "description": "Whether these units go back on sale. Absent means false, so nothing moves unless somebody says it should — a damaged item is still returned, it simply moves no stock.",
                          "type": "boolean"
                        },
                        "restock_quantity": {
                          "description": "How many of `quantity` go back on sale when only some arrived sellable; absent means all of them when `restock` is set and none otherwise. Between 0 and `quantity`.",
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "line_id",
                        "quantity"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "reason": {
                    "description": "Why it came back. Customer-visible: it rides the order.returned event out to the notifiers, as a cancellation reason does.",
                    "type": "string"
                  }
                },
                "required": [
                  "lines"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order as it now stands, and the return that was recorded."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}": {
      "delete": {
        "description": "Takes back a return that should not have been recorded. The row survives with status withdrawn — how much is still returnable is counted from these rows, and a return whose row is gone is a stock movement nobody can account for — and the units it put back come off the shelf again. Withdrawing an already-withdrawn return is a silent no-op. It is refused when those units have since gone out again, because taking them off would push the count below what other orders have reserved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Withdraw a return recorded in error",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/authorize": {
      "post": {
        "description": "requested → authorized: the store agrees to take the goods back. Announces return.authorized. Asking again is a no-op.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Authorize a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/cancel": {
      "post": {
        "description": "requested or authorized → cancelled, before anything arrived; the units are free again. A received return is withdrawn instead (DELETE on the return). Announces return.cancelled.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/close": {
      "post": {
        "description": "received or inspected → closed: the store is done with it. Whether money went back is the refund's record, not a condition. Announces return.closed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/inspect": {
      "post": {
        "description": "received → inspected, with an optional note on what was found. Announces return.inspected.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record an inspection",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/label": {
      "get": {
        "description": "The return label the carrier issued, as an attachment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "returnId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file, as an attachment."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A return label file",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Asks the carrier that shipped the order for a return code or label; asking again answers with the one issued.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "returnId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReturnLabel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The return label."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ask the carrier for a return label",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/receive": {
      "post": {
        "description": "authorized → received: what arrived, per line — how many (at most what was requested; a line not named arrived with nothing, which frees what it held), whether they go back on sale, and on which shelf. Restocked units go back in the same transaction. Announces order.returned, the event goods coming back has always announced. Asking again is a no-op.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "lines": {
                    "items": {
                      "properties": {
                        "line_id": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "location_id": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "quantity": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "restock": {
                          "default": false,
                          "type": "boolean"
                        },
                        "restock_quantity": {
                          "description": "How many of `quantity` go back on sale when only some arrived sellable; absent means all of them when `restock` is set and none otherwise. Between 0 and `quantity`.",
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "line_id",
                        "quantity"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "lines"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Receive a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/refund": {
      "post": {
        "description": "Sends back what a received return is worth through the refund saga: the refund is reserved, the provider is asked outside every transaction — a gateway payment only out of what it captured — and the result settled with order.refunded. The amount is the return's proposed_refund unless a smaller amount_minor is named. Idempotent: a return has one live refund, so asking again answers with the first instead of sending the money twice; a refund the provider declined does not count. Needs orders.refund. With manual = true the refund is recorded as made outside the store (see POST /orders/{id}/manual-refund); the one live refund per return still applies. A refund at or above the store's second-approval threshold, asked by anyone but the owner, does not run: the answer is a 409 with code approval_required and the waiting approval in details.approval (ADR-0135).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_minor": {
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "manual": {
                    "description": "Record a refund made outside the store (an order paid by an offline method, ProviderInfo.refunds = manual) instead of asking the provider; reason (or the return's own) is then the required note.",
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "reference": {
                    "description": "A manual refund's bank transfer or receipt reference.",
                    "maxLength": 200,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Refund a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/returns/{returnId}/reject": {
      "post": {
        "description": "requested → rejected, with an optional note saying why; the units are free again. Announces return.rejected. Asking again is a no-op.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/ReturnID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "return": {
                          "$ref": "#/components/schemas/OrderReturn"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order and the return as they now stand."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reject a return",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/risk": {
      "get": {
        "description": "0–100 with low/medium/high and the reasons, from the store's own orders: a first order far above the usual, the buyer's earlier cancelled or unpaid orders, several orders in a day, shipping and billing countries apart, a throwaway e-mail, digits in the name, failed payments, a large quantity on a first order. A hint, never a block. Right: orders.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderRisk"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The risk."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's risk score",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/summary": {
      "get": {
        "description": "What the order comes to after credit and returns, what was paid and refunded, and the pending difference: what the customer owes (positive) or is owed (negative).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The summary."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's money position",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/tags": {
      "put": {
        "description": "At most 12 tags of 40 characters; an empty assignee is nobody. Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "assignee": {
                    "type": "string"
                  },
                  "tags": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "tags"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrderTagging"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The tagging."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace an order's tags and assignee",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/timeline": {
      "get": {
        "description": "Every state change writes its event and its audit record in the same transaction that caused it, so this is the order's history rather than a log kept beside it: what happened, in what order, who did it, and whether the notification it triggered actually went out. An act that announced something renders once, carrying both halves.\n\n`published_at` is set only once every subscribed handler accepted the event; `attempts` above one and `dead` say a consumer is failing, and `last_error` says why — that field is returned only to an operator carrying `store.operate`, and is absent otherwise. Entries with no actor are ones the trail did not record: everything that happened before it existed, and the engine's own sweeps before they were attributed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderTimelineEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order's history, oldest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "An order's history",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/orders/{id}/undeliver": {
      "post": {
        "description": "The order returns to shipped, and so do the fulfillments that were marked delivered with it. Nothing moved when the delivery was recorded — no stock, no money — so nothing moves back. Refused from any status but delivered.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Take back a delivery recorded in error",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/owner-requests": {
      "get": {
        "description": "Newest first, with the platform's status and reply. An operator with store.write (and the static token) sees the store's requests; anyone else sees their own. No screenshot here (`has_image`); GET one request for it.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "new",
                "in_progress",
                "done",
                "declined"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OwnerRequest"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Requests."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's requests to the platform",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "The panel's \"Öneri gönder\" button: any operator (no right needed) writes what they would like in their own words, and the panel adds the page they were on. Plain text only: control characters are removed and nothing is parsed; `body` 1–5000 characters, `page_path` a panel path (≤ 500), `page_title` one line (≤ 200), `priority` normal (default) or urgent. `image` is an optional screenshot as a data: URL (PNG, JPEG or WebP by its bytes, at most 2 MB). The platform is emailed in the background. Each operator may send 30 an hour: 429 `rate_limited` with Retry-After. Audited as owner_request.create.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerRequestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OwnerRequest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The request as recorded."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "description": "Too many requests from this operator in the last hour; retry after the Retry-After seconds."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a suggestion or request to the platform",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/owner-requests/{id}": {
      "get": {
        "description": "With its screenshot as a data: URL. In the same scope as the list: another operator's request is 404 unless the caller has store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OwnerRequest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The request."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One request to the platform",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/password-reset": {
      "post": {
        "description": "Public, because a reset cannot require the credential it replaces. The answer is 202 whatever address goes in — identical in body and in status for an address that belongs to an operator and one that does not — so the route cannot be used to discover who has an account. `delivery` is `none` when the store has no email backend beyond the built-in logger; nothing will arrive, and no token is written at all. Repeated requests are throttled, on a budget separate from the login one. Cloudflare Turnstile (ADR-0096): on a NeroCart host with the platform's keys set, the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). A store's own keys never guard the sign-in.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "identity": {
                    "description": "The operator's email. Named `identity` for PocketBase compatibility; `email` is accepted as a synonym.",
                    "format": "email",
                    "type": "string"
                  },
                  "language": {
                    "description": "The panel language the request was made in (en, tr, …): the email is written in it. Empty or unknown falls back to the store's default language.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PasswordResetAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Taken in. Whether an email is on its way is deliberately not said."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many reset requests."
          }
        },
        "summary": "Ask for a password reset link",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/password-reset/confirm": {
      "post": {
        "description": "Public. The token travels in the body rather than the path, so the one request that spends it is not repeated in an access log. It is claimed and spent in a single transaction, so two people opening one link cannot both win; every session that operator held ends with it, as does every other outstanding link of theirs, and the session in the response is new. The password is validated before the token is touched, so a typo does not burn the link.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "format": "password",
                    "minLength": 8,
                    "type": "string"
                  },
                  "token": {
                    "description": "The token from the emailed link.",
                    "type": "string"
                  }
                },
                "required": [
                  "token",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AuthResponse"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "An invalid or expired token, or a password that is too short."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many attempts from this address."
          }
        },
        "summary": "Spend a reset link and sign in",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/password-reset/{token}": {
      "get": {
        "description": "Public: holding the token is the credential. It returns only when the link expires, so the reset screen can show a dead link before anybody types a password twice. It deliberately does not name the account — an endpoint that turned a token into an address would be the one place in this flow that confirms an operator exists.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PasswordResetTarget"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link is live."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Unknown, expired or already spent — one answer for all three."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Too many attempts from this address."
          }
        },
        "summary": "Whether a reset link is still alive",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/payment-block-list": {
      "get": {
        "description": "Cards, e-mails and IPs are kept as hashes; the label is what can be shown. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/BlockEntry"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The payment block list",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "A card as its first 6 and last 4 digits (435508|1234), an e-mail, an IP, a BIN or a country; or a fraud check's card, e-mail, IP or BIN (from_event). Audited as payment.block_list_change. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlockEntry"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The entry."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add to the block list",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-block-list/{id}": {
      "delete": {
        "description": "Audited as payment.block_list_change. Needs store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove from the block list",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-card-bins": {
      "get": {
        "description": "The store's own BIN rows (imported over the kernel's built-in table), how many rows the built-in table has, and the card programmes. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardBinsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The BIN screen."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the store's BIN rows",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-card-bins/import": {
      "post": {
        "description": "Adds or replaces BIN rows: rows, or CSV text (prefix, bank, family, scheme, type, country). Every row is checked before anything is written. Audited as payment.card_bins_import. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardBinImport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "imported": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many rows were imported."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import BIN rows",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-card-bins/lookup": {
      "get": {
        "description": "What the store's rows, then the built-in table, say about a card's first 6–8 digits. Needs orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "bin",
            "schema": {
              "pattern": "^[0-9]{6,8}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CardInfo"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a BIN",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-card-bins/{prefix}": {
      "delete": {
        "description": "Removes one of the store's rows. Needs store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "prefix",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a BIN row",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-declines": {
      "get": {
        "description": "The active gateways' known decline codes with the store's words over them, the store's own entries, and the codes nobody has words for yet. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeclineDictionary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The dictionary."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the decline dictionary",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-declines/translate": {
      "post": {
        "description": "Translates one sentence with the store's machine translator, as a suggestion to review. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "source": {
                    "type": "string"
                  },
                  "targets": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "text": {
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "required": [
                  "text",
                  "targets"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "texts": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suggestions by language."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Suggest a shopper's sentence in other languages",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-declines/{provider}/{code}": {
      "delete": {
        "description": "The built-in words apply again. Needs store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Dropped."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Drop the store's words for a decline code",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "The category, a note for the team and the shopper's sentence per store language; the code leaves the unmapped list. Needs store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineDictionaryInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DeclineDictionaryEntry"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The entry."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Give a decline code words",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-health": {
      "get": {
        "description": "Every set-up POS: resting or not and why, its last error, and its calls, success rate, technical error rate and response time over the rules' window, the last hour and the last day. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HealthBoard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The board."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The POS health board",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-health/{provider}/resume": {
      "post": {
        "description": "Ends a POS's rest by hand. Needs store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HealthBoard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The board."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Bring a resting POS back",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-methods/bank-transfer": {
      "get": {
        "description": "Whether bank transfer (havale/EFT) is offered, the accounts a shopper may pay into, the due period and the payment reference format (W24, ADR-0036). Defaults when the store never saved any. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BankTransferSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's bank transfer settings",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Every account is checked: a Turkish IBAN with valid check digits, a bank name, the account holder (alıcı unvanı) and a currency; the same IBAN may not appear twice. Switching bank transfer on needs at least one account. `due_hours` (1–720, default 72) is how long an order waits for its money before the unpaid sweep cancels it and releases its stock; `reference_format` contains `{order_number}` once. Audited as payment_method.update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankTransferSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BankTransferSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings as saved (IBANs compact, currencies upper case)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the store's bank transfer settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-methods/cod": {
      "get": {
        "description": "Whether the store offers cash on delivery. On when the store never saved a choice. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CODSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The switch."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's cash on delivery switch",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Off: the checkout no longer offers it and refuses a checkout that names it; an order placed by hand without a method then uses the first method the store offers. The last payment method that is on cannot be switched off (400). Audited as payment_method.update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CODSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CODSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The switch as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch the store's cash on delivery on or off",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-methods/order": {
      "get": {
        "description": "Every installed method in the order the checkout offers them: the store's saved order first, the rest in the default (alphabetical) order. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The order the store offers its payment methods in",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "The full priority list of method codes. The checkout lists methods in this order and preselects the first ready one; installed methods left out follow in the default order. An unknown or repeated code is refused (400). Audited as payment_method.update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "codes": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 64,
                    "type": "array"
                  }
                },
                "required": [
                  "codes"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the order the store offers its payment methods in",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-orchestration": {
      "get": {
        "description": "The store's fraud rules and POS health rules; both off until switched on. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrchestrationSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the fraud and health rules",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Audited as payment.orchestration_update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrchestrationSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrchestrationSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the fraud and health rules",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-risk": {
      "get": {
        "description": "Each card payment the store's fraud rules checked, newest first; pending=1 lists the orders held for review. Needs orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "pending",
            "schema": {
              "enum": [
                "0",
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/RiskEvent"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Checks."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the fraud rules' checks",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-risk/{id}/review": {
      "post": {
        "description": "approved lets the order ship; rejected keeps it held (cancel and refund it from the order). Audited as payment.risk_review. Needs orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "decision": {
                    "enum": [
                      "approved",
                      "rejected"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "decision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RiskEvent"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The check."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Decide a held order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-routing": {
      "get": {
        "description": "Several card POS behind one card choice: the rules, the POS in order with their bank and commissions, the POS it may use with their health. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentRoutingView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The routing screen."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the payment routing",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Only set-up POS whose card form posts to the bank; at least two when on; a commission is 0–5000 basis points for a count 1–36. Audited as store_settings.update. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRouting"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentRoutingView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The routing screen."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the payment routing",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/payment-routing/decisions": {
      "get": {
        "description": "Every POS choice the card router made for a payment, newest first: the card read from its BIN, the candidates and why each was or was not eligible, the POS chosen and why, and the commission of the choice and of the store's first eligible POS (ADR-0140). Needs orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "order_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/RouteDecision"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Decisions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the routing decisions",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-routing/savings": {
      "get": {
        "description": "Per routed payment that kept money, the commission of the POS chosen against the store's first eligible POS, summed per currency: \"bu ay X TL tasarruf\". Estimates from the commissions typed in the routing. The default window is this month. Needs payouts.read.",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavingsReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The report."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The routing's savings",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-webhooks": {
      "get": {
        "description": "Providers' callbacks as kept by the webhook queue (never their bodies). Without status: the failed and the dead ones. Needs orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "attention",
                "all",
                "queued",
                "processed",
                "failed",
                "dead"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WebhookEventRow"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Callbacks."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the payment callbacks",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payment-webhooks/{id}/retry": {
      "post": {
        "description": "Applies a failed or dead callback's events again now. Audited as payment.webhook_retry. Needs orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEventRow"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The callback."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply a failed callback again",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payments": {
      "get": {
        "description": "Every payment across orders, newest first, with its POS, an estimated commission and why it needs a look. Needs payouts.read.",
        "parameters": [
          {
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only the payments that need a look.",
            "in": "query",
            "name": "attention",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Finds a payment by its order's number (part of it) or the provider's reference.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "First day, the store's own (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, inclusive.",
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/LedgerPayment"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of payments."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the store's payments",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payments/summary": {
      "get": {
        "description": "Per POS and currency: payments, captured, refunded, net, estimated commission and after fees. Default: the last 30 days. Needs payouts.read.",
        "parameters": [
          {
            "description": "First day (YYYY-MM-DD).",
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, inclusive.",
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The summary."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What each POS took in a window",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/payments/{id}/capture": {
      "post": {
        "description": "Takes money an authorization holds: all that is left when the amount is omitted, or part of it when the provider can capture in parts. The order is paid once the captures cover its total.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount_minor": {
                    "description": "Omitted or zero means all that is still authorized.",
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Capture an authorization",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/payments/{id}/reconcile": {
      "post": {
        "description": "Queries the provider for the payment's state and applies the answer — the manual form of the reconciliation job.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ask the provider about a payment",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/payments/{id}/void": {
      "post": {
        "description": "Lets an authorization with nothing captured go. The order stays unpaid and can then be cancelled. A gateway that voids only on the day of the payment (iyzico) refuses an authorization after that day with 409. A payment that has captured money is given back instead: the rest of what it captured is refunded through the refund saga, which voids rather than refunds while the gateway's same-day window is open (ADR-0023). A refund at or above the store's second-approval threshold, asked by anyone but the owner, does not run: the answer is a 409 with code approval_required and the waiting approval in details.approval (ADR-0135).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Void an authorization, or give back a capture",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/platform/access": {
      "get": {
        "description": "Platform management inside the admin (ADR-0093, amended 2026-10-12: no step-up code). In the platform operator's admin, for a person's own session: `available` for the owner (every permission; their platform account is made on first use) or a member a platform super admin gave platform roles in Yetkililer; `permissions` draw the menu. The admin session itself then reaches /api/v1/platform. Every other store, an API key, the static token or a vendor: `available: false`, never an error.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlatformAdminAccess"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "What the panel may show."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Whether the caller may open platform management",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/plugins": {
      "get": {
        "description": "Every plugin this binary can run — core's storefront features and the ones modules registered — with its state. Secrets are masked. Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Plugin"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plugins."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List plugins",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/plugins/{key}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Plugin"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plugin."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read one plugin",
        "tags": [
          "admin:settings"
        ]
      },
      "patch": {
        "description": "Settings are merged over what is stored and validated against the plugin's fields: an unknown field, a select outside its options or a URL that is not absolute is a 400 naming the field. A secret sent as its mask is kept. Audited as plugin.update.",
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Plugin"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plugin as it now is."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch a plugin, or change its settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/pos/sales": {
      "post": {
        "description": "Placed through the same checkout as the storefront (prices, promotions, stock, tax), nothing charged for sending; recorded paid (cash or card) and handed over at once — or, with tender qr, left pending with its stock held for 30 minutes and its pay page in pay_url for the till's QR code, handed over once the customer's card has paid. The order's address is the shop's: its location's address, else the company address on the store profile. With no e-mail the walk-in customer gets an address under .invalid, which no message is sent to. Right: orders.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/POSSaleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The sale."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a sale at the shop's counter",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/price-lists": {
      "get": {
        "description": "Highest priority first. A list prices a variant for a group, over a window, optionally at quantity breaks. Resolution takes the most specific break, then the higher priority, then the cheaper price.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PriceList"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The lists."
          }
        },
        "summary": "Price lists",
        "tags": [
          "pricing"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceListInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Create a price list",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/price-lists/{id}": {
      "delete": {
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gone, with its prices."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a price list",
        "tags": [
          "pricing"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "One price list",
        "tags": [
          "pricing"
        ]
      },
      "patch": {
        "description": "`group_id` takes the nullable form: sending null makes the list everybody's, which is a real intention an absent field could not express.",
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceListInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The list."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Change a price list",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/price-lists/{id}/prices": {
      "delete": {
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "variant_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "min_quantity",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gone."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Remove one price",
        "tags": [
          "pricing"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PriceRow"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rows, by variant then break."
          }
        },
        "summary": "What a list prices",
        "tags": [
          "pricing"
        ]
      },
      "put": {
        "description": "PUT rather than POST because the row is identified by what the body carries — list, variant and break — so sending it twice states the same fact twice rather than creating two prices.",
        "parameters": [
          {
            "description": "The list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceRow"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PriceRow"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The row as stored."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Set one variant's price on a list",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/print-queue": {
      "get": {
        "description": "Documents waiting to be printed (Yazdırılacaklar, ADR-0142): a shipment's labels and the carrier's papers (commercial invoice, …) and the order's e-invoice, oldest first; `status=printed` lists the printed ones, newest first. Each item's file is at `file_url`; an invoice is `ready` once the integrator has issued it. A print agent pulls the same list. Needs orders.read.",
        "parameters": [
          {
            "description": "waiting (default) or printed.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "waiting",
                "printed"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PrintItem"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One page of the queue."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The print queue",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/print-queue/printed": {
      "post": {
        "description": "Marks the named waiting items of the store printed (who and when are recorded); an id that is not one of them is passed over. Audited (store.print_queue_mark). Needs orders.fulfill.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintMarkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PrintMarked"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many were marked."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mark print queue items printed",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/print-queue/{id}/file": {
      "get": {
        "description": "The label, paper or invoice PDF, served as an attachment to staff only. An invoice not issued yet is a 409. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file, as an attachment."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A print queue item's file",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/privacy-requests": {
      "get": {
        "description": "The store's logged data exports and erasures, newest first. The subject is a hash. Needs customers.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PrivacyRequest"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The requests."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List privacy requests",
        "tags": [
          "admin:customers"
        ]
      }
    },
    "/api/v1/admin/product-fields": {
      "get": {
        "description": "Typed fields kept on every product (text, number, boolean, date, url), in order. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductFieldDef"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The fields."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's product fields",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "At most 50; their order is the list's. A field taken away keeps its values on products, unshown. Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "fields": {
                    "items": {
                      "$ref": "#/components/schemas/ProductFieldDef"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "fields"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductFieldDef"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The fields."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the store's product fields",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-files/{id}": {
      "delete": {
        "description": "With every link to it. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a file",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Days 1–3650, openings 1–1000; for links made from now on. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expires_days": {
                    "type": "integer"
                  },
                  "max_downloads": {
                    "type": "integer"
                  }
                },
                "required": [
                  "expires_days",
                  "max_downloads"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductFile"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a file's link life and opening count",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-labels": {
      "get": {
        "description": "Best priority first. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductLabel"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Product labels (Ürünler › Etiketler)",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Words per language, colours, and a rule: manual (put on products by hand), collection, tag, new (days), discount (percent), min_price. At most 50 per store. Audited (product_label.create). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLabelInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductLabel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a product label",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-labels/{id}": {
      "delete": {
        "description": "Audited (product_label.delete). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a product label",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "A label changed to a rule leaves the products it was on by hand. Audited (product_label.update). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLabelInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductLabel"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a product label",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-questions": {
      "get": {
        "description": "Newest first, at most 500; status narrows (pending, published, hidden). Right: reviews.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "published",
                "hidden"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductQuestion"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The questions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List product questions",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-questions/{id}": {
      "delete": {
        "description": "Right: reviews.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a question",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "A first answer is e-mailed to the asker. Right: reviews.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductQuestionPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductQuestion"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The question."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Answer, publish or hide a question",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-sets": {
      "get": {
        "description": "Right: discounts.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductSet"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The sets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List product sets",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "Two to ten products sold together at a price off. The price off is an automatic promotion of the set's own, written in step: every product of the set in the basket → the percentage (value_bp) or amount (value_minor, off the set as a whole) off those lines. Stock is untouched. Right: discounts.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductSetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductSet"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The set."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a product set",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/product-sets/{id}": {
      "delete": {
        "description": "With its promotion. Right: discounts.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a product set",
        "tags": [
          "admin:marketing"
        ]
      },
      "get": {
        "description": "Right: discounts.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductSet"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The set."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product set",
        "tags": [
          "admin:marketing"
        ]
      },
      "put": {
        "description": "Its products, price off and switch; its promotion is written anew. Right: discounts.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductSetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductSet"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The set."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rewrite a product set",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/product-views": {
      "get": {
        "description": "Needs catalog.read. The signed-in operator's own views of the products list, by name.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedView"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The views."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List your saved product views",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Needs catalog.read. `query` is the list's query string as the panel writes it; `id`, `page` and token-like keys are dropped. The same name replaces the operator's view. At most 50 per list. Audited (`saved_view.create`).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedViewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The view."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a product view",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/product-views/{id}": {
      "delete": {
        "description": "Needs catalog.read. Only the operator's own view. Audited (`saved_view.delete`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Done; no body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a saved product view",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products": {
      "get": {
        "parameters": [
          {
            "description": "Search (ADR-0040): the product's text in every language — title, subtitle, description, SKUs and barcodes, its category's and collections' names — matched as on the storefront (word starts, folded Turkish and accented letters, stems, substrings; title typos when nothing else matches). Without `sort`, the best match comes first.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "draft",
                "active",
                "archived"
              ],
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "vendor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact match.",
            "in": "query",
            "name": "product_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Products carrying exactly this tag. Exact rather than case-folded so the match is answered by the index; tags are de-duplicated case-insensitively on write, so one spelling of a tag is the only spelling stored.",
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Restrict to a category and everything nested under it. An unparseable value is an error rather than a silently ignored filter, because a filter that quietly matches everything is how a typo turns into \"why is this showing the whole catalogue\".",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Restrict to one collection's members, and order them the way that collection was curated rather than newest-first. An unparseable value is an error rather than a silently ignored filter. A collection nobody has is an empty page, not a 404. Sending `sort` together with it is a validation error rather than a silent override: a collection's order is the curation (D40).",
            "in": "query",
            "name": "collection_id",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order (newest first, best match first under `q`, or a collection's curated order). Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. `price` is the cheapest variant and `available` the summed availability of tracked variants; a product with no tracked variants sorts last under either, in both directions. `status` orders alphabetically (active, archived, draft), which is not the lifecycle order. Sending `sort` together with `collection_id` is a 400: a collection is shown in the order it was curated.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "available",
                "created_at",
                "id",
                "price",
                "sold",
                "status",
                "title",
                "updated_at"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "description": "Filter by a category attribute's recorded value, as `handle:value` — for example `attr=bag-case-material:Canvas`. Repeat the parameter to add more. Several values of the SAME handle widen the result (canvas OR leather, because a shopper who ticks both wants either); different handles narrow it (canvas AND black, because they describe one item). Only the first colon separates, so `color:Black:ish` is the value \"Black:ish\". Matching is exact, not a substring. An entry with no colon, no handle or no value is ignored rather than refused, so a truncated URL narrows to everything or to nothing instead of taking the listing away. The values are the ones stored under `metadata.category` by the category's own field list.",
            "example": "bag-case-material:Canvas",
            "explode": true,
            "in": "query",
            "name": "attr",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "description": "Only products lacking a complete translation in this language (title, and every field and option that has default-language text).",
            "in": "query",
            "name": "missing_translation",
            "required": false,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of products."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List products",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Options and variants may be created in the same call. For a product with no options, send `sku` and `price_minor` instead of `variants` and the single default variant is created for you.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a product",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/bulk": {
      "post": {
        "description": "Needs catalog.write (and collections.write for `add_to_collection`). Each product is its own transaction with its own audit row and event, so one failure never undoes the others; the answer lists what was done and what failed, with the reason. `publish` sets status active, `unpublish` draft. `delete` needs `confirm: true`. At most 500 products. Orders have no bulk writes: money and shipping actions stay one order at a time (bulk export is `ids=` on the order export).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductBulkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductBulkResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What happened to each product."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply one action to many products",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/bulk-price": {
      "post": {
        "description": "percent: every price of the chosen products in every currency (the store's own and each currency price) moves by `value` %, rounded to the currency's smallest unit (-90…500). amount: `value` in `currency` (the store's own when empty) is added to every price in that currency. `compare_at` moves the struck-through price the same way. Nothing is written when a price would fall below zero (400). `product_ids` empty: every product. `dry_run`: counts and a few before/after samples, nothing written. Audited; a price.changed event per product.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "compare_at": {
                    "type": "boolean"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "dry_run": {
                    "type": "boolean"
                  },
                  "mode": {
                    "enum": [
                      "percent",
                      "amount"
                    ],
                    "type": "string"
                  },
                  "product_ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "value": {
                    "description": "A decimal, e.g. \"5\" or \"-2.5\".",
                    "type": "string"
                  }
                },
                "required": [
                  "mode",
                  "value"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "dry_run": {
                          "type": "boolean"
                        },
                        "prices": {
                          "type": "integer"
                        },
                        "products": {
                          "type": "integer"
                        },
                        "samples": {
                          "items": {
                            "properties": {
                              "after_minor": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "before_minor": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "product_id": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "sku": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What changed, or would."
          },
          "400": {
            "description": "A bad value, or a price would fall below zero."
          },
          "404": {
            "description": "A product named is not this store's."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change many prices at once",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/bulk-price/currencies": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "base": {
                          "type": "string"
                        },
                        "currencies": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's own currency first, then every currency a variant has a price in."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Currencies the store has prices in",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}": {
      "delete": {
        "description": "Order lines survive: they hold their own snapshot and their product reference is simply nulled.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a product",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a product in any status",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Every field is optional; an omitted field is left alone, which is what distinguishes \"not mentioned\" from \"set to empty\".",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "category_id": {
                    "description": "The product's category; null removes it. Absent keeps it.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "dealer_only": {
                    "description": "Prices and add to basket for approved dealers only (ADR-0091 §2).",
                    "type": "boolean"
                  },
                  "delivery_note": {
                    "description": "The digital delivery note (Product.delivery_note).",
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "description_doc": {
                    "description": "A rich-text document replaces the description (and `description` with its plain text); null goes back to plain text. A plain `description` alone that changes the text drops the document; the same text keeps it.",
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/RichTextDocument"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "extra_category_ids": {
                    "description": "Replaces the product's extra categories (see ProductInput).",
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "gift_card": {
                    "description": "The product sells gift cards (0176): once its order is paid, a card per unit is issued for the line's price and its code e-mailed to the buyer.",
                    "type": "boolean"
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "personalisation": {
                    "description": "Replaces the product's field list (Product.personalisation). A product that gains its first field while sold with the ordinary right of withdrawal becomes \"personalised\" (MSY 15/1-b), unless the same patch names withdrawal_exception.",
                    "items": {
                      "$ref": "#/components/schemas/PersonalisationField"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "product_type": {
                    "type": "string"
                  },
                  "production_days": {
                    "description": "Product.production_days.",
                    "maximum": 365,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "seo_description": {
                    "type": "string"
                  },
                  "seo_title": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "draft",
                      "active",
                      "archived"
                    ],
                    "type": "string"
                  },
                  "subtitle": {
                    "type": "string"
                  },
                  "tags": {
                    "description": "Replaces the whole set. Tags have no identity of their own, so \"add one\" is not something the engine can tell apart from a client that sent a stale list.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "template": {
                    "description": "An alternate template of the theme (ADR-0068): \"landing\" renders with \u003cbase\u003e.landing; \"\" the theme's own. The storefront falls back to the base template when the theme has no such alternate.",
                    "maxLength": 40,
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "vendor": {
                    "type": "string"
                  },
                  "withdrawal_exception": {
                    "description": "Product.withdrawal_exception.",
                    "enum": [
                      "none",
                      "price_fluctuating",
                      "personalised",
                      "perishable",
                      "hygiene_opened",
                      "mixed_inseparable",
                      "sealed_media_opened",
                      "periodicals",
                      "dated_leisure",
                      "instant_digital",
                      "instant_service"
                    ],
                    "type": "string"
                  },
                  "works_with": {
                    "description": "Product.works_with.",
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a product",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/channels": {
      "get": {
        "description": "An empty list means every channel, not none — see PUT below.",
        "parameters": [
          {
            "description": "The product.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channel ids."
          }
        },
        "summary": "Which channels a product is narrowed to",
        "tags": [
          "channels"
        ]
      },
      "put": {
        "description": "Replaces the narrowing whole. **An empty list clears it, which puts the product back in every channel rather than in none.** A product with no publication rows sells everywhere; publication is a narrowing an operator opts into, product by product. Reading it the other way would empty a catalogue the moment a store created its first channel.",
        "parameters": [
          {
            "description": "The product.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "channel_ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "channel_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The channel ids as stored."
          }
        },
        "summary": "Narrow a product to channels",
        "tags": [
          "channels"
        ]
      }
    },
    "/api/v1/admin/products/{id}/collections": {
      "put": {
        "description": "Replace, not merge: the caller holds the whole list. An \"add\" endpoint quietly re-creates a membership the operator removed in another tab, with no way for them to see that it happened. The order sent is the order stored, an unknown id rejects the whole request, and an empty list clears membership. The `position` it writes is where each collection sits in THIS product's list, not where this product sits in each collection — that is `member_position`, which only PUT /api/admin/collections/{id}/products writes (D40).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "collection_ids": {
                    "example": [
                      1,
                      2
                    ],
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "collection_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a product's collections",
        "tags": [
          "admin:collections"
        ]
      }
    },
    "/api/v1/admin/products/{id}/fields": {
      "get": {
        "description": "By key. Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "values": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "type": "object"
                        }
                      },
                      "required": [
                        "values"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The values."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's field values",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Each checked against its field's type; an empty value removes it; a key the store does not define is refused. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "values": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "values"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "values": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "type": "object"
                        }
                      },
                      "required": [
                        "values"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The values."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Write a product's field values",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/files": {
      "get": {
        "description": "Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductFile"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The files."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's downloadable files",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Multipart form, field \"file\", up to 50 MB. Kept outside the public media library; a paid order's buyer gets an expiring link. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductFile"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a downloadable file to a product",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/group-prices": {
      "get": {
        "description": "The store's groups and, per group, the rows of its own price list (its highest-priority list in the base currency) for this product's variants. Right: pricing.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductGroupPrices"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's group prices (Grup fiyatları)",
        "tags": [
          "pricing"
        ]
      },
      "put": {
        "description": "Replaces this product's rows on each group's own list (made, active, when the group has none). One price per group, variant and minimum quantity. Audited (product.group_prices); price.changed. Right: pricing.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductGroupPricesInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductGroupPrices"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a product's group prices",
        "tags": [
          "pricing"
        ]
      }
    },
    "/api/v1/admin/products/{id}/history": {
      "get": {
        "description": "Product edits, options, media and collection membership, plus every variant edit under it — including the price, because a variant edit is filed against the product an operator is looking at. A record with no rows answers 200 with an empty array rather than 404: the log knowing nothing about a record is not the record being absent, and everything that existed before this table did has an honestly empty history.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/products/{id}/labels": {
      "get": {
        "description": "Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductLabelsInput"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's labels put on by hand",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Replaces them; only manual labels. Audited (product.labels_set). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductLabelsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductLabelsInput"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put manual labels on a product",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/media": {
      "get": {
        "description": "Read this before writing: PUT replaces the whole ordered list, so a client that attaches one file without knowing the current one silently discards the rest.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductMedia"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The product's media, in order."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's media, in display order",
        "tags": [
          "admin:media"
        ]
      },
      "put": {
        "description": "The body is the whole list, in order — a reorder and an add are the same request. Media already on the product keeps its position row, and with it any variant that nominated it; removing a file from the list also removes any variant's nomination of it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "media_ids": {
                    "description": "Library ids, in display order.",
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "media_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductMedia"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The product's media, in order."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a product's media, in order",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/products/{id}/options": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "colors": {
                    "additionalProperties": {
                      "pattern": "^#[0-9a-fA-F]{6}$",
                      "type": "string"
                    },
                    "description": "Swatch colours by value, as written in `values`; stored lower-case. A key that is not one of the values is refused.",
                    "example": {
                      "Lacivert": "#1f2a44",
                      "Siyah": "#111111"
                    },
                    "type": "object"
                  },
                  "display": {
                    "description": "How a storefront shows the option: `color` (colour swatches), `image` (each variant's own picture), `button` or `select`. Absent is automatic: the option is recognised by its name (Renk/Color/Farbe is a colour), as before. Omitted, empty or `auto` is automatic.",
                    "enum": [
                      "color",
                      "image",
                      "button",
                      "select",
                      "auto"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "example": "Size",
                    "type": "string"
                  },
                  "values": {
                    "example": [
                      "S",
                      "M",
                      "L"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "name",
                  "values"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add an option axis",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Sets the whole matrix and reconciles the variants with it in one transaction — which is what an editor needs, since renaming an axis or dropping a value is a single intent that would leave the product incoherent if split across calls.\n\nSend an option's `id` to keep it: matched by name alone, renaming \"Size\" to \"Größe\" is indistinguishable from deleting one axis and adding another, and every variant would lose its size. Omit `id` for a new axis. A value carries an id for the same reason — send `{\"id\": 7, \"value\": \"Crimson\"}` to rename the value that row 7 holds, and a bare `\"Crimson\"` to add a new one.\n\nA variant whose combination survives is left completely alone — price, SKU and stock included. A variant whose combination no longer exists is deleted; its order lines keep their own snapshot, so history stays readable. New combinations are created only when `generate_variants` is set.\n\nThe same value may not appear on two axes: variant options are resolved by value, so \"Small\" as both a Size and a Cup could not be told apart, and the request is refused rather than silently mis-resolved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "generate_variants": {
                    "default": false,
                    "description": "Create a variant for every combination that has none. Off by default: adding an axis should not quietly mint sellable SKUs at a guessed price.",
                    "type": "boolean"
                  },
                  "options": {
                    "items": {
                      "properties": {
                        "display": {
                          "description": "How a storefront shows the option: `color` (colour swatches), `image` (each variant's own picture), `button` or `select`. Absent is automatic: the option is recognised by its name (Renk/Color/Farbe is a colour), as before. Omitted keeps what the axis with this `id` had (a new axis is automatic); empty or `auto` sets it back to automatic.",
                          "enum": [
                            "color",
                            "image",
                            "button",
                            "select",
                            "auto",
                            ""
                          ],
                          "type": "string"
                        },
                        "id": {
                          "description": "The existing axis this replaces. Omit for a new one.",
                          "format": "int64",
                          "type": "integer"
                        },
                        "name": {
                          "example": "Size",
                          "type": "string"
                        },
                        "values": {
                          "description": "The axis's values, in display order. A bare string is a value with no identity — what every client sent before value ids existed, and still the right shape for a matrix being created. Send `{id, value}` to keep a value: matched by text alone, renaming \"Red\" to \"Crimson\" is a delete plus an add, and every Red variant's price, SKU, image and stock goes with it.",
                          "example": [
                            "S",
                            "M",
                            "L"
                          ],
                          "items": {
                            "oneOf": [
                              {
                                "type": "string"
                              },
                              {
                                "properties": {
                                  "color": {
                                    "description": "The value's swatch colour (`#rrggbb`, stored lower-case). Omitted keeps the colour of the value it lands on (by id, else by text on the same axis); empty clears it.",
                                    "pattern": "^(#[0-9a-fA-F]{6})?$",
                                    "type": "string"
                                  },
                                  "id": {
                                    "description": "The existing value this replaces. Omit for a new one; an id this axis does not have is refused rather than treated as new.",
                                    "format": "int64",
                                    "type": "integer"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "value"
                                ],
                                "type": "object"
                              }
                            ]
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "name",
                        "values"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "price_minor": {
                    "description": "Price for generated variants. Omitted copies the product's existing default.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "translations": {
                    "additionalProperties": {
                      "items": {
                        "properties": {
                          "name": {
                            "description": "The option as saved, in the default language.",
                            "type": "string"
                          },
                          "translation": {
                            "type": "string"
                          },
                          "values": {
                            "items": {
                              "properties": {
                                "translation": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "value"
                              ],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": [
                          "name"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "description": "The options' text in the store's other languages, by language code (a ready-made option knows it). Written only where the product has no text of its own yet in that language; a language that is not one of the store's other languages is ignored.",
                    "type": "object"
                  }
                },
                "required": [
                  "options"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "changed": {
                          "$ref": "#/components/schemas/OptionChange"
                        },
                        "product": {
                          "$ref": "#/components/schemas/Product"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reconciled product, and what changed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the option matrix",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/relations": {
      "get": {
        "description": "related: on its page before the automatic suggestions; cross_sell: offered in the basket. In order. Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductRelations"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The picks."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The products picked to go with a product",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "At most 12 each; the product itself and repeats are dropped. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductRelations"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductRelations"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The picks."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the products picked to go with a product",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/sales": {
      "get": {
        "description": "Each variant's regular price, its sale price and the sale's window, in the variants' order. A variant whose compare-at is above its price and that has no window reads as a sale without one. Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/VariantSale"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The variants' sales."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's sale prices",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/selling": {
      "get": {
        "description": "The product's sale rows (one per currency: countries, VAT rate, shipping included, the price over its variants) and its export record (ticari tanım, customs description, GTİP, origin, Incoterm — the store's default proposed when unset —, duties), each row with its state (live, draft, or flagged: inherited and on sale as before) and exactly what it lacks (ADR-0146). A product with nothing stored yet answers inherited rows derived from today's markets, prices and tax rules (`derived: true`) and sells as before. Right: catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductSelling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The selling block."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A product's selling",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Replaces the product's sale rows and changes its export record (nil fields are left as they are). A row sent exactly as it was inherited stays inherited (sells as before); a new or edited row is held by the gate: incomplete, it is saved as a draft and never offered. A row's `price_minor` prices every variant in that currency; a currency the store has no market for gets one. The ticari tanım names the product's invoice item (found by name, else created); GTİP and the customs description are the item's; the origin is written to every variant. Audited (product.selling_update). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductSellingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductSelling"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The saved selling block."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a product's selling",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/tax-class": {
      "put": {
        "description": "Needs catalog.write. The product's class wins over its category's and the store's rates (M2). `tax_class_id: null` takes the product out of any class. Audited (`product.tax_class_set`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "tax_class_id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "tax_class_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The product, with `tax_class_id`."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put a product in a tax class",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/translations": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductTranslations"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every non-default store language."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List a product's translations",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/translations/{lang}": {
      "delete": {
        "description": "Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a product's translation in one language",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Replaces the language's translation; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default (the default language's text lives on the record itself).",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductTranslationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductTranslation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The stored translation."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a product's translation in one language",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/translations/{lang}/status": {
      "post": {
        "description": "Needs catalog.write. draft → reviewed → approved → published, one step at a time, or back to draft from any state (reject / withdraw). The same status again is a no-op. Only a published translation is served by store reads. Audited (`product.translation_status`, with the note).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "One of the store's languages other than its default.",
            "in": "path",
            "name": "lang",
            "required": true,
            "schema": {
              "example": "en",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationStatusInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationReviewItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The translation in the queue's shape."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move a product's translation through review",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/products/{id}/variants": {
      "post": {
        "description": "`options` names the value chosen on each of the product's axes, in any order. Two variants may not select the same combination — that is enforced by a unique index, not by hope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a variant",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/push": {
      "get": {
        "description": "Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PushSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Web push settings, subscribers and messages",
        "tags": [
          "admin:marketing"
        ]
      },
      "put": {
        "description": "The first time on makes the store's VAPID key pair. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PushSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch the storefront's notifications on or off",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/push/campaigns": {
      "post": {
        "description": "Queued and sent in the background, eight at a time; a browser its push service no longer knows is forgotten. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushCampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PushCampaign"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The queued message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a notification to every subscriber",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/recurring-jobs": {
      "get": {
        "description": "Every recurring type this build registers, sorted by type, with whether it is on for the tenant and whether it may be switched off. A type the scheduler has not reached yet is on.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/RecurringJob"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The recurring types."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The recurring job types and this store's switches",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/recurring-jobs/{type}": {
      "put": {
        "description": "Switching off stops the scheduler enqueuing the type for this tenant; an instance already queued still runs unless cancelled, and work enqueued on request (a nudge) is not affected. A `required` type cannot be switched off (409): work that keeps money, stock, legal retention or the platform's bookkeeping correct. Audited as `recurring_job.disable` / `recurring_job.enable` when the switch changes.",
        "parameters": [
          {
            "description": "The recurring job type, such as shipments.track.",
            "in": "path",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RecurringJob"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The type after the change."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch a recurring job type on or off",
        "tags": [
          "admin:platform"
        ]
      }
    },
    "/api/v1/admin/refund-approvals": {
      "get": {
        "description": "Needs orders.refund.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "approvals": {
                          "items": {
                            "$ref": "#/components/schemas/RefundApproval"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pending approvals."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the refunds waiting for a second approval",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/refund-approvals/{id}/approve": {
      "post": {
        "description": "A second person with orders.refund — never the one who asked — approves; the refund then runs as them. Approving again answers with it. Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "description": "Why, in the decider's words.",
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RefundApproval"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The approval."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Approve a refund",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/refund-approvals/{id}/reject": {
      "post": {
        "description": "A second person with orders.refund — never the one who asked — rejects; nothing moves. Audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "description": "Why, in the decider's words.",
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RefundApproval"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The approval."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reject a refund",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/reports/custom": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomReport"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every saved report, by name."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The custom reports this store has saved",
        "tags": [
          "admin:reports"
        ]
      },
      "post": {
        "description": "Requires reports.write, which only owner carries by default: a report reads any table the engine can, so saving one decides what everyone with reports.read may look at. The SQL is checked here as well as at run time, because a report that cannot run is not worth keeping and now is when its author can fix it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomReportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved report."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a custom report",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/custom/run": {
      "post": {
        "description": "Requires reports.write, because this is writing a report — it has just not been kept. Runs inside a read-only transaction with a 15-second statement timeout, always rolled back, so PostgreSQL refuses every write regardless of what the query says. A parse also rejects anything that is not a single SELECT or a read-only WITH — comments stripped first, so a verb cannot hide behind one — which exists so the operator reads \"a report may only read\" rather than a driver error.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "sql": {
                    "type": "string"
                  }
                },
                "required": [
                  "sql"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomReportResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the query selected."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Run a query without saving it",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/custom/{id}": {
      "delete": {
        "description": "A report holds no data of its own, so there is nothing to keep a record of.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a saved report",
        "tags": [
          "admin:reports"
        ]
      },
      "patch": {
        "description": "A partial update: only the keys present in the body change, and a key left out keeps its saved value; an empty description clears it. The path wins over any id in the body: a PATCH to /42 carrying id 7 is a typo, and guessing which was meant is how one report overwrites another.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "The whole report as it should read: name and sql are checked as on save. Any other field is refused.",
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "id": {
                    "description": "Ignored: the path names the report.",
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "sql": {
                    "description": "A single SELECT, or a WITH whose body only reads.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved report."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a saved report",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/custom/{id}/run": {
      "post": {
        "description": "Requires reports.read rather than reports.write: the point of saving a report is that somebody else can run it, and its SQL was reviewed by whoever could write it. Runs inside a read-only transaction with a 15-second statement timeout, always rolled back, so PostgreSQL refuses every write regardless of what the query says. A parse also rejects anything that is not a single SELECT or a read-only WITH — comments stripped first, so a verb cannot hide behind one — which exists so the operator reads \"a report may only read\" rather than a driver error.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomReportResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the query selected."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Run a saved report",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/customer-value": {
      "get": {
        "description": "Cohorts by first-order month with how many ordered in each later month (last 3–24 months, default 12); lifetime value, orders per customer and repeat rate; RFM groups (champions, loyal, promising, new, at_risk, hibernating, lost) by days since the last order and number of orders. Spend is paid orders less refunds in the base currency. Right: reports.read.",
        "parameters": [
          {
            "in": "query",
            "name": "months",
            "required": false,
            "schema": {
              "maximum": 24,
              "minimum": 3,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerValueReport"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The report."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Customer value: cohorts, lifetime value, RFM",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/export-links": {
      "post": {
        "description": "Needs reports.read (stock-value also inventory.read). `kind`: `sales` and `refunds` (params from, to, group_by, tz — as GET /reports/sales; a row per bucket and a total row per currency, amounts as decimals), `top-products` (from, to, tz, currency, by, sort — the whole ranking, at most 10 000 rows), `stock-value` (location_id), `custom-report` (id of a saved report; the report's 1000-row cap applies). The file starts with a UTF-8 byte-order mark for spreadsheet programs. Same link rules as POST /export-links. Audited (`export_link.create`).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportLinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ExportLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link. Open `url` (relative to the API origin) within five minutes; it works once."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ask for a one-shot download link to a report as CSV",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/funnel": {
      "get": {
        "description": "Of the store's visits in the last days (1–90, default 30): how many looked at a product, opened the basket, reached checkout and ordered, from the store's own visit analytics. Right: reports.read.",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "maximum": 90,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FunnelReport"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The funnel."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The conversion funnel",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/overview": {
      "get": {
        "description": "One store over a period that ends now — today since midnight (`days=1`, hourly buckets) or the last N days with today included (daily buckets), in the store's time zone — beside the same span one period earlier (yesterday until this hour, the N days before), so a change never compares a partial day with a whole one. Sales are orders whose status is neither pending nor cancelled, per currency in integer minor units, never added across currencies; refunds are succeeded refunds by the day they went out; visits, pages, countries, devices and channels are the store's own cookieless visits; new customers are customer records created, members are accounts opened; best sellers are in the store's currency by units, with each product's lead picture; the most-viewed products are storefront product pages matched by slug. No ratio is computed: the client divides the counts it is given. Needs reports.read.",
        "parameters": [
          {
            "description": "1–366, today included; default 30.",
            "in": "query",
            "name": "days",
            "schema": {
              "maximum": 366,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The period's statistics."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The home screen's statistics over a period",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/payouts": {
      "get": {
        "description": "Per currency, per payment method: the paid sales it charged, what was refunded on exactly those orders, the net, and what it is still owed. A sale is an order whose stock has left the shelf, the same definition the sales report uses, so the two agree. This is the store's own ledger counted by the day the order was placed — not a settlement statement: the engine does not know when a gateway paid out, what it withheld in fees, or which orders it grouped into one transfer, so the difference from a bank statement is fees and settlement lag. Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFrom"
          },
          {
            "$ref": "#/components/parameters/ReportTo"
          },
          {
            "$ref": "#/components/parameters/ReportTimeZone"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PayoutsReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The window, by method."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What each payment method took, and what went back",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/sales": {
      "get": {
        "description": "A reading of the orders, added up in the database rather than in the client. A sale is an order whose stock has left the shelf — confirmed, partly shipped, shipped or delivered — so a cash-on-delivery order counts from the moment checkout confirms it, a partly shipped one counts in full, and an in-flight pending checkout that the unpaid sweeper may cancel does not. Pending and cancelled orders are reported beside the totals in `excluded`, never inside them. Payment does not decide whether a sale happened: it splits the same money into `paid`, `outstanding` (pending or failed) and `refunded`, which sum to `total` exactly. Money that has actually gone back is reported rather than netted off — `paid.refunded` for partial refunds, with `paid.net_collected` beside it. `net` is items less discount, and less tax when the prices contained it, so `total = net + tax + shipping` holds under either tax mode. Buckets are calendar day, ISO week (Monday) or month cut in `tz`, and the window's own edges are resolved in that same zone; the first and last bucket carry `partial` when the window clips them. Figures are grouped by the order's own currency and never summed across currencies.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFrom"
          },
          {
            "$ref": "#/components/parameters/ReportTo"
          },
          {
            "$ref": "#/components/parameters/ReportGroupBy"
          },
          {
            "$ref": "#/components/parameters/ReportTimeZone"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One block per currency, each with its window totals and its zero-filled buckets."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sales totals per day, week or month",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/search-terms": {
      "get": {
        "description": "The most searched terms of the last days (1–365, default 30) and the most searched that found nothing, from the storefront's results page. Right: reports.read.",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchTermReport"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The report."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What shoppers searched for",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/stock-value": {
      "get": {
        "description": "On-hand units of tracked variants (positive balances), valued at cost (variants with a recorded cost) and at their base-currency price, per location and in total. Needs reports.read and inventory.read.",
        "parameters": [
          {
            "description": "One location only.",
            "in": "query",
            "name": "location_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockValueReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The report."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stock value",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/top-products": {
      "get": {
        "description": "The order lines of sales — confirmed, partly shipped, shipped or delivered orders — grouped by product or by variant, within one currency. Title, SKU and variant label are the newest snapshot the lines carry, so a renamed or deleted product still reports under a name somebody recognises; `product_id` is null once the product is gone, and two deleted products stay two rows. `revenue` is line value excluding tax under either tax mode, and BEFORE any order-level discount: a discount is recorded once per order and never allocated to lines, so summing these rows exceeds the sales report's `net` by exactly the discounts in the window.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ReportFrom"
          },
          {
            "$ref": "#/components/parameters/ReportTo"
          },
          {
            "$ref": "#/components/parameters/ReportTimeZone"
          },
          {
            "description": "One ISO code; defaults to the store's configured currency. Ranking across currencies would compare numbers that are not comparable.",
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "by",
            "schema": {
              "default": "product",
              "enum": [
                "product",
                "variant"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "default": "revenue",
              "enum": [
                "revenue",
                "units"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductSales"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Ranked rows, highest first, with a total tiebreak on the group key so paging never repeats or drops a row."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Best sellers over a window",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/reports/wishlist": {
      "get": {
        "description": "How many signed-in customers keep each product as a favourite, most first (guests' favourites stay in their browser and are not counted). `limit` 1–500, default 100. Right: reports.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WishlistCount"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Counts per product."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Favorilere eklenme: favourites per product",
        "tags": [
          "admin:reports"
        ]
      }
    },
    "/api/v1/admin/return-reasons": {
      "get": {
        "description": "The store's return reasons, each heading before its sub-reasons. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ReturnReason"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Return reasons."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List return reasons",
        "tags": [
          "admin:orders"
        ]
      },
      "post": {
        "description": "Needs orders.write. Audited as return_reason.create.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnReasonInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReturnReason"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created reason."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a return reason",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/return-reasons/{id}": {
      "delete": {
        "description": "A reason with sub-reasons is refused (409) until they are deleted. Return lines that named it keep its label. Needs orders.write. Audited as return_reason.delete.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a return reason",
        "tags": [
          "admin:orders"
        ]
      },
      "get": {
        "description": "Needs orders.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReturnReason"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reason."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a return reason",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "Returns that named it keep the label they had. Needs orders.write. Audited as return_reason.update.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnReasonPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReturnReason"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reason."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a return reason",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/review-requests": {
      "get": {
        "description": "Whether the store asks its customers for a review after delivery, after how many days, the optional thank-you code and the discount it copies, whether an e-mail sender is set up; and the requests of the last `days` days (default 30): waiting, sent, reviewed, skipped. The wording, preview and test send are the notification templates' (email, event review.request). Needs notifications.read.",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "schema": {
              "maximum": 365,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewRequestOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings and the report."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The review request: settings and the last days' counts",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Switches the review request on or off (off until the store turns it on), the days after delivery (1–60; without a reported delivery the shipment plus three more days counts), and the thank-you: `reward_enabled` with `reward_discount_id`, one of the store's discounts that each single-use code copies, usable for `reward_days` (1–365). Audited as notification_template.update (key review_request). Needs notifications.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRequestSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewRequestSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the review request settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/reviews": {
      "get": {
        "description": "Newest first. `status` pending, approved, rejected or all (absent: all); `product_id`; `q` matches the name, the address, the title, the text and the product. Right: review.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "product_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AdminReview"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reviews."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Product reviews to moderate (Müşteriler › Değerlendirmeler)",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/reviews/counts": {
      "get": {
        "description": "Right: review.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewCounts"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "How many reviews wait, are published and were rejected",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/reviews/{id}": {
      "delete": {
        "description": "Audited. Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a review",
        "tags": [
          "admin:orders"
        ]
      },
      "get": {
        "description": "Right: review.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One review",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "Audited (review.approved / review.rejected / review.pending). Publishing or withdrawing announces product.updated, so the product's cached pages and stars refresh. Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "status": {
                    "enum": [
                      "pending",
                      "approved",
                      "rejected"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "status"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Approve, reject or put back a review",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/reviews/{id}/photos/{media_id}": {
      "delete": {
        "description": "Takes it off the review and deletes the library file (unless the store has attached that file to a product). Audited (review.photo_removed). Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "The photo's media library id (AdminReviewPhoto.media_id).",
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove one photo of a review",
        "tags": [
          "admin:orders"
        ]
      },
      "patch": {
        "description": "`approved` shows it with the published review, `rejected` hides it. Audited (review.photo_approved / review.photo_rejected). Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "The photo's media library id (AdminReviewPhoto.media_id).",
            "in": "path",
            "name": "media_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "status": {
                    "enum": [
                      "approved",
                      "rejected"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "status"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Show or hide one photo of a review",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/reviews/{id}/reply": {
      "delete": {
        "description": "Audited (review.reply_removed); announces product.updated when the review is published. Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove the store's reply",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "Writes or rewrites the store's reply (1–2000 characters). Served with the review on store reads as {text, at}; the staff member's name stays in the panel. Audited (review.replied); announces product.updated when the review is published. Right: review.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "text": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminReview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The review."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Reply to a review as the store",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/richtext/clean": {
      "post": {
        "description": "The block document editor's clean (ADR-0086): the document comes back rebuilt from the named profile of kernel/core/richtext_profiles.json — what a save would store — with what the HTML blocks' allow-list took out (a script, an inline event handler, a style, an iframe and its host …), so the editor can show it at once. Nothing is stored. A document the profile does not describe is refused with the path of the offending node, as on save. Needs content.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RichTextCleanInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RichTextCleanResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cleaned document and what was taken out."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Clean a rich-text document as a save would",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/roles": {
      "get": {
        "description": "What each role may do here, what the engine ships for it, and the closed list of rights to draw from. Behind `roles.write` with the writes, because a map of the store's access is of use only to the people who may redraw it — an operator's own rights reach them on their record.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleMatrix"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every role, the catalogue, and the floor."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's role/right matrix",
        "tags": [
          "admin:roles"
        ]
      },
      "post": {
        "description": "A store's own role beside the engine's four: a key (2–40 lower-case letters, digits, '-' or '_'), a title, and rights drawn from the same catalogue, keeping the floor (catalog.read). It is resolved exactly like a system role for operators and API keys. Requires roles.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "type": "string"
                  },
                  "key": {
                    "type": "string"
                  },
                  "mfa_required": {
                    "type": "boolean"
                  },
                  "rights": {
                    "items": {
                      "description": "A right, `resource.verb`, from this build's catalogue (GET /api/admin/roles lists it).",
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "key",
                  "title",
                  "rights"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The role."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Define a custom role",
        "tags": [
          "admin:roles"
        ]
      }
    },
    "/api/v1/admin/roles/{role}": {
      "delete": {
        "description": "Removes the store's override rather than writing the defaults down, so the role tracks them again from here on. Idempotent: a role that was never customised is already in this state. For a custom role (M8) there is no override to drop: the role itself is deleted (204), refused with 409 while a member, a live API key or an open invitation holds it.",
        "parameters": [
          {
            "description": "A role key: one of the engine's (owner, manager, staff, vendor) or one this store defined.",
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The role, back on its defaults."
          },
          "204": {
            "description": "A custom role, deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Return a role to the engine's defaults",
        "tags": [
          "admin:roles"
        ]
      },
      "patch": {
        "description": "What the store calls a role, which is separate from what the role may do. The role's key — `owner`, `manager`, `staff` — is an identifier written on every operator's record and cannot be changed; only the display title and the description can. All three roles are editable here, owner included: owner's *rights* are unstorable because a store that could narrow them could lock everybody out, and a name locks nobody out of anything. Both fields are optional: one left out (or null) keeps what the store saved, and a blank one puts that field back to the engine's own words — clearing both drops the override, so there is no separate reset. Answers with the role's whole row, rights included, because the screen that renamed it is showing both. Needs roles.write.",
        "parameters": [
          {
            "description": "A role key: one of the engine's (owner, manager, staff, vendor) or one this store defined.",
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "description": "Blank restores the engine's sentence.",
                    "maxLength": 600,
                    "type": "string"
                  },
                  "title": {
                    "description": "Blank restores the engine's name.",
                    "maxLength": 60,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The role."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename a role and describe it",
        "tags": [
          "admin:roles"
        ]
      },
      "put": {
        "description": "The body is the whole set the role should carry, not a change to it. A set matching the engine's default is stored as no override at all, so the role goes back to tracking it. Refused: the owner role (403), a right this engine does not have (400), a set missing catalog.read (400), and removing roles.write from your own role (403) — which would lock you out of this endpoint with no way back short of a static admin token.",
        "parameters": [
          {
            "description": "A role key: one of the engine's (owner, manager, staff, vendor) or one this store defined.",
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "rights": {
                    "items": {
                      "enum": [
                        "catalog.read",
                        "catalog.write",
                        "inventory.read",
                        "inventory.write",
                        "discounts.read",
                        "discounts.write",
                        "taxes.read",
                        "taxes.write",
                        "locations.read",
                        "locations.write",
                        "orders.read",
                        "orders.write",
                        "orders.fulfill",
                        "orders.refund",
                        "customers.read",
                        "team.read",
                        "team.write",
                        "roles.write",
                        "data.export",
                        "data.import",
                        "store.operate",
                        "shipping.read",
                        "shipping.write",
                        "channels.read",
                        "channels.write",
                        "plugins.read",
                        "plugins.write",
                        "notifications.read",
                        "notifications.write",
                        "collections.read",
                        "collections.write",
                        "categories.read",
                        "categories.write",
                        "media.read",
                        "media.write",
                        "pricing.read",
                        "pricing.write",
                        "groups.read",
                        "groups.write",
                        "reports.read",
                        "carts.read",
                        "payouts.read",
                        "store.write",
                        "apikeys.read",
                        "apikeys.write",
                        "reports.write",
                        "vendors.read",
                        "vendors.write",
                        "customers.write",
                        "content.read",
                        "content.write",
                        "content.review",
                        "content.publish",
                        "theme.read",
                        "theme.write",
                        "theme.publish",
                        "contact.read",
                        "contact.write",
                        "review.read",
                        "review.write",
                        "media.delete"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "rights"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The role as it now stands. It applies to every affected operator's next request; nobody is signed out."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace what a role may do",
        "tags": [
          "admin:roles"
        ]
      }
    },
    "/api/v1/admin/roles/{role}/mfa": {
      "put": {
        "description": "Members holding the role must enroll a second factor before they can do anything but enroll it. Applies to every role, owner included. Requires roles.write; audited.",
        "parameters": [
          {
            "description": "A role key: one of the engine's (owner, manager, staff, vendor) or one this store defined.",
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "required": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "required"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RoleSet"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The role."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Require a second factor for a role",
        "tags": [
          "admin:roles"
        ]
      }
    },
    "/api/v1/admin/sales-areas/{area}": {
      "get": {
        "description": "The area's health checklist from the store's own data (ADR-0143): domestic — base_currency, domestic_payment, domestic_carrier, e_invoice, company; international — export_company (the legal name and tax number: the ETGB's sender and V.D. number), foreign_markets, exchange_rates, foreign_payment, foreign_carrier, hs_codes (products on sale that ship without a GTİP on a variant or their invoice item), export_invoice, export_defaults, etgb_mail, atr_mail, duties. Each line is ok, todo or info, with the count it states. Needs orders.read.",
        "parameters": [
          {
            "description": "domestic or international.",
            "in": "path",
            "name": "area",
            "required": true,
            "schema": {
              "enum": [
                "domestic",
                "international"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesAreaHealth"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The checklist."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A sales area's checklist",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/sales-regions": {
      "get": {
        "description": "The store's sales regions (ADR-0147): each market with its countries, currency, KDV, delivery term and shipping fee by basket total. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesRegionsState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The regions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sales regions",
        "tags": [
          "admin:markets"
        ]
      },
      "post": {
        "description": "Creates a market with its region settings. A country belongs to one region at most; one region may name no country (the rest of the world). Audited (sales_region.save). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesRegionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesRegionsState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The regions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a sales region",
        "tags": [
          "admin:markets"
        ]
      }
    },
    "/api/v1/admin/sales-regions/{id}": {
      "delete": {
        "description": "Removes the region (its market, settings and brackets); a product row left with no region has no country and is held. Audited (sales_region.delete). Right: store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesRegionsState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The regions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a sales region",
        "tags": [
          "admin:markets"
        ]
      },
      "put": {
        "description": "Replaces the region's market and settings; every product row that follows regions takes the new countries. Audited (sales_region.save). Right: store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesRegionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesRegionsState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The regions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a sales region",
        "tags": [
          "admin:markets"
        ]
      }
    },
    "/api/v1/admin/sales-regions/{id}/payments": {
      "put": {
        "description": "Havale / EFT and cash on delivery on or off for addresses in the region; a field left out keeps its state. The checkout refuses either where it is off. Audited (sales_region.payments). Right: store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegionPaymentsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesRegionsState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The regions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch a region's offline payments",
        "tags": [
          "admin:markets"
        ]
      }
    },
    "/api/v1/admin/screens": {
      "get": {
        "description": "What the panel builds its module navigation from. Filtered by the caller's rights, so an entry is never offered to somebody it would answer 403 to — and filtered rather than refused outright, because this list *is* the nav: a 403 here would leave an operator with a panel missing entries instead of a panel without the ones they cannot use.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Screen"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The screens, by group then title."
          }
        },
        "summary": "Screens modules contributed",
        "tags": [
          "screens"
        ]
      }
    },
    "/api/v1/admin/segments": {
      "get": {
        "description": "Each with how many customers it holds now. Right: customers.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Segment"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The segments."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List customer segments",
        "tags": [
          "admin:marketing"
        ]
      },
      "post": {
        "description": "Members are worked out from the rules whenever asked, never stored. Right: groups.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Segment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The segment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a customer segment",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/segments/preview": {
      "post": {
        "description": "The first 20 customers and how many there are, before saving. Right: customers.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentRules"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SegmentPreview"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The preview."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview a segment's rules",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/segments/{id}": {
      "delete": {
        "description": "Campaigns that named it keep their figures; one not yet sent must pick another segment. Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a customer segment",
        "tags": [
          "admin:marketing"
        ]
      },
      "get": {
        "description": "Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Segment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The segment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read a customer segment",
        "tags": [
          "admin:marketing"
        ]
      },
      "put": {
        "description": "Right: groups.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Segment"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The segment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a customer segment",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/segments/{id}/members": {
      "get": {
        "description": "The first 200, by amount spent, and the total. Right: customers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SegmentPreview"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The members."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A segment's customers",
        "tags": [
          "admin:marketing"
        ]
      }
    },
    "/api/v1/admin/selling/apply": {
      "post": {
        "description": "Applies another product's rows and export record, a template, or rows written out to products, through the same validation as the product page: every resulting row is evaluated by the gate and an incomplete one is a draft (ADR-0146). Prices are never copied. `dry_run` answers what each product would be, writing nothing; `withdrawn` counts rows offered before and not after. Audited (product.selling_apply). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingApplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SellingBulkResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Each product's rows."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply selling to products",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/selling/migrate": {
      "post": {
        "description": "Fills each product's rows from today's data (markets and their countries, the countries its baskets reach today, variant prices, tax rules) and stores them as inherited: they keep selling exactly as before, and what they lack is only flagged until the merchant edits the row (ADR-0146). No Incoterm or duties mode is set. No ids: every product of the store not moved yet; a product already moved is skipped. Audited (product.selling_migrate). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingMigrateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SellingMigrateResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Moved and kept products."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move products under the selling rules",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/selling/store": {
      "get": {
        "description": "What every sale row of the store depends on (ADR-0146): base currency, home and origin country, the company details still missing, the currencies a connected payment system can charge, the market currencies, the default Incoterm and the store's KDV dahil / hariç rule. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SellingStore"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The store side."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store side of selling",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/selling/templates": {
      "get": {
        "description": "The store's named presets of sale rows and export fields (ADR-0146). Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SellingTemplate"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The templates."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Selling templates",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Creates a named preset of rows (countries, VAT, shipping included; never prices) and export fields. Audited (selling_template.save). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingTemplateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SellingTemplate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a selling template",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/selling/templates/{id}": {
      "delete": {
        "description": "Audited (selling_template.delete). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a selling template",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Audited (selling_template.save). Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellingTemplateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SellingTemplate"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a selling template",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/autofill": {
      "post": {
        "description": "Queues the seo.autofill job over every product (and its pictures' alt texts, with media.write) and category (with categories.write), in the default language and every translation that has a title. Only empty fields are written — never one the merchant filled — each audited; the AI assistant writes them when set up and use_ai is not false, the rules otherwise. 202 with the new run; 200 with the run already queued or running. Needs catalog.write. Since ADR-0116 every record goes through the autopilot's pass: empty fields and the system's own texts are written (title, description, focus keyword, picture alt texts; pages and posts too, outside their reviewed versions), a text the merchant wrote is never changed — only proposed against — and every write is recorded for undo.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SEOAutofillInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOAutofillRun"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The run already going."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOAutofillRun"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The run, queued."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Run the SEO autopilot over everything now",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/autofill/{id}": {
      "get": {
        "description": "Needs catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOAutofillRun"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The run."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A background SEO fill's progress and result",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/autopilot": {
      "get": {
        "description": "The SEO centre's one screen (ADR-0116): the store's SEO health (0–100 from the signals Google documents for stores: titles present and unique, descriptions, picture alt texts, brand and GTIN for product markup, products reached through a category, every language translated), whether the Otopilot is on, the store's AI, the latest 50 changes the system made (each with whether it can still be undone) and up to 100 open suggestions for texts the merchant wrote or the health-claim guard stopped. Needs catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOAutopilotView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The autopilot."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The SEO autopilot: health, the switch, what it did, what waits",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "On by default. Switched on (with an AI set up), every product, category, page and post is queued for a pass; off, the queue is emptied and nothing is written automatically. Audited (seo.autopilot_set). Needs catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SEOAutopilotSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOAutopilotSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The switch."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch the SEO autopilot on or off",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/changes/{id}/undo": {
      "post": {
        "description": "Restores the text before the change when the field still holds what the change wrote (409 otherwise, and for a change already undone or changed again since), and records the undo; the autopilot then leaves that field alone. Needs catalog.read and the record's write right: catalog.write (product), categories.write (category), media.write (picture), content.write (page, post).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOChange"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The undo, as a change of its own."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Undo one change the SEO autopilot made (Geri al)",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/keyword/{kind}/{id}": {
      "get": {
        "description": "The focus keyword the SEO autopilot keeps for a product, category, page or post in a language (the default language when omitted); empty when none. Needs catalog.read.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "product",
                "category",
                "page",
                "post"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOKeyword"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The keyword."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A record's focus keyword in one language",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Saves the focus keyword the merchant typed for a product, category, page or post in a language (the default language when omitted); recorded as the merchant's, so the SEO autopilot leaves it alone. Spaces are collapsed; at most 100 characters; empty clears it. Needs catalog.read and the record's write right.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "product",
                "category",
                "page",
                "post"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SEOKeywordInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOKeyword"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The keyword."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Keep the merchant's focus keyword for one language",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/overview": {
      "get": {
        "description": "Counts of products, categories, pages, posts and product pictures missing an SEO title, a meta description or an alt text, per store language; up to 100 records with problems (lengths, duplicates); the AI assistant's state and the latest background fill. Needs catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The overview."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The SEO centre: what is missing, per record type and language",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/proposals/{id}/apply": {
      "post": {
        "description": "Writes the suggested text when the field still holds what it held when the suggestion was made (409 and the suggestion marked stale otherwise); the text is then the merchant's. Needs catalog.read and the record's write right.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOProposal"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suggestion, applied."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply an SEO suggestion (Uygula)",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/proposals/{id}/dismiss": {
      "post": {
        "description": "The same suggestion against the same text is not made again. Audited (seo.proposal_dismissed). Needs catalog.read and the record's write right.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOProposal"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suggestion, dismissed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Dismiss an SEO suggestion (Yoksay)",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/seo/suggest": {
      "post": {
        "description": "An SEO title, a meta description, a focus keyword and one alt text per picture in the editing language, from the record as the editor holds it. Through the AI assistant when the store has a key (its own in the ai-assistant plugin, else the platform's COS_AI_ANTHROPIC_KEY / COS_AI_OPENAI_KEY), else by rules; writes nothing. Needs catalog.read and catalog.write (product), categories.write (category) or content.write (page, post). The AI budget is 30 calls a minute per tenant.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SEOSuggestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SEOSuggestion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The texts."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Write SEO texts for the record being edited (Otomatik doldur)",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/settings": {
      "get": {
        "description": "Read-only: everything here is a decision the binary was started with, and changing the settlement currency mid-flight would change what every order in flight means. No right is required — every screen has to format money before it can draw anything, so an operator who could not read this would read prices in the wrong currency and the wrong number of decimals. Nothing may be added to this payload that is not \"what this store is configured as\": diagnostics and secrets belong on a route with a right. `notifier_channels` is the one entry here that can be bad news — a channel with no delivery backend sends nothing and reports success — and it belongs anyway, because what it reports is which backends the binary was composed with.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's configuration and the providers it was composed with."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What this store is configured as",
        "tags": [
          "admin:settings"
        ]
      },
      "patch": {
        "description": "The settings a merchant decides for the store: languages, default language, order prefix, whether prices include tax, flat shipping and how shipping is taxed. An absent field is kept. The base currency is not changeable here — every order in flight is denominated in it. Needs store.write. Audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings after the change."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change the store settings",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/settings/auto-preparation": {
      "get": {
        "description": "The store's \"Otomatik hazırlama\" (ADR-0142), off by default: the carrier that books the parcels and its service, the parcel weight rule, whether the invoice is issued and the orders it covers. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutoPrepSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the automatic preparation settings",
        "tags": [
          "admin:orders"
        ]
      },
      "put": {
        "description": "Switching it on needs `provider`: an installed carrier module that books parcels (never manual) and is set up (409 otherwise). From then on every paid order is looked at by a background job: when the hidden stock covers every line that ships, it is taken, the parcel is booked through the same path as create-fulfillment, the invoice is issued (when `issue_invoice` and an integrator is live) and the label, the carrier's papers and the invoice go to the print queue; otherwise nothing is taken and the order waits for the operator. Audited (store.auto_preparation_update). Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoPrepSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutoPrepSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the automatic preparation settings",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/settings/refund-approval": {
      "get": {
        "description": "The amount per currency from which a refund asked by anyone but the owner waits for a second person. Off by default. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RefundApprovalSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The thresholds."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the second-approval threshold",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Replaces the thresholds; zero or a missing currency is off. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundApprovalSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RefundApprovalSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The thresholds."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the second-approval threshold",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/settings/test-mode": {
      "get": {
        "description": "Whether the store is in test mode (ADR-0137) and until when, who switched it on, how many test orders it has, and the payment methods its checkout offers while it is on (the test card, gateways in their test environment, offline methods) and the live ones it hides. Needs orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreTestMode"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The switch."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read the store's test mode",
        "tags": [
          "admin:payments"
        ]
      },
      "put": {
        "description": "On for `hours` (1–24, two by default) — needs `confirm: true` (400 `test_mode_confirm` without it): while on, a shopper's checkout places a test order (orders.is_test), paid only with the built-in test card or a gateway in its test environment; every live POS is hidden and card routing is off. Test orders stay out of reports, are never invoiced, never booked with a carrier and send nothing to analytics or ad networks. Off at once with `on: false`; it also turns itself off when its time is up. Audited (payment_method.test_mode). Needs plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestModeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreTestMode"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The switch, as it is now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Switch the store's test mode on or off",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/settings/test-mode/delete-orders": {
      "post": {
        "description": "Deletes the context store's test orders for good (up to 500 a call), each in its own transaction: reserved stock is released, committed stock restocked, promotion uses and gift-card spending undone; an audit row (order.test_delete) remains. Never an order that is not a test order, never another store's. A test order with licence codes on it stays (`kept`). Needs orders.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TestOrdersDeleted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What was deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete the store's test orders",
        "tags": [
          "admin:payments"
        ]
      }
    },
    "/api/v1/admin/shipping/brackets": {
      "get": {
        "description": "Each currency's hand-entered brackets (ADR-0146): a basket of at least min_total_minor pays fee_minor, up to the next bracket. A currency with brackets charges its bracket's fee for every table rate (a carrier's live price stays the carrier's), offers one option when no rate covers the address, and charges nothing when every physical line's price includes shipping. Right: shipping.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ShippingBrackets"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brackets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Shipping fee by basket total",
        "tags": [
          "admin:shipping"
        ]
      },
      "put": {
        "description": "Replaces every currency's brackets; a currency left out has none (its rates as they are). Audited (shipping.brackets_update). Right: shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingBracketsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ShippingBrackets"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brackets."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the shipping fee by basket total",
        "tags": [
          "admin:shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/carbon": {
      "get": {
        "description": "Ayarlar › Kargo › Kargo karbon tahmini göster: the switch (off by default), the \"En düşük salım\" tag, each rate's transport mode where the merchant chose one, the dispatch point, and the emission factors with their source (read-only). Right: shipping.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarbonSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The shipping carbon estimate's settings",
        "tags": [
          "shipping"
        ]
      },
      "put": {
        "description": "A mode is road, van or air, keyed by a shipping rate id; origin_lat and origin_lon come together. Audited as cross_border.carbon_update. Right: shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarbonSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarbonSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace the shipping carbon estimate's settings",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/carrier-profiles": {
      "get": {
        "description": "Each carrier's unvan, VKN and tax office as the store's contract names them — what an invoice prints for the carrier.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CarrierProfile"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The profiles."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Carriers' legal identities",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/carrier-profiles/lookup": {
      "get": {
        "description": "A carrier the engine knows answers with its unvan, VKN and tax office; for any other, a typed VKN or TCKN is looked up in the store's e-invoice integrator (the GİB user list) and answers with the company's unvan. Nothing found is found: false.",
        "parameters": [
          {
            "description": "The carrier code, as on a shipment (ups-tr, yurtici, aras…).",
            "in": "query",
            "name": "carrier",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A 10-digit VKN or 11-digit TCKN to look up.",
            "in": "query",
            "name": "tax_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarrierLookup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What was found."
          },
          "400": {
            "description": "Not a carrier, or not a valid tax id."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Find a carrier's legal identity",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/carrier-profiles/{carrier}": {
      "put": {
        "description": "The VKN's check digit is verified.",
        "parameters": [
          {
            "in": "path",
            "name": "carrier",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarrierProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CarrierProfile"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The profile."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Record a carrier's legal identity",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/pickups": {
      "post": {
        "description": "Books a courier pickup for shipments a carrier has booked and not yet collected.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Pickup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The carrier's answer."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Ask a carrier to collect",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/rates": {
      "post": {
        "description": "The band is half-open: min_subtotal_minor is inclusive and max_subtotal_minor exclusive, so a Standard at 4900 below 200000 and a Standard at 0 from 200000 are one method the shopper recognises and cannot both claim a basket. Two bands of one name that do overlap are refused, because a shopper offered the same method at two prices has no way to choose.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingRateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShippingRate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rate."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Price a method inside a zone",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/rates/{id}": {
      "delete": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a rate",
        "tags": [
          "shipping"
        ]
      },
      "patch": {
        "description": "A partial update: only the keys present in the body change, and a key left out keeps its value. max_subtotal_minor null removes the band's ceiling; active null is the same as leaving it out. An unknown key is refused with 400. A body carrying every field behaves as a full replace. Answers with the whole rate.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingRateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShippingRate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rate."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Change a rate",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/zones": {
      "get": {
        "description": "Each zone carries its own rates: a zone with no prices is not something an operator can use, so the two are never shown apart.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "properties": {
                          "rates": {
                            "items": {
                              "$ref": "#/components/schemas/ShippingRate"
                            },
                            "type": "array"
                          },
                          "zone": {
                            "$ref": "#/components/schemas/ShippingZone"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every zone, with its rates."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "Where this store delivers, and what it charges",
        "tags": [
          "shipping"
        ]
      },
      "post": {
        "description": "Countries and states are ISO codes, and both empty is the catch-all zone that every more specific zone beats.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingZoneInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShippingZone"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The zone."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Add a zone",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/shipping/zones/{id}": {
      "delete": {
        "description": "Its rates go with it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a zone",
        "tags": [
          "shipping"
        ]
      },
      "patch": {
        "description": "A partial update: only the keys present in the body change, and a key left out keeps its value. An array sent as [] or null is cleared. An unknown key is refused with 400. A body carrying every field behaves as a full replace. Answers with the whole zone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShippingZoneInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShippingZone"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The zone."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Change a zone",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/admin/site-verification": {
      "get": {
        "description": "Ayarlar › Site doğrulama: every provider (search engines, social and ad platforms, trust and payment) with the token the storefront publishes for it now (`token`, \"\" when none; Google's, Bing's and Yandex's while their plugin is on), the provider's page where the code is made (`url`), and the stored verification files (without bodies). Right: plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteVerification"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's site verification page",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/site-verification/files/{name}": {
      "delete": {
        "description": "The storefront answers its address with 404 from now on. 404 when the file was not set. Audited (site_verification.file_delete). Right: plugins.write.",
        "parameters": [
          {
            "description": "A provider's file name: google{16 hex}.html, BingSiteAuth.xml, yandex_{16 hex}.html, baidu_verify_{code}.html, naver{32 hex}.html, pinterest-{5 hex}.html, tiktok{token}.txt, or apple-developer-merchantid-domain-association (also taken with .txt, as a browser saves it).",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "maxLength": 120,
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a verification file",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Stores or replaces the file served at the domain's root under `name` (one of the providers' shapes; 400 otherwise). The body is text up to 16 KB (Apple Pay's file 32 KB); an HTML body is kept without script, frames, objects, links, forms, event handlers, javascript:/data: addresses, comments and meta refreshes; an XML body must be well formed, with no DOCTYPE. Content type from the extension. Audited (site_verification.file_set). Right: plugins.write.",
        "parameters": [
          {
            "description": "A provider's file name: google{16 hex}.html, BingSiteAuth.xml, yandex_{16 hex}.html, baidu_verify_{code}.html, naver{32 hex}.html, pinterest-{5 hex}.html, tiktok{token}.txt, or apple-developer-merchantid-domain-association (also taken with .txt, as a browser saves it).",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "maxLength": 120,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteFileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFile"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The file as stored (without its body)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Store a verification file",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/site-verification/tags/{provider}": {
      "delete": {
        "description": "The storefront stops publishing it. A plugin-held code is cleared in its plugin, which is otherwise left as it was. Audited (site_verification.tag_delete or plugin.update). Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "google",
                "bing",
                "yandex",
                "baidu",
                "naver",
                "seznam",
                "facebook",
                "pinterest",
                "tiktok",
                "norton",
                "ahrefs",
                "etbis"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed (or there was none)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a provider's verification code",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "`value` is the bare code, the whole \u003cmeta\u003e tag the provider shows (content=\"…\" is read; a tag of another provider is refused), the name=code form, or for ETBİS the registry link (…/sitedogrulama/{code}) or badge. Checked against the provider's shape (400 otherwise). Google's, Bing's and Yandex's code goes to their plugin, which is switched on (audited as plugin.update); the others are audited as site_verification.tag_set. Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "google",
                "bing",
                "yandex",
                "baidu",
                "naver",
                "seznam",
                "facebook",
                "pinterest",
                "tiktok",
                "norton",
                "ahrefs",
                "etbis"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SiteVerificationTagInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteVerificationProvider"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The provider, as the page shows it."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a provider's verification code",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/size-guides": {
      "get": {
        "description": "By name. Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SizeGuide"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The guides."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's size guides",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Audited; announces product.updated for the products it reaches. Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SizeGuideInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SizeGuide"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a size guide",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/size-guides/{id}": {
      "delete": {
        "description": "Audited. Right: catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a size guide",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "description": "Right: catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SizeGuide"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The guide."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One size guide",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Audited; announces product.updated for the products it reached and now reaches. Right: catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SizeGuideInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SizeGuide"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The guide."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a size guide",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/social-feeds": {
      "get": {
        "description": "Ayarlar › Entegrasyonlar › Sosyal medya: every platform's feed — switched on, set up, the account it shows, how many posts it holds, the last sync and its error, and (Instagram) when the token expires. Right: plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SocialFeedStatus"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Every platform."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The social media feeds' state",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/social-feeds/facebook/page": {
      "post": {
        "description": "After a Facebook login that reached more than one Page (social_result=choose_page; the Pages are SocialFeedStatus.pages): connects the chosen one — its token sealed, the feed on. A Page the login did not reach is refused. Right: plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SocialPageInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialFeedStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The feed's state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          },
          "502": {
            "description": "Facebook did not answer."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Choose the Facebook Page to show",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/social-feeds/{platform}/connect": {
      "post": {
        "description": "\"Instagram ile bağlan\" / \"Facebook ile bağlan\" / \"TikTok ile bağlan\": answers the provider's consent page through the platform's own app (one app per provider for every store). The state on it is signed (HMAC) and single-use for ten minutes, and names this store and return_url — an admin page (/admin/…) on one of this store's own hosts; any other is refused. The provider returns to the one platform redirect URI (redirect_uri), which stores the token sealed, switches the feed on and sends the browser back to return_url with ?social=\u003cplatform\u003e\u0026social_result=connected|choose_page|cancelled|not_professional|no_pages|not_configured|failed. 409 NOT_CONFIGURED: the platform administrator has not added the provider's app; 422 NO_CONNECT: X, LinkedIn (addresses), YouTube (channel) and Pinterest (username) have no login. Limited to a few attempts a minute per store. Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "facebook",
                "tiktok",
                "youtube",
                "x",
                "linkedin",
                "pinterest"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SocialConnectInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialConnectStart"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Where to send the merchant."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          },
          "429": {
            "description": "Too many connection attempts; retry after Retry-After."
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start a one-click social feed connection",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/social-feeds/{platform}/disconnect": {
      "post": {
        "description": "\"Bağlantıyı kes\": asks the provider to revoke the grant where it offers a way (Facebook, TikTok; Instagram has none), removes the tokens, switches the feed off and deletes its stored posts and their pictures. Answers the feed's state. Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "facebook",
                "tiktok"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialFeedStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The feed's state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Disconnect a social feed",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/social-feeds/{platform}/sync": {
      "post": {
        "description": "\"Şimdi eşitle\": fetches the platform's posts now, copies new pictures into the media library and replaces the stored feed — what the social_feeds.sync job does every three hours. A platform's refusal is the result's error (and the feed's last error); the stored posts stay. Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "youtube",
                "tiktok",
                "x",
                "facebook",
                "linkedin",
                "pinterest"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialFeedTestResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The result."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sync a social media feed now",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/social-feeds/{platform}/test": {
      "post": {
        "description": "\"Bağlantıyı test et\": calls the platform with the saved settings (whether or not the feed is switched on) and answers the account reached and how many posts it would show, or the platform's refusal. Stores nothing. Right: plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "youtube",
                "tiktok",
                "x",
                "facebook",
                "linkedin",
                "pinterest"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialFeedTestResult"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The result."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test a social media feed's connection",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/stock-alerts": {
      "get": {
        "description": "The switch, SMS and the multiple, and the last 30 days: waiting now, sent, converted (an order of the item from the same address within 7 days). Right: catalog.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockAlertOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stock alerts: settings and report (Ürünler › Stok bildirimleri)",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Audited (stock_alerts.update). Right: catalog.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAlertSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockAlertSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the stock alert settings",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/stock-alerts/demand": {
      "get": {
        "description": "Per variant with waiting requests, most wanted first: how many wait to be told it is back, how many for a price drop, the free stock. A buying signal. Right: inventory.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StockAlertDemand"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What people are waiting for",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/stock-alerts/requests": {
      "get": {
        "description": "Newest first; `variant_id`, `status` waiting, sent or cancelled. Right: customers.read.",
        "parameters": [
          {
            "in": "query",
            "name": "variant_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "waiting",
                "sent",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StockAlertRequest"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The requests, with their addresses",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/store": {
      "get": {
        "description": "What the shop calls itself on the documents a buyer keeps: an invoice, a packing slip, the foot of an email. Carries no right, for the same reason GET /api/admin/settings does not — a shop's own address is not a secret from its own staff, and several screens need it. Every field is a string and every one may be empty; a store that has never filled this in gets blanks rather than a 404.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "address_line1": {
                          "description": "Street address.",
                          "type": "string"
                        },
                        "address_line2": {
                          "description": "Second address line, if there is one.",
                          "type": "string"
                        },
                        "city": {
                          "description": "Town or city.",
                          "type": "string"
                        },
                        "country": {
                          "description": "ISO 3166-1 alpha-2 country code, as everywhere else on this API.",
                          "type": "string"
                        },
                        "email": {
                          "description": "Where a buyer writes to.",
                          "type": "string"
                        },
                        "language": {
                          "description": "Which language a customer is written to in when the order recorded no preference. Must be one of the languages the binary was started with; empty means its default. Distinct from settings.default_language, which is what an API request that asked for no language is served.",
                          "type": "string"
                        },
                        "legal_name": {
                          "description": "The registered entity, when it differs from the trading name. Most places require it on an invoice.",
                          "type": "string"
                        },
                        "name": {
                          "description": "The trading name — what a customer would call the shop.",
                          "type": "string"
                        },
                        "origin_country": {
                          "description": "Where the company's goods originate (MENŞEİ ÜLKE on the ETGB and the customs invoice; ADR-0146), ISO 3166-1 alpha-2; empty: the company's own country.",
                          "type": "string"
                        },
                        "phone": {
                          "description": "Where a buyer calls.",
                          "type": "string"
                        },
                        "postal_code": {
                          "description": "Postcode or ZIP.",
                          "type": "string"
                        },
                        "state": {
                          "description": "State, province or region.",
                          "type": "string"
                        },
                        "support_url": {
                          "description": "Where a buyer is sent for help — the foot of an email links to it.",
                          "type": "string"
                        },
                        "tax_id": {
                          "description": "VAT, GST or equivalent registration number.",
                          "type": "string"
                        },
                        "timezone": {
                          "description": "IANA timezone name, such as Europe/London. Decides what \"today\" means on an invoice and in a report. Empty is UTC.",
                          "type": "string"
                        },
                        "updated_at": {
                          "description": "When the profile was last changed.",
                          "format": "date-time",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store profile."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's own name, address and contact details",
        "tags": [
          "admin:settings"
        ]
      },
      "patch": {
        "description": "Requires store.write: this is the shop's legal identity, and it is what appears on documents a buyer keeps. A partial update: only the keys present in the body change; a key that is absent or null is left as it is, and an empty string clears that field. An unknown key is refused with 400. The response is the whole saved profile. A body carrying every field behaves as a full replace. Each text field is capped at 200 characters and trimmed; the country is an ISO 3166-1 alpha-2 code. Audited as store.profile_update with the before and after of each changed field; a body that changes nothing writes nothing.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "address_line1": {
                    "description": "Street address.",
                    "type": "string"
                  },
                  "address_line2": {
                    "description": "Second address line, if there is one.",
                    "type": "string"
                  },
                  "city": {
                    "description": "Town or city.",
                    "type": "string"
                  },
                  "country": {
                    "description": "ISO 3166-1 alpha-2 country code, as everywhere else on this API.",
                    "type": "string"
                  },
                  "email": {
                    "description": "Where a buyer writes to.",
                    "type": "string"
                  },
                  "language": {
                    "description": "Which language a customer is written to in when the order recorded no preference. Must be one of the languages the binary was started with; empty means its default. Distinct from settings.default_language, which is what an API request that asked for no language is served.",
                    "type": "string"
                  },
                  "legal_name": {
                    "description": "The registered entity, when it differs from the trading name. Most places require it on an invoice.",
                    "type": "string"
                  },
                  "name": {
                    "description": "The trading name — what a customer would call the shop.",
                    "type": "string"
                  },
                  "origin_country": {
                    "description": "Where the company's goods originate (MENŞEİ ÜLKE on the ETGB and the customs invoice; ADR-0146), ISO 3166-1 alpha-2; empty: the company's own country.",
                    "type": "string"
                  },
                  "phone": {
                    "description": "Where a buyer calls.",
                    "type": "string"
                  },
                  "postal_code": {
                    "description": "Postcode or ZIP.",
                    "type": "string"
                  },
                  "state": {
                    "description": "State, province or region.",
                    "type": "string"
                  },
                  "support_url": {
                    "description": "Where a buyer is sent for help — the foot of an email links to it.",
                    "type": "string"
                  },
                  "tax_id": {
                    "description": "VAT, GST or equivalent registration number.",
                    "type": "string"
                  },
                  "timezone": {
                    "description": "IANA timezone name, such as Europe/London. Decides what \"today\" means on an invoice and in a report. Empty is UTC.",
                    "type": "string"
                  },
                  "updated_at": {
                    "description": "When the profile was last changed.",
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "address_line1": {
                          "description": "Street address.",
                          "type": "string"
                        },
                        "address_line2": {
                          "description": "Second address line, if there is one.",
                          "type": "string"
                        },
                        "city": {
                          "description": "Town or city.",
                          "type": "string"
                        },
                        "country": {
                          "description": "ISO 3166-1 alpha-2 country code, as everywhere else on this API.",
                          "type": "string"
                        },
                        "email": {
                          "description": "Where a buyer writes to.",
                          "type": "string"
                        },
                        "legal_name": {
                          "description": "The registered entity, when it differs from the trading name. Most places require it on an invoice.",
                          "type": "string"
                        },
                        "name": {
                          "description": "The trading name — what a customer would call the shop.",
                          "type": "string"
                        },
                        "origin_country": {
                          "description": "Where the company's goods originate (MENŞEİ ÜLKE on the ETGB and the customs invoice; ADR-0146), ISO 3166-1 alpha-2; empty: the company's own country.",
                          "type": "string"
                        },
                        "phone": {
                          "description": "Where a buyer calls.",
                          "type": "string"
                        },
                        "postal_code": {
                          "description": "Postcode or ZIP.",
                          "type": "string"
                        },
                        "state": {
                          "description": "State, province or region.",
                          "type": "string"
                        },
                        "support_url": {
                          "description": "Where a buyer is sent for help — the foot of an email links to it.",
                          "type": "string"
                        },
                        "tax_id": {
                          "description": "VAT, GST or equivalent registration number.",
                          "type": "string"
                        },
                        "updated_at": {
                          "description": "When the profile was last changed.",
                          "format": "date-time",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved profile."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change the store's name, address and contact details",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/store/base-currency": {
      "get": {
        "description": "The currency the variants' own prices, the reports and every order are in; `changeable` is false once the store has an order or a payment (an order snapshots its currency). `rates` are the store's own rates per extra currency (a rate fixed by hand, else the last daily rate): what a conversion multiplies by. Right: store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BaseCurrencyState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The base currency and whether it may change."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's base currency",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Allowed while the store has no order and no payment (409 `base_currency_has_orders` otherwise) and its tenant has one store (409 `base_currency_shared_catalogue`). `prices: convert` converts the variants' prices, compare-at prices, costs and the flat shipping fee — a price the store already has in the new currency is taken as it is, the rest go by the store's own rate, else the European Central Bank's rate of the day (409 `base_currency_no_rate` when there is none); `prices: keep` keeps the numbers as typed. The sales regions keep their currencies: a region still selling in the old currency gets today's prices set by hand in it. Fixed discounts without a currency are pinned to the old one. Audited (store.settings_update); queues a refresh of the automatic prices. Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BaseCurrencyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BaseCurrencyChange"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The change made."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change the store's base currency",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/store/crawl": {
      "get": {
        "description": "Ayarlar › Site haritası ve robots.txt: whether the store hides from search engines, its own robots.txt lines, whether AI crawlers are turned away, which parts the sitemap leaves out and whether it lists pictures. The storefront builds robots.txt and sitemap.xml from these. Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreCrawl"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The store's choices."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What the store tells search engines",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Replaces the store's choices. robots_extra takes User-agent, Allow, Disallow and Crawl-delay lines and # comments only (at most 100 lines, 4000 characters); sitemap_exclude names parts from products, collections, categories, pages, blog and legal. Audited. Needs store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreCrawl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreCrawl"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The choices as saved (robots_extra tidied, parts in order)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change what the store tells search engines",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/store/kind": {
      "get": {
        "description": "The store kind (physical, digital, both, services), the merchant's overrides, the kind's defaults and the effective set of what is shown (order tracking, shipping settings, shipping texts; ADR-0071). No right needed, like GET /admin/store.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreKindState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "What the store sells",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "The kind and the overrides, both replaced; audited (store_profile.update). The storefront reads the effective set in the site answer (surfaces). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreKindInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreKindState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save what the store sells",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/store/presence": {
      "get": {
        "description": "Store-owned (every theme reads them): the saved links, the owner's payment-mark list (null while it follows the switched-on payment methods), the suggestion and the choices. No right needed, like GET /admin/store.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StorePresenceSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's social links and payment marks",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Each link's value is normalised to the network's https address (@handle → profile URL, a WhatsApp number → https://wa.me/\u003cdigits\u003e); an address on another site is refused (400 with details.index). An empty value drops the link. The order is kept. Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StorePresenceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StorePresenceSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the store's social links and payment marks",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/store/sales-mode": {
      "get": {
        "description": "The store's sales mode (domestic, international or both; ADR-0143): its own choice, or — while it has not chosen (`chosen: false`) — the mode derived from what it uses (a market abroad or in another currency, prices in another currency, a foreign payment system or carrier connected, the ETGB workspace in use → both; otherwise domestic). Each panel area (Yurtiçi / Yurtdışı Satışlar) says whether the mode sells in it, whether the panel lists it and what the store uses in it; `modules` classifies every installed payment and carrier module (and cash on delivery, bank transfer) by area. The admin only: the storefront and the checkout never read it. No right needed, like GET /admin/store/kind.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesModeState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Where the store sells",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Records the store's sales mode; audited (store.profile_update). It changes which areas the panel lists, nothing else: no market, price or connection is touched, and an area the store uses stays listed with a note. Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesModeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SalesModeState"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The saved state."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Choose where the store sells",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/stores": {
      "get": {
        "description": "For the panel's store switcher: the tenant's stores the caller's membership reaches (all of them when `store_ids` is empty). Send one as `X-Store-Id`. No right is needed, like /me: it names only what the caller already reaches.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StoreRef"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The stores, by id."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The stores the caller may act on",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/stories": {
      "get": {
        "description": "Right: content.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Story"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stories."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List stories",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "A picture (https or a store path), an optional short video and link. Right: content.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Story"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Story"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The story."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a story",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/stories/{id}": {
      "delete": {
        "description": "Right: content.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a story",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "Right: content.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Story"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Story"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The story."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a story",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/subscriptions": {
      "get": {
        "description": "Active and paused first by next date; at most 500. Right: orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ShopperSubscription"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The subscriptions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List shoppers' repeat orders",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/subscriptions/{id}": {
      "patch": {
        "description": "Pause, resume, cancel, skip the next or change the interval. Right: orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShopperSubscriptionPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShopperSubscription"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The subscription."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a shopper's repeat order",
        "tags": [
          "admin:orders"
        ]
      }
    },
    "/api/v1/admin/superusers": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SuperuserRow"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every superuser, oldest first."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List operators",
        "tags": [
          "admin:auth"
        ]
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/SuperuserResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add an operator",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/superusers/{id}": {
      "delete": {
        "description": "The last superuser cannot be removed: an admin panel nobody can sign in to is not a state an operator can click their way out of.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove an operator",
        "tags": [
          "admin:auth"
        ]
      },
      "patch": {
        "description": "Send either field, or both. Changing the password signs that operator out everywhere, because a password change is how someone responds to a compromise. The email and the password are the user's (M8): for a person who also belongs to another organisation this is refused with 403, and they change their own through PATCH /api/admin/me.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "minLength": 8,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SuperuserResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change an operator's email or password",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/superusers/{id}/membership": {
      "patch": {
        "description": "Suspending ends the member's sessions in this store at once and keeps the account and its history; the last active owner cannot be suspended, and nobody suspends themselves. `store_ids` limits the member to those stores (empty: every store). `mfa_required` demands a second factor of this member whatever their role says. Requires team.write. Every change is audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "mfa_required": {
                    "type": "boolean"
                  },
                  "status": {
                    "enum": [
                      "active",
                      "suspended"
                    ],
                    "type": "string"
                  },
                  "store_ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Superuser"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The operator."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change a membership: status, stores, second factor",
        "tags": [
          "admin:superusers"
        ]
      }
    },
    "/api/v1/admin/superusers/{id}/password-reset": {
      "post": {
        "description": "Requires `team.write`, the right that can already set that operator's password outright — so this grants nothing new, and replaces the practice of choosing somebody's password for them.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PasswordResetAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Taken in."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Mail an operator a reset link",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/superusers/{id}/revoke-sessions": {
      "post": {
        "description": "What to reach for when a laptop goes missing, or before removing an account. A role change already takes effect on the next request — the role is read from the row each time — but a session has to be ended to stop it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "revoked": {
                      "description": "How many sessions ended. 0 and 4 mean different things to somebody who has lost a laptop.",
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many sessions ended."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sign somebody else out everywhere",
        "tags": [
          "admin:auth"
        ]
      }
    },
    "/api/v1/admin/superusers/{id}/role": {
      "put": {
        "description": "Separate from PATCH on the superuser because it is a different act: changing somebody's email is administration, changing their role is granting or taking away access. The roles are owner, manager and staff, and what each carries is fixed — see the rights list on the operator record. A store keeps at least one owner: `team.write` is the only right that can hand out roles, and demoting the last owner would leave a team where nobody carries it — so the survivors could not promote anybody, including themselves, and the way back in would be a database client. It is refused.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "role": {
                    "description": "A system role (owner, manager, staff) or a custom role's key.",
                    "type": "string"
                  }
                },
                "required": [
                  "role"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Superuser"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The operator, with their new role and the rights it carries."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Change what an operator may do",
        "tags": [
          "admin:superusers"
        ]
      }
    },
    "/api/v1/admin/tax-classes": {
      "get": {
        "description": "Needs taxes.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/TaxClass"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The classes, by code."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List tax classes",
        "tags": [
          "admin:settings"
        ]
      },
      "post": {
        "description": "Needs taxes.write. The code is lower-cased and unique in the tenant. Audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxClass"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The class."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a tax class",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/tax-rates": {
      "get": {
        "description": "The order they come back in is the order they are applied in, so a reader can see which rule wins without reproducing the resolution.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/TaxRate"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Rates."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List tax rates, most specific first",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "One rule per country, state and category. A second rule covering the same three is refused: that is a mistake to catch at entry, not a preference to resolve at checkout.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The created rate."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Create a tax rate",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/tax-rates/{id}": {
      "delete": {
        "description": "Orders keep what they were charged.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a tax rate",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rate."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Get a tax rate",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Changing a rate affects what is charged from now on and nothing already sold. What each order was charged is stored on its lines, so an invoice prints the same figures next year as it does today.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated rate."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a tax rate",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/tax-rates/{id}/history": {
      "get": {
        "description": "rate_bp in basis points on both sides — what makes \"who raised VAT, and when\" answerable. A record with no rows answers 200 with an empty array rather than 404: the log knowing nothing about a record is not the record being absent, and everything that existed before this table did has an honestly empty history.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEntry"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "This record’s history, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A tax rate’s history",
        "tags": [
          "admin:audit"
        ]
      }
    },
    "/api/v1/admin/taxonomy-attributes": {
      "get": {
        "description": "The store-wide field dictionary: a handle, what the field is called, and the values it offers wherever a category asks for it. Ordered by handle, because a dictionary's order is its spelling.",
        "parameters": [
          {
            "description": "Matches a handle or a label, case-folded.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/TaxonomyAttribute"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of the dictionary."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "List the attribute dictionary",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "The handle is supplied rather than derived from the label: it is the key a category's metadata names, so deriving it would make renaming a label orphan every category using the field. It is folded to lower case and may carry neither whitespace nor a slash. Choices keep the order sent — \"XS, S, M, L, XL\" is the publisher's order and the only useful one — with blanks and exact repeats dropped.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxonomyAttributeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxonomyAttribute"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One dictionary entry."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a field to the dictionary",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/taxonomy-attributes/{handle}": {
      "delete": {
        "description": "Never refused. A category that still names the handle keeps the field and simply offers no fixed choices, which is a free-text field rather than a broken one.",
        "parameters": [
          {
            "description": "The key a category's metadata names, e.g. `animal-type`. Folded to lower case, because the match against a category's metadata is literal and the column is the primary key.",
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "It is gone."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove one dictionary entry",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "The key a category's metadata names, e.g. `animal-type`. Folded to lower case, because the match against a category's metadata is literal and the column is the primary key.",
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxonomyAttribute"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One dictionary entry."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Read one dictionary entry",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Label and choices only. The handle is not patchable and sending it is a 400 rather than a silent no-op: it is the key every category's metadata holds, and renaming it here would detach them all without saying so. Moving a field to a new handle is a create, an edit of the categories that name it, and a delete. A sent `choices` array replaces the whole list.",
        "parameters": [
          {
            "description": "The key a category's metadata names, e.g. `animal-type`. Folded to lower case, because the match against a category's metadata is literal and the column is the primary key.",
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "choices": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxonomyAttribute"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One dictionary entry."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Edit one dictionary entry",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/theme": {
      "get": {
        "description": "Live version, draft, history, the font allow-list and colour tokens. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeState"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The theme."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The theme",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/activate": {
      "post": {
        "description": "Points the theme draft (started from the live settings if there is none) at a package version; it goes live with the next publish. A package that is not installed is 404; one incompatible with this engine is 409. Needs theme.write; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "version": {
                    "description": "Defaults to the newest installed version.",
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The theme draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Choose the theme package",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/demo-imports": {
      "get": {
        "description": "Every time a theme's sample content was added to this store (\"Bu temayı kullan\" with import_sample), newest first, with what it created by kind and whether it was removed. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "imports": {
                          "items": {
                            "$ref": "#/components/schemas/DemoImport"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The imports."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's sample-content imports",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "Adds a gallery theme's sample content to this store without touching the theme (\"Örnek ürünleri göster (gizli taslak olarak)\"): categories, collections, products with their pictures, size guides, pages and articles. Products arrive hidden (drafts) and pages as drafts; nothing is visible to shoppers until the merchant publishes them (POST …/{id}/publish). Audited theme.demo_import. Needs theme.write, catalog.write and content.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "theme_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "theme_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DemoImport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a theme's sample content",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/demo-imports/{id}": {
      "delete": {
        "description": "Deletes every record the import created and nothing else, newest first: products (one that has been ordered is archived instead, so its orders keep their lines), collections, categories, size guides, pages and articles, and the pictures it added unless the store now uses them elsewhere. Removing twice is harmless. Audited theme.demo_remove. Needs theme.write, catalog.write and content.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DemoImport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import, with removed_at."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove sample content",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/demo-imports/{id}/publish": {
      "post": {
        "description": "A merchant's sample products arrive hidden (drafts): no storefront listing, search, sitemap, feed or checkout shows them, and the sample categories and collections stay out of sight with them. This puts the import's still-hidden products on sale (draft → active); a product the merchant has since archived or published is left as it is. Audited theme.demo_publish. Needs theme.write, catalog.write and content.write. A removed import is 409.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DemoImport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The import, hidden_products 0."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Publish sample products",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/doctor": {
      "post": {
        "description": "The server's half of the design checker (ADR-0101). The customizer's preview checks the store's pages as they are drawn; it sends here the store paths a page links to (at most 400, with or without the language: /tr/urun/kahve, /products/kahve) and learns which lead nowhere — a product (active), collection, category, page or article (published) that does not exist, or a path no route serves and no redirect rule catches. The answer also carries the theme's own sample texts (its templates', section groups' and demo pack's phrases of four words or more), so the panel can tell words a merchant has not replaced yet. Writes nothing. Needs theme.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeDoctorInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeDoctorResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The answers."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Tasarım Doktoru: which links lead nowhere, and the theme's sample texts",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/draft": {
      "put": {
        "description": "Validated (colours #rrggbb, fonts from the allow-list, logo from the media library, safe menu links). Needs theme.write; audited.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "settings": {
                    "$ref": "#/components/schemas/ThemeSettings"
                  }
                },
                "required": [
                  "settings"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor": {
      "get": {
        "description": "Everything the customizer (ADR-0064) opens with: the draft — or the live theme while there is no draft (revision 0) — as global setting values by id and every template and section group as the storefront would render them; the package's settings schema and the schemas of every section the editor may show or add; template and group names; the fonts; the live version; the areas changed since the last publish. ETag is the revision. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeEditor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The customizer's state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Open the theme customizer",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/checkpoints": {
      "post": {
        "description": "Records a save point of the whole draft for an area ('' the whole draft, settings, settings:\u003cgroup\u003e, template:\u003cname\u003e[/\u003csection\u003e], group:\u003ctype\u003e[/\u003csection\u003e]) — the customizer's \"Kaydet\" under an area — or a named one. \"Geri al\" under an area returns to the newest save point that holds it. At most 50 per draft. Needs theme.write.",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeCheckpointInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeCheckpoint"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The save point."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a save point of the draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/draft": {
      "patch": {
        "description": "Applies operations to the draft (starting one from the live theme when there is none): set_setting {id, value} (null: the theme's default), set_template / set_group {name, sections}, reset_template / reset_group {name} (the theme's own again). The whole result is validated against the package — settings against its schema and manifest, sections against the registry (types, placement, limits, fields, blocks) — and nothing is written unless every operation is valid; an error's details name the op, area, section_id, block_id and field. The revision the change was made on goes in the body or If-Match; a stale one is refused with 409. Not audited one by one (the revision and the save points are the record). Needs theme.write.",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeEditorPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeEditorSaved"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft after the change; ETag is its revision."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save changes to the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/free-design": {
      "get": {
        "description": "The theme draft's design of a theme area (header, footer, product, collection, search, cart, blog, article, notfound) in a language — else the live theme's — with the draft's revision (also the ETag), the languages the area has a design in, and whether this one is live as it is (ADR-0104). entry is null when the area has none: the storefront draws the theme's own layout there. Needs theme.read.",
        "parameters": [
          {
            "in": "query",
            "name": "area",
            "required": true,
            "schema": {
              "enum": [
                "header",
                "footer",
                "product",
                "collection",
                "search",
                "cart",
                "blog",
                "article",
                "notfound"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeFreeDesignRead"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The design."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Serbest Tasarım: one theme area's design in a language",
        "tags": [
          "admin:content"
        ]
      },
      "put": {
        "description": "The draft op set_free_design as one save (ADR-0104): the design is checked like a page's (sanitized markup, CSS scoped to the area, the editor's project rewritten from an allow-list, every live component of a known type naming this store's products, collections, menus and blog — else 400 with details.reason) and stored in the theme draft (started from the live theme when there is none), on the revision named in the body or If-Match (409 stale_revision otherwise). design null removes the area's design in the language (the theme's own layout again; always allowed). With vb_free_design off a new or changed design is refused (feature_off). Every theme design together is at most 4 MiB. Answers the design as stored and the new revision (also the ETag). Audited as a theme draft save. Needs theme.write.",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeFreeDesignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeFreeDesignRead"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The design as stored."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Serbest Tasarım: save one theme area's design in a language into the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/history": {
      "get": {
        "description": "The draft's save points, newest first, and the last 30 published versions. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeHistory"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The history."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The theme's version history",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/presence": {
      "post": {
        "description": "An editor window's heartbeat (every 30 s; the lock is free after two minutes without one). Advisory: saves are guarded by the draft revision, never refused for the lock. Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeEditorPresenceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeEditorPresence"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Who holds the lock."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Claim, keep, take over or leave the editing lock",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/preview-token": {
      "post": {
        "description": "A preview token for the customizer's frame: the theme draft (settings, templates, groups) over the published pages. Needs theme.read.",
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPreviewToken"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The token."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A preview link for the customizer",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/publish": {
      "post": {
        "description": "Makes the draft live — its settings, templates and groups (written to the theme instance) and the store's menus and identity — when it is the revision named; a newer draft is refused with 409. Audited (theme.publish), event theme.published. Needs theme.publish.",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeEditorPublishInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The published version."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Publish the theme draft the customizer shows",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/restore": {
      "post": {
        "description": "Takes an area (or everything) from a save point of the draft or from a published version of the same theme into the draft — never straight to the live theme. The draft as it was is kept as an automatic save point first. The store's own menus and identity are never touched. Audited (theme.restore). Needs theme.write. Since ADR-0102 a save point of any draft of the store (a named one of an earlier draft included) may be restored, and a whole version or save point of another theme brings that theme back into the draft (theme_changed); an area of another theme is refused with 409. The answer names the save point kept first (undo_checkpoint_id).",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeRestoreInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeEditorSaved"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft after the restore."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Restore the draft from a save point or a published version",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/revert": {
      "post": {
        "description": "Returns an area of the draft to its newest save point that holds it, or to the live theme when it has none (\"Bu bölümdeki değişiklikleri geri al\"). The draft as it was is kept as an automatic save point first. Audited (theme.revert). Needs theme.write.",
        "parameters": [
          {
            "description": "The draft revision the change was made on (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeRevertInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeEditorSaved"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft after the undo."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Undo an area's unsaved changes",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/saved-sections": {
      "get": {
        "description": "Sections saved for reuse (ADR-0068), newest first; each says whether the theme being edited has its type. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedSection"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved sections."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's saved sections",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "Keeps a configured section (settings and blocks) under a name, checked against the theme being edited. At most 100 per store; a name is used once (any case). Audited (theme.section_save). Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedSectionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedSection"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved section."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Save a section for reuse",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/saved-sections/{id}": {
      "delete": {
        "description": "Sections already put in a template stay (they are copies). Audited (theme.section_delete). Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a saved section",
        "tags": [
          "admin:content"
        ]
      },
      "patch": {
        "description": "Audited (theme.section_rename). Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedSectionRename"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SavedSection"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved section."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Rename a saved section",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/schedule": {
      "delete": {
        "description": "Audited (theme.unschedule). Needs theme.publish.",
        "responses": {
          "204": {
            "description": "Cancelled."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Cancel the scheduled publish",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "The draft at the named revision goes live at publish_at, by a job (theme.publish_scheduled); if the draft changed after scheduling, nothing goes live and the schedule is marked stale. A pending schedule is replaced. Audited (theme.schedule). Needs theme.publish.",
        "parameters": [
          {
            "description": "The draft revision (\"7\"), instead of `revision` in the body.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeScheduleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeSchedule"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The schedule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Schedule the draft's publish",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/timeline": {
      "get": {
        "description": "The Zaman Makinesi (ADR-0102): a page of the theme's history, newest first — every published version (who, when, its name, the areas it changed from the version before it, whether it is live) and, on the first page, every save point of the draft and the named save points of drafts published since (why an automatic one was taken). Each entry carries the material of its small picture: its colours, its two faces and the home page's sections, read from the version itself (nothing is drawn at publish time). `before` (a version number) reads the older versions. Needs theme.read.",
        "parameters": [
          {
            "description": "Only versions older than this version number (the next page).",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeTimeline"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page of the history."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The theme's history: published versions and save points",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/timeline/preview-token": {
      "post": {
        "description": "\"Bu hâlini göster\" (ADR-0102): a link (an hour) that draws the store with that published version's or save point's theme over the published pages, read through the storefront's preview like the customizer's own. Writes nothing but the link. Needs theme.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistoryPreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPreviewToken"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A preview link of a version or save point",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/editor/versions/{id}": {
      "patch": {
        "description": "Gives a published version a name in the history (\"\" takes it away); its content stays as it was published (ADR-0102). Audited. Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeVersionNameInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Named."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Name a published theme version",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/gallery": {
      "get": {
        "description": "Every installed theme package, the default first: its preset's tagline, vertical, settings (for the preview card) and home page section types, whether it is compatible, live (active) or the theme draft's (draft). Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "engine_version": {
                          "type": "string"
                        },
                        "themes": {
                          "items": {
                            "$ref": "#/components/schemas/ThemeGalleryEntry"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The gallery."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The Temalar gallery",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/gallery/{id}/apply": {
      "post": {
        "description": "\"Bu temayı kullan\": writes the theme draft (the package, the preset's settings with what the choice keeps) and, with content.write, a home page draft in each language the store serves — mapped (the store's sections laid into the preset's, the rest kept after them), replaced, or left alone. A language whose home page is in review or approved is skipped. Nothing is published. Needs theme.write; audited (theme.apply_preset). An unpublished theme draft (or, with home \"replace\", a home page draft) is replaced only with overwrite_drafts; otherwise 409. Every home page document is built and validated before anything is written.",
        "parameters": [
          {
            "description": "The theme package id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeApplyInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeApplyResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The drafts."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start a theme draft from a gallery theme",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/gallery/{id}/preview": {
      "post": {
        "description": "A one-hour preview token. A theme that ships a demo pack (ADR-0072) is previewed on its own demo store, prepared on first use: the answer says demo: true and the storefront opens it with ?demo=\u003ctoken\u003e (GET /theme/demo resolves the store), so the gallery shows the theme's own catalogue and pages, never the store's products. Otherwise the storefront accepts it as ?preview=: the theme reads as the preset merged with what the choice keeps, and the home page as applying the choice would make it. Nothing of the store is written. A package without a preset is 409. Needs theme.read.",
        "parameters": [
          {
            "description": "The theme package id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeApplyInput"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContentPreviewToken"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The token."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Preview a gallery theme",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/identity": {
      "get": {
        "description": "Ayarlar › Mağaza › Logo ve simgeler: the pictures the storefront shows now (the published theme's, empty when no theme is published), each with its media library id, alt text and current address. Right: theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeIdentity"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The pictures."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The live theme's logo, favicon and share picture",
        "tags": [
          "admin:content"
        ]
      },
      "patch": {
        "description": "Changes only the pictures named (a field left out keeps its value; `logo` with `media_id: null`, or `favicon` / `share_image` null, removes the picture). It goes live at once as a new theme version: the live version with the store's own menus and identity as they are, plus the new pictures (theme.published follows as for any publish). An open theme editor draft takes the same pictures and nothing else, so every other unpublished change in it stays unpublished; its revision moves, so an editor open elsewhere reloads before its next save. Each picture must be an image of the store's media library. Audited (theme.publish, from: identity, with the fields changed). Right: theme.publish.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeIdentityInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeIdentity"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The pictures now live."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Put a new logo, favicon or share picture live",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/instances": {
      "get": {
        "description": "One theme instance per theme the store has published (ADR-0061): its settings as last published, template and group overrides; the live one first. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "instances": {
                          "items": {
                            "$ref": "#/components/schemas/ThemeInstance"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The library."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's theme library",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/looks/brand-icons": {
      "post": {
        "description": "Makes a 512 × 512 PNG favicon (the logo's mark, square, with room round it; a cut-out logo stays see-through) and a 1200 × 630 PNG share card (the logo on the look's ground with a band of its main colour) and adds both to the media library (the same picture is not stored twice). The answer is what the customizer's identity part stores as favicon and share_image; nothing is applied here. Needs media.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookIconsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LookIcons"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pictures."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A favicon and a share card from a logo",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/looks/brand-kit": {
      "post": {
        "description": "Logodan Marka Kiti (ADR-0100): reads a PNG, JPEG or GIF logo from the store's media library (at most 16 megapixels; nothing leaves the server), finds its main colours (a plain ground round the mark is left out) and builds three looks on them — the brand colour on white, on cream, and the second colour (or cool greys) — with the same guarantees and preview links as the dice. Fonts, corners and spacing are left as they are. Writes nothing but the preview links. Needs theme.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookBrandKitInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LookBrandKit"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The colours and looks."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A logo's colours and three looks built on them",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/looks/deal": {
      "post": {
        "description": "Stil Zarı (ADR-0100): up to six finished looks for the theme being edited (the draft, else the live theme) — colours re-tinted from the theme's own palette, a curated font pair, the type scale, corners and buttons, spacing — every one checked before it is offered (WCAG 2.x 4.5:1 for text and button text, 3:1 for buttons and marks, the theme's schemes told apart, only values the theme's schema allows). Each comes with the values and parts the customizer applies as one draft change, and a preview link (an hour) that shows the store's own home page in the look without writing anything. The same seed and round deal the same looks; the first round starts with the theme's own look. `lock` keeps the store's main colour now (or `brand`) on every look. Writes nothing but the preview links. Needs theme.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookDealInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LookDeal"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The roll."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Roll the dice: ready looks for the theme being edited",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/packages": {
      "get": {
        "description": "Installed theme packages with their manifests, whether each works with this engine (and why not) and which one the live theme uses. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "engine_version": {
                          "type": "string"
                        },
                        "packages": {
                          "items": {
                            "$ref": "#/components/schemas/ThemePackage"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The packages."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Theme packages",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/packages/{id}/{version}": {
      "get": {
        "description": "A theme package as the editor reads it (theme engine 2.0.0, ADR-0061): format (2.0, or 1.1 through the adapter), manifest, settings schema, style variations, templates, groups, its own sections, the engine's template sections and its strings. Needs theme.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemePackageDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The package."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "One installed theme package",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/publish": {
      "post": {
        "description": "No review step (owner decision). Emits theme.published. Needs theme.publish; audited.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The published version."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Publish the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/share-links": {
      "get": {
        "description": "Arkadaşına Göster (ADR-0102): the store's open share links, newest first — their names, who made them, until when they open and how often they were opened. Never their secrets. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ShareLink"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The links."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The open share links of the theme draft",
        "tags": [
          "admin:content"
        ]
      },
      "post": {
        "description": "A link that shows the theme draft over the published pages to whoever holds it, read only and without a login, for 1–14 days (7 when not said), until it is closed: the storefront marks every page \"Taslak önizleme\", never caches or indexes it, and the link opens nothing else (no page working copy, no saved template, no admin route). Its secret is answered only now (only its hash is kept). At most 20 open at once (409, details.reason share_limit); 403 with details.reason feature_off without vb_fearless. Audited. Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareLinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShareLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link, with its secret."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Make a share link of the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/share-links/{id}": {
      "delete": {
        "description": "The link opens nothing from now on (ADR-0102). Audited. Needs theme.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Closed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Close a share link",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/tell-us": {
      "get": {
        "description": "Mağazanı Anlat (ADR-0103): what the setup wizard's design step opens with — the sectors (each with its card picture, a path on the storefront), the four moods (their typical faces, colours and corners), the curated brand colours, the store's name, the answers given last time and where the step stands (new, open, skipped, applied). Reads only. Needs theme.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TellUs"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards and the step's state."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The design step of the setup (Mağazanı Anlat)",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/tell-us/apply": {
      "post": {
        "description": "Mağazanı Anlat (ADR-0103): rebuilds the proposal named by the answers, seed, round and index and writes it into the theme draft — the theme, its settings, templates and groups — after an automatic save point of the theme as it was (Zaman Makinesi, reason \"proposal\"). Products, pages, menus, the store's identity and the live theme are never touched; nothing is live until the draft is published. The same proposal again changes nothing (unchanged). Audited (theme.tell_us_apply). Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TellUsApplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TellUsApplyResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Apply a proposal to the theme draft",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/tell-us/logo-colors": {
      "post": {
        "description": "Mağazanı Anlat (ADR-0103): reads a PNG, JPEG or GIF logo of the media library (at most 16 megapixels) and answers its main colour and the others, as the brand kit reads them (ADR-0100). Writes nothing. Needs theme.read.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TellUsLogoInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TellUsLogoColors"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The logo's colours."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A logo's colours for the colour card",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/tell-us/proposals": {
      "post": {
        "description": "Mağazanı Anlat (ADR-0103): three proposals built from the answers — the sector's own theme and two that share the mood, each in a look of the Stil Zarı engine (the brand colour on the main colour; every contrast guarantee of ADR-0100), the logo in the header, and a home page from the theme's own sections with the store's name, one plain sentence of what it sells, the merchant's photos (focal point at the subject) or the sector's sample photos, and the store's own products and reviews — never a sample store's words. The same answers, seed and round give the same proposals; the next round others. Each comes with a preview link (an hour) that draws the store's home page as the proposal would make it, over the published pages. Keeps the answers (for the theme page's \"Mağazanı anlat, yeniden öner\"); writes nothing else. Needs theme.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TellUsDealInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TellUsDeal"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The round."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Three finished home pages from the answers",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/tell-us/skip": {
      "post": {
        "description": "Mağazanı Anlat (ADR-0103): the setup wizard does not offer the design step again (the theme page still does). A store that applied a proposal stays applied. Needs theme.write.",
        "responses": {
          "204": {
            "description": "Skipped."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Skip the design step",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/theme/versions/{id}/rollback": {
      "post": {
        "description": "Publishes a copy of an earlier published theme as a new version. Needs theme.publish; audited.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeVersion"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The published version."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Restore an earlier theme",
        "tags": [
          "admin:content"
        ]
      }
    },
    "/api/v1/admin/translation-glossary": {
      "get": {
        "description": "Needs catalog.read. Protected terms, preferred translations and forbidden translations, reported to translators as warnings. Nothing calls a translation service.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GlossaryRule"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's translation glossary",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Needs catalog.write. Audited (`translation_glossary.create`). The same rule twice is 409.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlossaryRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GlossaryRule"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Add a glossary rule",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translation-glossary/check": {
      "post": {
        "description": "Needs catalog.read. Which of the store's rules a translation into `language` breaks, field by field — the admin translation form asks while the operator types. Writes nothing.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlossaryCheckInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GlossaryWarning"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The warnings (empty when none)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Check text against the glossary",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translation-glossary/{id}": {
      "delete": {
        "description": "Needs catalog.write. Audited (`translation_glossary.delete`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove a glossary rule",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Needs catalog.write. Audited (`translation_glossary.update`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlossaryRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GlossaryRule"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rule."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Replace a glossary rule",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translations/auto": {
      "get": {
        "description": "Needs catalog.read. The installed machine translation providers (DeepL; an AI provider when one is installed), the one a run uses now (empty when none is set up), and each language's latest run.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationAutoStatus"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Machine translation: providers and runs",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Needs catalog.write (collections and categories also need their own write rights; without them a run leaves them out). Queues a background run that machine-translates the language's missing products (with options and rich descriptions), collections and categories through the configured provider, the glossary respected: records with nothing stored get a machine translation; machine translations get their empty fields; records a person started are skipped. The translations are drafts in the review queue unless publish is true, which moves each through review to published at once, audited. 409 when no provider is set up (details.reason translator_not_configured) or a run of the language is under way.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranslationAutoInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationAutoRun"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The run, queued."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Translate what a language is missing",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translations/export": {
      "get": {
        "description": "Needs catalog.read. Streams one row per record, language and field: entity, id, handle (the base slug), language, field (title, subtitle — products —, description, seo_title, seo_description, slug), source_text (the default language's text), translation, status, source. Archived products are left out. Upload the edited file as an import job with kind=translations. Option and variant labels are not in the file.",
        "parameters": [
          {
            "description": "Comma-separated languages; omitted: every non-default store language.",
            "in": "query",
            "name": "language",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "enum": [
                "product",
                "collection",
                "category"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The CSV file."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Export translations as CSV",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translations/missing": {
      "get": {
        "description": "Needs catalog.read. The records of one kind lacking a complete translation in a language — products (not archived), collections, categories — or, for pages and blog posts, published in the default language and not in this one; by title. For translating by hand.",
        "parameters": [
          {
            "description": "Omitted: the store's first language after the default.",
            "in": "query",
            "name": "language",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Omitted: product.",
            "in": "query",
            "name": "entity",
            "schema": {
              "enum": [
                "product",
                "collection",
                "category",
                "page",
                "article"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/TranslationGap"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The records."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Records missing a translation",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translations/review": {
      "get": {
        "description": "Needs catalog.read. Stored translations of products, collections and categories, newest change first; by default every one not published yet.",
        "parameters": [
          {
            "description": "One state, or all; omitted: everything not published.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "draft",
                "reviewed",
                "approved",
                "published",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "language",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entity",
            "schema": {
              "enum": [
                "product",
                "collection",
                "category"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/TranslationReviewItem"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The queue."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The translation review queue",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/translations/summary": {
      "get": {
        "description": "Per non-default store language: products (not archived), collections and categories lacking a complete translation.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranslationSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The counts."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Count records missing a translation",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/turnstile": {
      "get": {
        "description": "Ayarlar › Spam koruması (ADR-0096). The store's own site key and whether a secret is kept (never the secret); `active`: what guards the forms on the host the admin is on (`store`, `platform` or `none`); `platform_covered`: the platform's keys guard the store's NeroCart address; `own_hosts`: the store's hosts outside NeroCart's domain, where its own keys apply. Right: store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TurnstileSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's spam protection (Cloudflare Turnstile keys)",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "A site key with a secret (an empty secret keeps the stored one; a new site key without a stored secret needs one); both empty removes the keys. The secret is sealed (ADR-0042) and never returned. `token` is ignored here. Audited (store.settings_update, label turnstile). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TurnstileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TurnstileSettings"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set or remove the store's Cloudflare Turnstile keys",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/turnstile/test": {
      "post": {
        "description": "Asks Cloudflare's siteverify about the typed secret (else the stored one): with `token` (the widget's answer, rendered with the typed site key) the pair, `checked: widget`; without, the secret alone with Cloudflare's dummy token, `checked: secret`. Saves nothing. Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TurnstileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TurnstileCheck"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Cloudflare's verdict."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Check Cloudflare Turnstile keys with Cloudflare",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/variants/{id}": {
      "delete": {
        "description": "A product must keep at least one variant: a product with nothing sellable is not a product.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Delete a variant",
        "tags": [
          "admin:catalog"
        ]
      },
      "patch": {
        "description": "Stock is deliberately not patchable here. Inventory moves through its own endpoint so that every change is a transactional adjustment rather than a blind overwrite of a number another request may have just changed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean"
                  },
                  "barcode": {
                    "type": "string"
                  },
                  "compare_at_price_minor": {
                    "description": "The price a storefront strikes through. Send null to take the item off sale; omit the field to leave it alone. Negative is a 400.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "continue_selling": {
                    "description": "Take the order when the count has run out, instead of refusing it.",
                    "type": "boolean"
                  },
                  "cost_minor": {
                    "description": "Send null to clear a recorded cost.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "dimension_unit": {
                    "description": "The unit the sides in `size` are given in, and the unit they are read back in. Sending this alone re-reads the sides already stored in the new unit: the millimetres are the fact, and switching units changes how the box is read, not how big it is. A patch that wants exact millimetres names \"mm\" here — there is one way to give a side rather than two that can disagree.",
                    "enum": [
                      "mm",
                      "cm",
                      "m",
                      "in"
                    ],
                    "type": "string"
                  },
                  "hs_code": {
                    "description": "Tariff number, 6 to 12 digits (12: Türkiye's GTİP).",
                    "type": "string"
                  },
                  "manufacturer_code": {
                    "description": "The maker's own code (model, part or product number); empty clears it.",
                    "maxLength": 100,
                    "type": "string"
                  },
                  "metadata": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "origin_country": {
                    "description": "Where the item was made, ISO 3166-1 alpha-2.",
                    "type": "string"
                  },
                  "position": {
                    "type": "integer"
                  },
                  "preorder": {
                    "$ref": "#/components/schemas/PreorderInput"
                  },
                  "price_minor": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "quantity_rule": {
                    "$ref": "#/components/schemas/QuantityRule"
                  },
                  "requires_shipping": {
                    "description": "Whether the variant is sent as a parcel; false for software, downloads and services (ADR-0045).",
                    "type": "boolean"
                  },
                  "size": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/DimensionPatch"
                      }
                    ],
                    "description": "Only the sides named are written, so changing the height does not erase a length somebody measured earlier."
                  },
                  "sku": {
                    "type": "string"
                  },
                  "taxable": {
                    "type": "boolean"
                  },
                  "track_inventory": {
                    "type": "boolean"
                  },
                  "unit_pricing": {
                    "$ref": "#/components/schemas/UnitPricingInput"
                  },
                  "weight_grams": {
                    "type": "integer"
                  },
                  "withdrawal_exception": {
                    "description": "Sets the variant's own exception (Product.withdrawal_exception's values); \"\" or \"inherit\" goes back to the product's. A variant sold from a licence-key pool refuses requires_shipping true, track_inventory false, continue_selling true and pre-order (409).",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Update a variant",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/hidden-stock": {
      "get": {
        "description": "The variant's hidden count (gizli stok, ADR-0142) and its latest 50 ledger lines, newest first. Hidden stock is the owner's own count beside the regular stock: panel only — no storefront route, feed or checkout reads it — and it never limits a sale. Needs inventory.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HiddenStock"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The count and its movements."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A variant's hidden stock",
        "tags": [
          "admin:catalog"
        ]
      },
      "post": {
        "description": "Exactly one of `adjust` (a move, + or −) and `set` (a count of the shelf), with an optional reason; a ledger line records who, when, how much and why. The count never goes below zero (409 `hidden_stock_short`). The regular stock is not touched. Needs inventory.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HiddenStockInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HiddenStock"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The count as it is now."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move or count a variant's hidden stock",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/inventory": {
      "post": {
        "description": "Send `adjust` to move the count by a delta (receiving stock), or `set` to replace it (a stock take). Neither may leave on-hand below the quantity already reserved at that location for orders in flight.\n\n`location_id` says which shelf; omit it for the default one, which is what a single-location store always means.\n\nRefused with 409 when the receiving location is closed: stock moves out of a closed location, never into it. Every decrease is still allowed, including at a closed one, because emptying a closed shelf is the only way it is ever cleared.\n\n`incoming` records stock on its way to the location; it is information only and never sellable.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "adjust": {
                    "example": 25,
                    "type": "integer"
                  },
                  "incoming": {
                    "description": "Units on their way to this location; replaces the figure. Alone, or beside `adjust`/`set` (applied after the count). Moves no stock.",
                    "example": 40,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "location_id": {
                    "description": "Omit for the default location.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "reason": {
                    "description": "Optional. Why the stock moved, recorded verbatim in the stock ledger — a delivery, a damage write-off, a recount. The panel asks for one on a count and on a write-off; the engine accepts a blank from any client.",
                    "maxLength": 200,
                    "type": "string"
                  },
                  "reason_code": {
                    "description": "Coded reason, recorded beside the words (reason) in the stock ledger.",
                    "enum": [
                      "counted",
                      "received",
                      "damaged",
                      "lost",
                      "returned",
                      "correction",
                      "other"
                    ],
                    "type": "string"
                  },
                  "set": {
                    "example": 100,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move stock",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/licence-key-pool": {
      "delete": {
        "description": "Only a pool that never held a code may go (409 otherwise: remove its unused codes instead). Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "The pool is gone."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stop selling a variant as codes",
        "tags": [
          "admin:catalog"
        ]
      },
      "get": {
        "description": "The pool's settings and its codes counted by state (ADR-0088 §2). 404 when the variant is not sold as codes. Needs catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicenceKeyPool"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pool."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A variant's licence-key pool",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Creating a pool makes the variant a code product: tracked, never sold past its codes, never a parcel (requires_shipping false); its stock becomes its unused codes — units on its shelves are written off (a stock take to zero, in the ledger). Refused (409) for a variant with units promised to open orders, on pre-order, or sold from a supplier's offer. On an existing pool, only the fields given change. Audited as licence_key.pool_update. Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenceKeyPoolInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicenceKeyPool"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pool."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Start or change a variant's licence-key pool",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/licence-keys": {
      "get": {
        "description": "Newest first. Each code is masked (its last characters only); reading one in the clear is POST /api/admin/licence-keys/{id}/reveal, audited. Needs catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "available",
                "assigned",
                "burned",
                "removed",
                "expired"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/LicenceKey"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of codes."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A variant's codes, masked",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/licence-keys/import": {
      "post": {
        "description": "Pasted text (one code per line), a CSV with a `code` column (and optionally `expires_at`, `note`), or structured rows; at most 10 000 per import. Each code is sealed at rest with the secrets keyring (409 when the server has none), de-duplicated by its keyed fingerprint against every code the store ever held, and becomes one unit on the pool's shelf (stock ledger kind import). A row that cannot be read is listed in problems; the rest import. dry_run counts and writes nothing. The answer never repeats a code. Audited as licence_key.import (counts only). Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LicenceKeyImportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicenceKeyImportResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the import did."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Import codes into a variant's pool",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/licence-keys/remove": {
      "post": {
        "description": "Each named code must be unused (409 otherwise); its unit leaves the shelf, never below what is promised to orders awaiting payment (409). Audited as licence_key.remove. Needs catalog.write.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "reason": {
                    "maxLength": 300,
                    "type": "string"
                  }
                },
                "required": [
                  "ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LicenceKeyPool"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pool."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Remove unused codes from a variant's pool",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/media": {
      "put": {
        "description": "Replaces the list of the product's pictures this variant shows, in the order given. Every id in `media_ids` must already be on the variant's product — a variant nominates some of the product's pictures rather than owning files, which is what lets every size of a colour show the same photographs stored once, and attaching from here would put a picture at a position in the product's ordered list that nobody chose. Send `[]` to clear. `media_id` is the shape from before there was a list — one picture, or `null` to clear — and still works. One of the two is required: an omitted field is a 400 rather than a guess, because guessing is how pictures get removed by a request that never mentioned them.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "One of the two fields is required.",
                "properties": {
                  "media_id": {
                    "description": "One picture, or null to clear — the shape from before the list. Ignored when `media_ids` is present.",
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "media_ids": {
                    "description": "The pictures, in display order; `[]` clears. Each must already be on the variant's product.",
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant, with the pictures the store now holds."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set or clear a variant's pictures",
        "tags": [
          "admin:media"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/movements": {
      "get": {
        "description": "The append-only stock ledger for one variant, newest first. One row per real change, carrying two signed deltas, the balances after, what kind of movement it was, which path caused it, the operator's reason and the order behind it. Ordered by id rather than by created_at: a transfer writes both of its rows in one transaction and they share the instant exactly. Behind inventory.read, because reading how a count got there is reading stock.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "description": "Narrow to one shelf.",
            "in": "query",
            "name": "location_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Only what one order caused.",
            "in": "query",
            "name": "order_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "One or more movement kinds, comma-separated or repeated. An unknown kind is a 400 rather than an empty page.",
            "in": "query",
            "name": "kind",
            "schema": {
              "enum": [
                "opening",
                "adjust",
                "stock_take",
                "import",
                "transfer_out",
                "transfer_in",
                "reserve",
                "commit",
                "release",
                "restock",
                "sell"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only movements with these coded reasons (comma-separated or repeated).",
            "in": "query",
            "name": "reason_code",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StockMovement"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Movements, newest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "How a variant's stock got here",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/offers": {
      "get": {
        "description": "Cheapest first, paused offers included — an operator’s screen needs to see those too.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Offer"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Who sells this variant",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/prices": {
      "get": {
        "description": "What the store charges for the variant in each currency other than its base currency (the base-currency price is the variant's own `price`). A market in a currency with no price here does not offer the variant. Needs catalog.read.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/VariantPrice"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The prices, by currency."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "A variant's prices in other currencies",
        "tags": [
          "admin:catalog"
        ]
      },
      "put": {
        "description": "Creates or replaces the price in `currency`. The base currency is refused (set the variant's own price). Needs catalog.write. Audited against the product.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantPriceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/VariantPrice"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Every price of the variant after the change."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a variant's price in a currency",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/prices/{currency}": {
      "delete": {
        "description": "Needs catalog.write. Audited against the product.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "ISO 4217 code.",
            "in": "path",
            "name": "currency",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z]{3}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Stop selling a variant in a currency",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/sale": {
      "put": {
        "description": "A sale without a window is written at once (price = sale, compare-at = regular); with one it waits for its start and ends at its end, the variant then back at its regular price (the sale job, every minute). No sale price ends any sale. The sale price is below the regular one; the end is after the start and ahead of now. Right: catalog.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VariantSaleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VariantSale"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The variant's sale as saved."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set a variant's regular price, sale price and window",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/stock": {
      "get": {
        "description": "The variant's own `stock_on_hand` and `stock_reserved` are the sums of these rows. This is the breakdown a picker, a stock take or a delivery estimate actually needs.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/VariantStock"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One row per location."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Where a variant's stock is",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/variants/{id}/stock/transfer": {
      "post": {
        "description": "One statement out and one in, in a single transaction, so the store's total never changes even for an instant. Reserved units do not travel: they are promised to orders that will be picked from where they are, and moving them would send a picker to the wrong shelf.\n\nRefused with 409 when `to_location_id` is closed: stock moves out of a closed location, never into it. The **source** may be closed, and always could be — that is the recovery path for a store that already has units stranded at one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "from_location_id": {
                    "description": "Required. There is no default shelf to take units off, and guessing would empty one the operator never named.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "quantity": {
                    "example": 10,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "reason": {
                    "description": "Optional. Why the units moved — rebalancing, a store request. Recorded verbatim on BOTH ends of the transfer, because the row that says they left and the row that says they arrived are one act.",
                    "maxLength": 200,
                    "type": "string"
                  },
                  "to_location_id": {
                    "description": "Omit for the default location.",
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "from_location_id",
                  "quantity"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant, with its totals unchanged."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Move stock between locations",
        "tags": [
          "admin:catalog"
        ]
      }
    },
    "/api/v1/admin/vendors": {
      "get": {
        "description": "Every seller, whatever their status. The storefront listing at /api/vendors shows approved ones only.",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Matches the name or the slug.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "suspended"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Vendor"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "List sellers",
        "tags": [
          "Vendors"
        ]
      },
      "post": {
        "description": "They arrive pending unless the body says otherwise.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vendor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Add a seller",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/vendors/{id}": {
      "delete": {
        "description": "Withdraws everything they were offering, by cascade. Suspending is the way to stop somebody selling while keeping the record.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        },
        "summary": "Remove a seller",
        "tags": [
          "Vendors"
        ]
      },
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vendor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Read a seller",
        "tags": [
          "Vendors"
        ]
      },
      "patch": {
        "description": "Approving one is a status change here, and it leaves an audit row carrying both sides.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vendor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Edit a seller",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/vendors/{id}/offers": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Offer"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "What one seller is offering",
        "tags": [
          "Vendors"
        ]
      },
      "put": {
        "description": "Creates the offer or replaces the one that is there. One row per seller per variant.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Offer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Set a seller’s price for a variant",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/vendors/{id}/offers/{variantId}": {
      "delete": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "variantId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Withdrawn"
          }
        },
        "summary": "Withdraw one offer",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/vendors/{id}/users": {
      "post": {
        "description": "Creates an operator account with the `vendor` role attached to this seller. Gated on `team.write`, not `vendors.write`: editing a seller’s commission and handing somebody access to the store are different powers.\n\nThe account and the attachment are inseparable — a database CHECK (M48) refuses the vendor role without a vendor and any other role with one, because an account with the role and no vendor is the row every scoping rule fails open on. Deleting the seller deletes their logins.\n\nThe role carries no rights by default. What a vendor may do is granted by this store on the Roles screen; what a vendor may *see* is scoped to their own rows regardless.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Superuser"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Open a login for a seller",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/admin/wholesale": {
      "get": {
        "description": "Ayarlar › Toptan satış (ADR-0091). Right: store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WholesaleSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The store's wholesale choices",
        "tags": [
          "admin:settings"
        ]
      },
      "put": {
        "description": "Replaces them. The default group must be one of the store's dealer groups. Writes store.wholesale_changed (the storefront's cache scope moves with who sees prices). Audited (store.wholesale). Right: store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WholesaleSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WholesaleSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Set the store's wholesale choices",
        "tags": [
          "admin:settings"
        ]
      }
    },
    "/api/v1/admin/x/accounting-bizimhesap/test": {
      "post": {
        "description": "Reads BizimHesap's warehouse list (GET /api/b2b/warehouses) with the saved firm id and API token, whether or not the integration is switched on yet: the cheapest authenticated call. `ok` is true when BizimHesap answered; `warehouses` is how many it listed. Nothing is written at BizimHesap or stored; the answer never carries the token. 409 when the firm id or the token is missing. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BizimHesapTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether BizimHesap accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the BizimHesap connection",
        "tags": [
          "accounting-bizimhesap"
        ]
      }
    },
    "/api/v1/admin/x/domains-dna/offer": {
      "get": {
        "description": "Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainsDnaOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Can the store buy a domain",
        "tags": [
          "domains-dna"
        ]
      }
    },
    "/api/v1/admin/x/domains-dna/purchases": {
      "get": {
        "description": "Newest first. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/DomainsDnaRequest"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The store's domain purchases",
        "tags": [
          "domains-dna"
        ]
      },
      "post": {
        "description": "Checks the name is on sale and free, records the purchase with a one-time store code and answers the platform store's page to pay on. After payment the domain is registered and connected to this store. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainsDnaPurchaseInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainsDnaPurchaseStart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Buy a domain for the store",
        "tags": [
          "domains-dna"
        ]
      }
    },
    "/api/v1/admin/x/domains-dna/search": {
      "post": {
        "description": "Availability and the price per year across the extensions NeroCart sells. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainsDnaSearchInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainsDnaSearchResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Search a domain for the store",
        "tags": [
          "domains-dna"
        ]
      }
    },
    "/api/v1/admin/x/email-smtp/autoconfig": {
      "get": {
        "description": "The store's address (or ?email=) names its domain; the domain's MX records name the mailbox provider (Google Workspace, Microsoft 365, Yandex 360, Zoho, iCloud+), whose submission server, port, security and DKIM selector are answered with the address as user name and sender, so the form asks only for the password. An unknown provider gets mail.\u003cdomain\u003e and known false. 409 when the store has no address. Right: plugins.read.",
        "parameters": [
          {
            "description": "The address to configure; the store's own when left out.",
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SMTPAutoConfig"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Automatic SMTP settings for the store's address",
        "tags": [
          "email-smtp"
        ]
      }
    },
    "/api/v1/admin/x/email-smtp/sender-domain": {
      "get": {
        "description": "Looks up, now, the DNS records of the saved sender address's domain: the SPF record (exactly one `v=spf1` TXT; warns when it ends in +all or does not include the SPF domain of a known SMTP service such as Yandex, Office 365, Gmail, Amazon SES, Brevo, Mailgun), the DMARC record on `_dmarc.\u003cdomain\u003e` (or inherited from the parent domain; p=none is a warning) and, when a DKIM selector is saved, the key on `\u003cselector\u003e._domainkey.\u003cdomain\u003e`. Answers with each record's state and the records to add or replace at the DNS provider. Advice only: nothing is stored and sending is never blocked by the result (`blocking` is always false). Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SMTPSenderDomainReport"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The state of each record and what to add."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Check the sender domain's SPF, DMARC and DKIM",
        "tags": [
          "email-smtp"
        ]
      }
    },
    "/api/v1/admin/x/email-smtp/test": {
      "post": {
        "description": "Sends one message now, synchronously, through the stored SMTP settings (saved, whether or not the integration is switched on yet), in the store's language, and answers with what the server said. It goes only to the signed-in operator's own address — never to a stranger (no open relay); a script holding the static admin token names the address in `to`. Needs plugins.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "to": {
                    "description": "Optional; must be the operator's own address when signed in.",
                    "format": "email",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SMTPTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether the server accepted the message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Send a test email",
        "tags": [
          "email-smtp"
        ]
      }
    },
    "/api/v1/admin/x/erp-sync/status": {
      "get": {
        "description": "Logo, Mikro and Netsis (OR8): for each, whether it is switched on and set up, the latest pass of each kind (`items` in; `customers`, `orders`, `invoices` out) with how many it saw, changed and failed and the lines that failed, the documents that failed too often and wait for a person, and how many paid orders have not gone out yet. Needs plugins.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ErpConnectorStatus"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The connectors."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "The ERP connectors, their last sync and what failed",
        "tags": [
          "erp-sync"
        ]
      }
    },
    "/api/v1/admin/x/erp-sync/{connector}/sync": {
      "post": {
        "description": "Queues the sync job for this connector in this store; it runs in the background like the recurring pass every 15 minutes, and its outcome appears in the status. 409 when the connector is not switched on and set up. Needs plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "connector",
            "required": true,
            "schema": {
              "enum": [
                "logo",
                "mikro",
                "netsis"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "queued": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Sync an ERP now",
        "tags": [
          "erp-sync"
        ]
      }
    },
    "/api/v1/admin/x/erp-sync/{connector}/test": {
      "post": {
        "description": "Signs in with the saved address, user, password and company, and reads one page of stock cards, whether or not the connector is switched on yet. `ok` is true when the ERP answered; otherwise `error` says why (never the password). Nothing is written at the ERP. 409 when the address, user or password is missing. Needs plugins.write.",
        "parameters": [
          {
            "in": "path",
            "name": "connector",
            "required": true,
            "schema": {
              "enum": [
                "logo",
                "mikro",
                "netsis"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ErpTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether the ERP accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test an ERP connection",
        "tags": [
          "erp-sync"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/accounts": {
      "get": {
        "description": "Discovered with the store's own merchant-mode OAuth grant. Right: channels.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantAccounts"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The discovered accounts."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A Google failure or a refused precondition, normalized (code: UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code). The message is sanitized and never carries a token. details.google carries Google's HTTP status, its status word, the normalized code and the sanitized message."
          }
        },
        "summary": "Accounts the store's own grant can reach (merchant mode)",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/accounts/select": {
      "post": {
        "description": "The id must be one Google lists for this store's own grant; owned mode is refused (its account comes from configuration). Right: channels.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "accountId": {
                    "pattern": "^[0-9]{1,20}$",
                    "type": "string"
                  },
                  "mode": {
                    "enum": [
                      "merchant"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "accountId"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "accountId": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Chosen."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A Google failure or a refused precondition, normalized (code: UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code). The message is sanitized and never carries a token. details.google carries Google's HTTP status, its status word, the normalized code and the sanitized message."
          }
        },
        "summary": "Choose the merchant-mode account",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/audit": {
      "get": {
        "description": "The newest 100 google.merchant.* events of this store: mode, account id, status, error code, correlation id. Right: channels.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GoogleMerchantAuditEntry"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The trail."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The module's audit trail",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/oauth/start": {
      "post": {
        "description": "Returns Google's authorization URL (scope `https://www.googleapis.com/auth/content` only, offline access, consent, PKCE S256) and when the single-use state expires (10 minutes). `owned` is allowed only for the tenant that owns NeroCart's Merchant Center; the account id never comes from the request. Right: channels.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "mode": {
                    "enum": [
                      "owned",
                      "merchant"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "mode"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantAuthorization"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The authorization URL."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Start a Google OAuth authorization",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/register": {
      "post": {
        "description": "Access test, developer registration read, registerGcp only when the expected project number is not yet registered (idempotent), API_DEVELOPER check for the developer email. Owner tenant only; takes no body. 202 when Google was unavailable or rate limiting and a retry job is queued. Right: channels.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantRegistration"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Registration completed."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantRegistration"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Pending; a retry is queued."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A Google failure or a refused precondition, normalized (code: UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code). The message is sanitized and never carries a token. details.google carries Google's HTTP status, its status word, the normalized code and the sanitized message."
          }
        },
        "summary": "Register NeroCart's GCP project (owned mode)",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/service-account/grant": {
      "post": {
        "description": "Through the Merchant API's user management (accounts.users), with the owned OAuth grant of an account admin: lists the account's users; creates the service account named by the configured key file with ADMIN if it is absent, adds ADMIN to its rights if it lacks it, and changes nothing if it already holds it. If Google then reports the user PENDING, the service account verifies itself with its own token (PATCH accounts/{account}/users/me:verifySelf, body {}); the response must say VERIFIED with ADMIN. A VERIFIED user is not verified again. The access test is not run here (Google refuses the service account for about a minute after verifySelf); use service-account/test. The request carries no email and no account id. No invitation email is involved. Owner tenant only. Right: channels.write. A Google failure answers 424 with details.google (and details.grant when verifySelf failed after the user was added).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantServiceAccountGrant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The service account holds ADMIN on the account."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A Google failure or a refused precondition, normalized (code: UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code). The message is sanitized and never carries a token. details.google carries Google's HTTP status, its status word, the normalized code and the sanitized message."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Google answered without the expected result: ADMIN_RIGHT_MISSING, or VERIFY_SELF_INCOMPLETE (verifySelf did not report VERIFIED with ADMIN; details.grant shows the user)."
          }
        },
        "summary": "Add the service account to NeroCart's account with ADMIN (owned mode)",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/service-account/test": {
      "post": {
        "description": "Mints a service-account token (JWT bearer, content scope) and reads NeroCart's Merchant Center account. On PERMISSION_DENIED answers SERVICE_ACCOUNT_MERCHANT_ACCESS_REQUIRED with the steps to grant access by hand; nothing is granted and no invitation is sent. Owner tenant only. Right: channels.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantServiceAccountTest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The service account can read the account."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A Google failure or a refused precondition, normalized (code: UNAUTHENTICATED, PERMISSION_DENIED, RATE_LIMITED, UNAVAILABLE, ALREADY_REGISTERED, ALREADY_EXISTS, INVALID_ARGUMENT, NOT_FOUND, UNKNOWN, or a module code). The message is sanitized and never carries a token. details.google carries Google's HTTP status, its status word, the normalized code and the sanitized message."
          }
        },
        "summary": "Test the service account's access (owned mode)",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-merchant/status": {
      "get": {
        "description": "The store's connections (no tokens), the owned account's registration status, gcpIds and API_DEVELOPER check, and for the owner tenant the service account's last test. Right: channels.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleMerchantStatus"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Connection and registration status",
        "tags": [
          "google-merchant"
        ]
      }
    },
    "/api/v1/admin/x/google-services/ads/conversion-check": {
      "get": {
        "description": "Reads the bound Google Ads customer's purchase and add-to-cart conversion actions (status, label, last conversion day and count of the last 30 days), whether their website goals count for bidding, how the storefront reports the conversions (direct Google tag or Tag Manager container) and NeroCart's own count of paid orders to compare against. Writes nothing. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleAdsConversionCheck"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The readout."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Google Ads conversion check",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/audit": {
      "get": {
        "description": "The newest 100 events and the newest 100 field writes (previous value, new value, provenance, actor, operation id). Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesAudit"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The trail."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Module audit trail and binding ledger",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/catalog": {
      "get": {
        "description": "Every service with its aliases, scopes per level, required APIs, the batch that brings its provider and its DISCOVER/CREATE/CONFIGURE/VERIFY/BIND_TO_NEROCART/ACTIVATE/SYNC row. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GoogleServicesCatalogEntry"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The catalogue."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Service catalogue and support matrix",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/connections": {
      "get": {
        "description": "No token is ever returned. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GoogleServicesConnection"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The connections."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Connected Google accounts",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/connections/{id}/disconnect": {
      "post": {
        "description": "NeroCart forgets its copy of the grant; Google resources, bindings and other connections stay. With revoke, the grant is revoked at Google too and every connection of the same account is listed as affected and marked. Right: google-services.write.",
        "parameters": [
          {
            "description": "The connection.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesDisconnectInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesDisconnectOutput"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The outcome."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Disconnect a Google account",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/discover": {
      "post": {
        "description": "Runs every selected service's discovery with the connection (the newest healthy one when unnamed). A service without its scopes answers NEEDS_GOOGLE_CONSENT; a provider that is not in this build answers UNSUPPORTED; a Google failure of one never stops the others. Nothing is written. Right: google-services.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesDiscoverInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GoogleServicesServiceDiscovery"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One result per service."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Find existing services",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/gmail/inbox": {
      "get": {
        "description": "The newest messages Gmail reported to the store's watched mailbox (the gmail_inbox option): sender, subject, date, labels and an 'open in Gmail' link — never a body, snippet or attachment. Rows are kept 30 days. A sender that is one of the store's customers (customer record or orders with that address) is linked, only for an operator who also holds customers.read and orders.read. Every text field is untrusted mail header text: render it as text, never as HTML. Right: google-services.read.",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesGmailInbox"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The inbox."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Gmail inbox: the latest messages (metadata only)",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/gmail/test": {
      "post": {
        "description": "Sends one test message now through the bound Gmail mailbox (whether or not it is the sender yet), only to the signed-in operator's own address (a static token names one) and only when the request confirms the recipient. Google's acceptance is not delivery. Right: google-services.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesGmailTestInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesGmailTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether Google accepted the message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Send a Gmail test email",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/oauth/start": {
      "post": {
        "description": "Returns Google's authorization URL: scopes derived from the selected services (catalogue only, never cloud-platform), offline access, consent, PKCE S256, OIDC nonce, include_granted_scopes. The state is single use (10 minutes) and bound server side to the actor, tenant, store, purpose and scope set. Right: google-services.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesStartInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesStartOutput"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The authorization URL."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Start a Google OAuth authorization",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/overview": {
      "get": {
        "description": "The store's facts (hosts, country, language, currency, timezone), connected Google accounts (no tokens), one card per service with real status, needed action, bound NeroCart fields, the latest plan and run, and the readiness diagnostic. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The overview."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Google Services overview",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/plans": {
      "get": {
        "description": "The store's newest 20 plans. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/GoogleServicesPlan"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plans."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "List plans",
        "tags": [
          "google-services"
        ]
      },
      "post": {
        "description": "Discovers, diffs and records a draft plan: per service what to bind, create or verify, the NeroCart fields that would change (with their current values), the external actions, and the plan hash an approval must name. Publishing actions appear only when their option was chosen. Older drafts are superseded. Right: google-services.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesPlanInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesPlan"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft plan."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Make a setup plan",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/plans/{id}": {
      "get": {
        "description": "Right: google-services.read.",
        "parameters": [
          {
            "description": "The plan.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesPlanView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plan."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One plan with its latest run",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/plans/{id}/approve": {
      "post": {
        "description": "The trusted approval: the caller names the plan's hash exactly; the settings the plan snapshotted must not have moved (409 PLAN_STALE otherwise). Creates the run and its journal idempotently (a second click finds the same run) and queues the job. Approving grants nothing on Cloud, IAM or DNS. Right: google-services.write.",
        "parameters": [
          {
            "description": "The plan.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleServicesApproveInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesPlanView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The approved plan and its run."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Approve a plan",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/readiness": {
      "get": {
        "description": "What this deployment has (client, redirect URI) and what each service needs (scopes, APIs); the consent screen and app verification are HUMAN_ACTION_REQUIRED by nature. Right: google-services.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesReadiness"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The diagnostic."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "OAuth readiness",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/runs/{id}": {
      "get": {
        "description": "The durable journal: each step's dependency, attempt, request and operation ids, external result and local result kept apart. Right: google-services.read.",
        "parameters": [
          {
            "description": "The run.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesRun"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The run."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One run with its steps",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/services/{service}/sync": {
      "post": {
        "description": "Refreshes NeroCart's copy of a bound resource's settings: the provider re-reads Google and the fields it returns are written through the binding adapter (snapshot, conflict check, ledger with provenance 'synced'). Merchant: re-queues the product sync when it is on. Right: google-services.write.",
        "parameters": [
          {
            "description": "A service id or alias.",
            "in": "path",
            "name": "service",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesSyncResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The binding after the sync, what the provider found and the fields written."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Sync a binding",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/google-services/services/{service}/verify": {
      "post": {
        "description": "Re-checks the service's existing binding with its provider and records the state. Right: google-services.write.",
        "parameters": [
          {
            "description": "A service id or alias.",
            "in": "path",
            "name": "service",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GoogleServicesBinding"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The binding."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Verify a binding",
        "tags": [
          "google-services"
        ]
      }
    },
    "/api/v1/admin/x/hub/ads": {
      "get": {
        "description": "The campaigns the hub launched with their one plain status and this month's cost, the budget policies, and whether the server and the caller may launch. Reads NeroCart's rows only. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubAdsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The ads."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The ads (Pazarlama › Reklamlar)",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/ads/campaigns/{id}/pause": {
      "post": {
        "description": "Pauses the campaign on its platform at once. Always allowed with marketing.write: it never waits for the kill switch, ads.spend or a person. The wish is recorded first; if the platform does not answer, the hourly sync pauses it. Switching it on again is an ads_resume plan. Right: marketing.write.",
        "parameters": [
          {
            "description": "The campaign.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubAdCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Pause an ad",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/ads/campaigns/{id}/stop": {
      "post": {
        "description": "Stops (removes) the campaign on its platform for good. Always allowed with marketing.write. The wish is recorded first; if the platform does not answer, the sync stops it. Right: marketing.write.",
        "parameters": [
          {
            "description": "The campaign.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubAdCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The campaign."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Stop an ad",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/ads/preflight": {
      "post": {
        "description": "Builds the campaign from the wizard's answer (the products, the goal, the daily budget; Performance Max when the goal is sales and a Merchant Center account is linked to Google Ads, otherwise Search), checks Google's limits and the budget, and asks Google to validate the exact request (validate_only). Writes nothing anywhere and spends nothing; works with ad spend off on the server. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubLaunchInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubPreflight"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The check."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Check an ad before launching it",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/analytics/realtime": {
      "get": {
        "description": "Who is on the store's site now: active users of the last 30 and 5 minutes, per minute, top pages, countries, devices and add_to_cart/purchase events, from the bound GA4 property's Realtime report. Calls Google at most once per store every 20 seconds (answers are kept in memory, never stored). A missing connection, grant, binding or quota is a 200 with that status. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubLive"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The live numbers or the reason there are none."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Live visitors (GA4 Realtime)",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/budget": {
      "get": {
        "description": "The store's ad budget per currency, this month's ad spend from the stored Google Ads numbers (no provider call), the latest draft plan and whether a raise can be approved here. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubBudgetView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The budget."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Ad budget",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/channels": {
      "get": {
        "description": "The Satış Kanalları cards (ADR-0131): each channel's account, status, setup steps, product choice and catalog. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubChannelsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The sales channels."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          }
        },
        "summary": "Social sales channels",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/channels/catalog/problems": {
      "get": {
        "description": "Items Meta or TikTok rejected or could not take, with the reason. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "problems": {
                          "items": {
                            "$ref": "#/components/schemas/HubCatalogProblem"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The problems."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          }
        },
        "summary": "Products the catalogs refused",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/channels/catalog/sync": {
      "post": {
        "description": "Sends what changed without waiting for the quiet time. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubChannelsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The sales channels."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          }
        },
        "summary": "Sync the catalogs now",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/channels/setup": {
      "post": {
        "description": "Queues the setup chain (catalog, sync, WhatsApp catalog, webhooks, templates, Page). Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubChannelsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The sales channels."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          }
        },
        "summary": "Run the channels' setup again",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/channels/{channel}": {
      "post": {
        "description": "Switching on runs the setup chain. Right: marketing.write.",
        "parameters": [
          {
            "in": "path",
            "name": "channel",
            "required": true,
            "schema": {
              "enum": [
                "whatsapp",
                "instagram",
                "facebook",
                "tiktok"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubChannelUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubChannelsView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The sales channels."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          },
          "404": {
            "description": "UNKNOWN_CHANNEL."
          },
          "409": {
            "description": "CHANNEL_NEEDS_SETUP: the account behind the channel is not connected (details.needs)."
          }
        },
        "summary": "Switch a channel or choose its products",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections": {
      "get": {
        "description": "One card per provider: one state, one recognisable id, one message code and the screen that connects it. Google, Bing and Yandex are borrowed from their modules; the others are not built yet (ready=false). No token or key. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubConnections"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Connections",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/meta/assets": {
      "get": {
        "description": "Reads the Pages (with their Instagram accounts), the ad account's business's catalogs and the ad account's pixels from Meta, and the current choice. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubMetaAssets"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The assets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, NEEDS_REAUTH, NO_ACCESS)."
          },
          "502": {
            "description": "Meta did not answer."
          }
        },
        "summary": "Meta assets to choose from",
        "tags": [
          "hub"
        ]
      },
      "post": {
        "description": "Stores the Page, Instagram account, catalog (or creates one, adopting one of the same name) and pixel (or creates one), each checked against Meta; then, each only when asked: registers the feed, switches the pixel plugin on. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubMetaChoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubMetaChoiceResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The choice."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, NEEDS_REAUTH, NO_ACCESS, META_NO_BUSINESS)."
          },
          "422": {
            "description": "ACCOUNT_NOT_REACHABLE: an id Meta does not answer for this grant."
          },
          "502": {
            "description": "Meta did not answer."
          }
        },
        "summary": "Choose the Meta assets",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/meta/assets/refresh": {
      "post": {
        "description": "The same read as GET, for a screen's \"read again\". Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubMetaAssets"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The assets."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code."
          },
          "502": {
            "description": "Meta did not answer."
          }
        },
        "summary": "Read the Meta assets again",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/tiktok/assets": {
      "get": {
        "description": "Reads the advertiser's pixels from TikTok and the current choice. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTikTokAssets"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pixels."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, NEEDS_REAUTH, NO_ACCESS)."
          },
          "502": {
            "description": "TikTok did not answer."
          }
        },
        "summary": "TikTok pixels to choose from",
        "tags": [
          "hub"
        ]
      },
      "post": {
        "description": "Stores the pixel (its code, checked against what TikTok lists), then, each only when asked: switches the storefront's TikTok pixel plugin on, and turns the Events API (server-side CompletePayment) on. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubTikTokChoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTikTokChoiceResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The choice."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, NEEDS_REAUTH, NO_ACCESS)."
          },
          "422": {
            "description": "ACCOUNT_NOT_REACHABLE: a pixel TikTok does not list for this advertiser."
          },
          "502": {
            "description": "TikTok did not answer."
          }
        },
        "summary": "Choose the TikTok pixel",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/tiktok/feed": {
      "post": {
        "description": "Issues a new capability URL for the store's product feed (tiktok.csv), to give TikTok's Catalog Manager as a Data Feed Schedule source. A new address replaces the old one at once. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTikTokFeed"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The address."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, NEEDS_REAUTH)."
          }
        },
        "summary": "Issue the TikTok product feed address",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/{provider}/account": {
      "post": {
        "description": "Chooses one of the ad accounts the grant reaches (by id or number); its currency and time zone are read from the provider. Right: marketing.write.",
        "parameters": [
          {
            "description": "The owned connection.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "microsoft-ads",
                "yandex-direct",
                "meta",
                "tiktok"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubChooseAccountInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubConnections"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, ADS_RUNNING, NEEDS_REAUTH, NO_ACCESS)."
          }
        },
        "summary": "Choose the ad account",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/{provider}/accounts/refresh": {
      "post": {
        "description": "Lists the ad accounts the grant reaches again. Right: marketing.write.",
        "parameters": [
          {
            "description": "The owned connection.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "microsoft-ads",
                "yandex-direct",
                "meta",
                "tiktok"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubConnections"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, ADS_RUNNING, NEEDS_REAUTH, NO_ACCESS)."
          }
        },
        "summary": "Read the ad accounts again",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/connections/{provider}/disconnect": {
      "post": {
        "description": "Forgets NeroCart's copy of the grant; the account at the provider is untouched. Refused (409 ADS_RUNNING) while the hub's ads may still spend on it. Right: marketing.write.",
        "parameters": [
          {
            "description": "The owned connection.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "microsoft-ads",
                "yandex-direct",
                "meta",
                "tiktok"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubConnections"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, ADS_RUNNING, NEEDS_REAUTH, NO_ACCESS)."
          }
        },
        "summary": "Disconnect",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/conversions": {
      "get": {
        "description": "What the store's server-side conversions did in the last seven days, per destination (meta, tiktok): how they are sent (connection, the Meta pixel's own Conversions API token, or off), whether a Meta test event code is set, how many paid orders were sent, skipped for want of marketing consent, failed or still queued, when the last went and the last failure's code. No token. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubConversionsSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The lines."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Server-side conversions",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/dashboard": {
      "get": {
        "description": "The store's search, visitor and index numbers for a period ending yesterday, read from the stored snapshots only (no provider is called). Right: marketing.read.",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": false,
            "schema": {
              "default": 28,
              "enum": [
                7,
                28,
                90
              ],
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubDashboard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The overview."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Marketing overview",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox": {
      "get": {
        "description": "WhatsApp conversations and Instagram/Messenger threads, newest first (ADR-0131). Right: whatsapp.inbox.",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "enum": [
                "whatsapp",
                "instagram",
                "facebook"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "unread",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "me, none or a user id.",
            "in": "query",
            "name": "assigned",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "open",
                "closed"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The previous page's next cursor.",
            "in": "query",
            "name": "before",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          }
        },
        "summary": "Unified inbox",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/social/{id}/reply": {
      "post": {
        "description": "Text inside the 24-hour window only (WINDOW_CLOSED otherwise), sent with the Page's token. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The thread.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubSocialReply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Sent; the thread."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "WINDOW_CLOSED, NOT_CONNECTED or NEEDS_REAUTH."
          },
          "502": {
            "description": "SEND_FAILED: Meta did not take it."
          }
        },
        "summary": "Instagram/Messenger reply",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/social/{id}/send": {
      "post": {
        "description": "A product card (utm_source=\u003cchannel\u003e\u0026utm_medium=dm) or a 48-hour payment link kept as a chat cart. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The thread.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubSocialSend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Sent; the thread."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "WINDOW_CLOSED, NOT_CONNECTED or NEEDS_REAUTH."
          },
          "502": {
            "description": "SEND_FAILED: Meta did not take it."
          }
        },
        "summary": "Send a product or a payment link",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/{kind}/{id}": {
      "get": {
        "description": "A conversation with its last 200 messages and its customer. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "wa (WhatsApp) or social (Instagram, Messenger).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "wa",
                "social"
              ],
              "type": "string"
            }
          },
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Inbox conversation",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/{kind}/{id}/assign": {
      "post": {
        "description": "Assign to a person (null: no one). Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "wa (WhatsApp) or social (Instagram, Messenger).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "wa",
                "social"
              ],
              "type": "string"
            }
          },
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubInboxAssign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Assign",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/{kind}/{id}/read": {
      "post": {
        "description": "Unread to 0. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "wa (WhatsApp) or social (Instagram, Messenger).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "wa",
                "social"
              ],
              "type": "string"
            }
          },
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Mark read",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/inbox/{kind}/{id}/status": {
      "post": {
        "description": "Open or close a conversation (a new message reopens a social thread). Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "wa (WhatsApp) or social (Instagram, Messenger).",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "wa",
                "social"
              ],
              "type": "string"
            }
          },
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubInboxStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInboxItem"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Open or close",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/instagram/publish": {
      "post": {
        "description": "The product's lead picture with the caption, tagged with the product when it is in the Meta catalog. Right: marketing.write; plan switch social_shop.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubInstagramPublish"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubInstagramPublished"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden, or feature_not_entitled: the plan sets social_inbox off."
          },
          "409": {
            "description": "NO_INSTAGRAM, NOT_CONNECTED or NEEDS_REAUTH."
          },
          "422": {
            "description": "NO_IMAGE."
          },
          "502": {
            "description": "PROVIDER_UNAVAILABLE."
          }
        },
        "summary": "Publish on Instagram",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/oauth/{provider}/start": {
      "post": {
        "description": "Starts the provider's consent (ADR-0054, ADR-0055): a single-use state (stored hashed, ten minutes) and a PKCE challenge; the owner returns at /x/hub/oauth/{provider}/callback. Answers 409 NOT_CONFIGURED until the platform's app is set. Right: marketing.write.",
        "parameters": [
          {
            "description": "The owned connection.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "microsoft-ads",
                "yandex-direct",
                "meta",
                "tiktok"
              ],
              "type": "string"
            }
          },
          {
            "description": "meta only: social asks again for the sales channels' permissions (ADR-0131).",
            "in": "query",
            "name": "scopes",
            "required": false,
            "schema": {
              "enum": [
                "social"
              ],
              "type": "string"
            }
          },
          {
            "description": "The admin screen to return to after the consent; omitted, Pazarlama › Bağlantılar.",
            "in": "query",
            "name": "back",
            "required": false,
            "schema": {
              "enum": [
                "sales-channels"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubOAuthStart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Where to send the owner."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "A refusal with a code (NOT_CONFIGURED, NOT_CONNECTED, ADS_RUNNING, NEEDS_REAUTH, NO_ACCESS)."
          }
        },
        "summary": "Connect an owned provider",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/plans": {
      "post": {
        "description": "Makes a draft plan against the state as it is now; a newer draft of the same subject supersedes the older. Nothing changes until it is approved. budget_policy: the ad budget. ads_launch: a campaign from the \"Reklam ver\" wizard; it must pass the preflight (422 ADS_PREFLIGHT_FAILED) and the budget (409 ADS_NO_BUDGET, ADS_OVER_DAILY_MAX, ADS_OVER_MONTHLY_CAP, ADS_CAP_REACHED). ads_resume / ads_budget: switch a paused campaign on again, change its daily budget. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubPlanInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubPlanView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Propose a budget change or an ad",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/plans/{id}": {
      "get": {
        "description": "Right: marketing.read.",
        "parameters": [
          {
            "description": "The plan.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubPlanView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The plan."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A plan and its run",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/plans/{id}/approve": {
      "post": {
        "description": "The trusted approval: the caller names the plan's hash exactly and, for a plan that sets an ad budget, echoes its monthly_max_minor and currency (409 AMOUNT_MISMATCH otherwise). A plan that can raise spend also needs ads.spend, a signed-in person (no token, API key or platform staff) and COS_ADS_SPEND=on on the server (403 ADS_SPEND_RIGHT / ADS_SPEND_NEEDS_PERSON / ADS_SPEND_OFF \"Reklam harcaması bu sunucuda kapalı\"); one that only lowers spend needs marketing.write alone. The budget must still be the one the plan was made against (409 PLAN_STALE). Creates the run idempotently (a second approval returns the same run) and queues it. An ads plan (launch, resume, a higher daily budget) is a raise: it also needs the budget to hold it at approval and again when the run switches it on (409 ADS_NO_BUDGET, ADS_OVER_DAILY_MAX, ADS_OVER_MONTHLY_CAP, ADS_CAP_REACHED). The run creates a campaign PAUSED, re-reads it and enables it last; a failure leaves it paused. Right: marketing.write.",
        "parameters": [
          {
            "description": "The plan.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubApproveInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubPlanView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The approved plan and its run."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Approve a plan",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/refresh": {
      "post": {
        "description": "Queues a refresh of one source (or every source) of the caller's store; a source refreshed by hand less than 15 minutes ago is reported as throttled. Calls no provider itself. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "source": {
                    "description": "google.search, google.index, google.analytics, google.ads, microsoft.ads, yandex.direct, bing.search or yandex.search; empty for all.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubRefreshResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What was queued."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Refresh the numbers",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram": {
      "get": {
        "description": "The store's Telegram bot (ADR-0057): its state, @username, the linked chats and what each hears. Read from NeroCart's rows only (Telegram is not called); never the token. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegram"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Telegram card",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram/connect": {
      "post": {
        "description": "Checks the token @BotFather gave (getMe), keeps it sealed and points the bot's webhook at https://\u003cstore's primary domain\u003e/x/hub/in/telegram/\u003croute token\u003e with a secret header (only their hashes are kept; allowed_updates message and my_chat_member). An empty token with a bot connected sets the webhook again with the stored token (new route token and secret). Another bot replaces the old one and its linked chats. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubTelegramConnectInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegram"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "400": {
            "description": "TOKEN_FORMAT: not a bot token."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "NO_PUBLIC_HOST: the store has no primary domain."
          },
          "422": {
            "description": "TOKEN_INVALID: Telegram does not accept the token."
          },
          "502": {
            "description": "PROVIDER_UNAVAILABLE (Telegram did not answer) or WEBHOOK_FAILED (Telegram refused the webhook; the card shows it)."
          }
        },
        "summary": "Connect the Telegram bot",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram/disconnect": {
      "post": {
        "description": "Forgets the bot, its linked chats and its link codes, and asks Telegram to stop sending updates (best effort). The bot itself stays at @BotFather. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegram"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Disconnect the Telegram bot",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram/link": {
      "post": {
        "description": "Issues a one-time code (15 minutes; only its hash is kept) as two Telegram links: url opens a private chat with the bot (t.me/\u003cbot\u003e?start=\u003ccode\u003e), group_url adds the bot to a group (?startgroup=\u003ccode\u003e). The chat that sends /start with the code is linked. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegramLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The links."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "NOT_CONNECTED: no bot (or Telegram no longer accepts its token)."
          }
        },
        "summary": "A link to connect a chat",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram/recipients/{id}": {
      "delete": {
        "description": "Unlinks one chat (\"Kaldır\"); it hears nothing more. Right: marketing.write.",
        "parameters": [
          {
            "description": "The linked chat (a recipient id from the card).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegram"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a chat",
        "tags": [
          "hub"
        ]
      },
      "post": {
        "description": "Sets the kinds one linked chat hears (order_new, order_paid, owner_request, ads_cap, connection, contact_message). Right: marketing.write.",
        "parameters": [
          {
            "description": "The linked chat (a recipient id from the card).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubTelegramKindsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegram"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Choose what a chat hears",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/telegram/test": {
      "post": {
        "description": "Queues \"NeroCart deneme mesajı\" to every active linked chat (whatever it chose to hear); a job sends it. Right: marketing.write.",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubTelegramTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "NOT_CONNECTED or NO_CHAT."
          }
        },
        "summary": "Send a test message",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp": {
      "get": {
        "description": "The store's WhatsApp number on the Meta connection (ADR-0058): state, number, display name and its review, quality, templates and their review, this month's template messages and the cap, order updates switch, the store's own numbers, a number change in progress. Read from NeroCart's rows only. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "WhatsApp settings",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/campaigns": {
      "get": {
        "description": "The store's marketing campaigns, newest first, each with its report (sent, delivered, read, failed, replies). Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaigns"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "WhatsApp campaigns",
        "tags": [
          "hub"
        ]
      },
      "post": {
        "description": "An approved MARKETING template, its values, the audience filter and the count as it is now. Nothing is sent. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppCampaignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The draft."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "NO_NUMBER or TEMPLATE_NOT_APPROVED."
          }
        },
        "summary": "Draft a campaign",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/campaigns/audience": {
      "get": {
        "description": "How many customers a campaign would reach: a granted commercial MESAJ consent that İYS confirmed, not suppressed, narrowed by the filter; the estimated cost when a per-message price is set. Right: marketing.read.",
        "parameters": [
          {
            "in": "query",
            "name": "group_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "product_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "ordered_within_days",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppAudience"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "NO_NUMBER."
          }
        },
        "summary": "Count the audience",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/campaigns/{id}": {
      "get": {
        "description": "One campaign with its report. Right: marketing.read.",
        "parameters": [
          {
            "description": "The campaign.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A campaign",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/campaigns/{id}/cancel": {
      "post": {
        "description": "Stops a draft or a sending campaign: what was not queued yet is never sent. Right: marketing.write.",
        "parameters": [
          {
            "description": "The campaign.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Cancel a campaign",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/campaigns/{id}/send": {
      "post": {
        "description": "Sends a draft. It costs money, so it is guarded like raising ad spend (ADR-0052): ads.spend, a signed-in person (ADS_SPEND_NEEDS_PERSON) and COS_ADS_SPEND=on (ADS_SPEND_OFF); confirm_count must be the audience now (COUNT_CHANGED) and the campaign must fit under the monthly template cap (WA_CAP). The recipients are recorded once; a job sends within Meta's messaging limit. A campaign already sending answers 200 with itself. Right: ads.spend.",
        "parameters": [
          {
            "description": "The campaign.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppSendInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Already sending or sent."
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppCampaign"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Sending."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "COUNT_CHANGED, WA_CAP, NO_AUDIENCE, TEMPLATE_NOT_APPROVED, CAMPAIGN_NOT_DRAFT or NO_NUMBER."
          }
        },
        "summary": "Send a campaign",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/conversations": {
      "get": {
        "description": "The store's conversations, newest first, with whether the customer service window is open. Right: whatsapp.inbox.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppConversations"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "WhatsApp conversations",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/conversations/{id}": {
      "get": {
        "description": "The last 200 messages and the approved Utility templates a reply may use outside the window. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A conversation",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/conversations/{id}/read": {
      "post": {
        "description": "Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Marked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Mark read",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/conversations/{id}/reply": {
      "post": {
        "description": "Free-form text only inside the customer service window (WINDOW_CLOSED otherwise), or an approved template with its parameters; a Marketing template needs the customer's MESAJ consent confirmed in İYS (NO_CONSENT). Queued; a job sends. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppReply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued; the thread."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "WINDOW_CLOSED, TEMPLATE_NOT_APPROVED, NO_CONSENT or NO_NUMBER."
          }
        },
        "summary": "Reply",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/conversations/{id}/send": {
      "post": {
        "description": "Inside the customer's 24-hour window only; a payment link is kept as a chat cart. Right: whatsapp.inbox.",
        "parameters": [
          {
            "description": "The conversation.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWASend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppThread"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued; the thread."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Forbidden."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "WINDOW_CLOSED or NO_CATALOG."
          }
        },
        "summary": "Send a product, a product list, the catalog or a payment link",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/disconnect": {
      "post": {
        "description": "Releases the route, unsubscribes the app (best effort) and forgets the templates; conversations stay under their retention. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Forget the WhatsApp number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number": {
      "post": {
        "description": "Checks the WABA and number against Meta's answer, claims the WABA's inbound route (ROUTE_TAKEN when another store holds it), subscribes the app to the WABA's webhooks and reads its templates. Choosing another number of the same account switches numbers. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppChoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppChoiceResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          },
          "422": {
            "description": "Not a number the grant reaches."
          }
        },
        "summary": "Choose the WhatsApp number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/activate": {
      "post": {
        "description": "Registers the store's chosen number on the Cloud API (Meta answered 133010 on a send) with a new six-digit two-step PIN, sealed and in this answer only. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPIN"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (PIN_MISMATCH, TOO_MANY_ATTEMPTS, NO_PAYMENT_METHOD)."
          }
        },
        "summary": "Register the number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/new": {
      "post": {
        "description": "Adds the number (cc + national number, verified_name: the display name; the store's name by default) to the store's WABA, or adopts it when it is already in the WABA's list. Sending stays on the current number until the new one is registered. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppNewNumber"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPending"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          },
          "422": {
            "description": "NAME_REJECTED."
          }
        },
        "summary": "Add a new number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/new/cancel": {
      "post": {
        "description": "Forgets the pending number; the store keeps its number. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Cancel the number change",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/new/code": {
      "post": {
        "description": "Meta sends the pending number a code by SMS or a voice call (language tr). NUMBER_IN_USE when Meta will not (the number is probably still on the WhatsApp app). Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "method": {
                    "enum": [
                      "SMS",
                      "VOICE"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPending"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          },
          "429": {
            "description": "TOO_MANY_ATTEMPTS."
          }
        },
        "summary": "Send the verification code",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/new/register": {
      "post": {
        "description": "Makes a six-digit two-step verification PIN (kept sealed), registers the verified number for the Cloud API and only then switches the store to it. The PIN is in this answer only. Optionally takes the old number off the Cloud API (deregister_old). Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "deregister_old": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPIN"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          },
          "429": {
            "description": "TOO_MANY_ATTEMPTS."
          }
        },
        "summary": "Register the new number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/new/verify": {
      "post": {
        "description": "Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPending"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          },
          "422": {
            "description": "WRONG_CODE."
          },
          "429": {
            "description": "TOO_MANY_ATTEMPTS."
          }
        },
        "summary": "Verify the code",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/number/pin": {
      "post": {
        "description": "Sets a new two-step verification PIN on the store's number; the PIN is in this answer only. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppPIN"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          }
        },
        "summary": "Reset the PIN",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/numbers": {
      "get": {
        "description": "Read from Meta: the WhatsApp Business Accounts of the person's business portfolios (owned and client) and those the grant's granular scopes name (debug_token), each with its phone numbers. NEEDS_REAUTH when the grant lacks whatsapp_business_management / whatsapp_business_messaging. Right: marketing.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppNumbers"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          }
        },
        "summary": "WhatsApp numbers the grant reaches",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/settings": {
      "post": {
        "description": "Order updates to shoppers who asked (customer_notify) and the monthly cap on template messages (template_cap, default 1000). Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          }
        },
        "summary": "WhatsApp switches",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/staff": {
      "post": {
        "description": "Adds one of the store's own numbers (E.164; Türkiye by default) with the kinds it hears. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppStaffInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Add a staff number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/staff/{id}": {
      "delete": {
        "description": "Right: marketing.write.",
        "parameters": [
          {
            "description": "The staff number.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a staff number",
        "tags": [
          "hub"
        ]
      },
      "post": {
        "description": "Kinds and active. Right: marketing.write.",
        "parameters": [
          {
            "description": "The staff number.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppStaffInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Change a staff number",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/templates": {
      "post": {
        "description": "Submits a MARKETING template (Turkish) to the WABA for Meta's review; a template of that name is never submitted twice. Right: marketing.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HubWhatsAppTemplateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppChoiceResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Submitted; the WhatsApp settings and what did not work."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "TEMPLATE_EXISTS, NO_NUMBER or not connected."
          },
          "422": {
            "description": "TEMPLATE_REFUSED: Meta did not accept it."
          }
        },
        "summary": "Write a marketing template",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/templates/refresh": {
      "post": {
        "description": "Reads the WABA's message templates and their review from Meta. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsApp"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The WhatsApp settings."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          }
        },
        "summary": "Read the templates again",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/hub/whatsapp/templates/standard": {
      "post": {
        "description": "Submits NeroCart's Utility templates in Turkish (siparis_alindi, kargoya_verildi, teslim_edildi, yeni_siparis_bildirimi) that the WABA does not have yet, each found by name first; Meta reviews them. Right: marketing.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HubWhatsAppChoiceResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Not connected, no number chosen, or a refusal the screen words (code)."
          }
        },
        "summary": "Submit the standard templates",
        "tags": [
          "hub"
        ]
      }
    },
    "/api/v1/admin/x/invoicing-parasut/test": {
      "post": {
        "description": "Signs in to Paraşüt now with the saved settings (whether or not the integration is switched on yet) — a fresh OAuth password grant with the client id and secret, user and password — and reads GET /v4/me with the user's companies, the cheapest authenticated call. `ok` is true when the sign-in worked and the saved company number is one of the user's companies. Nothing is created at Paraşüt and nothing is stored; the answer never carries a credential or a token. 409 when the settings are incomplete. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ParasutTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether Paraşüt accepted the credentials and the company."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the Paraşüt connection",
        "tags": [
          "invoicing-parasut"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/aliases": {
      "get": {
        "description": "Mail to an alias goes to another address. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "aliases": {
                          "items": {
                            "$ref": "#/components/schemas/MailMxAlias"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "The store domain's aliases",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "post": {
        "description": "On the store's mail domain. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxAliasInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxAlias"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add an alias",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/aliases/{source}": {
      "delete": {
        "description": "The address must be on the store's mail domain. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "source",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Delete an alias",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/dns": {
      "get": {
        "description": "The records to publish, their live state and, on NeroCart's DNS, the change an apply would make. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxDNSInfo"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "The mail domain's DNS records",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/dns/apply": {
      "post": {
        "description": "On NeroCart's DNS only: writes MX, SPF, DKIM and a starter DMARC through the ready mail setup (an MX pointing elsewhere is replaced). Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailSetupPlan"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Write the mail records",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/domain": {
      "post": {
        "description": "Puts the store's live domain at Uzman Posta (organization, domain, DKIM); running it again changes nothing. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxDomain"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Set up the mail domain",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/groups": {
      "get": {
        "description": "Each with its members. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "groups": {
                          "items": {
                            "$ref": "#/components/schemas/MailMxGroup"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "The store domain's group addresses",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "post": {
        "description": "Mail to it goes to every member. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add a group address",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/groups/{email}": {
      "delete": {
        "description": "The address must be on the store's mail domain. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Delete a group address",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "put": {
        "description": "Replaces the members. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxMembersInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxGroup"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Set a group's members",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/logs": {
      "get": {
        "description": "kind=signin for sign-ins; else direction in|out (last 30 days, 100 at most), optionally one address. Right store.write.",
        "parameters": [
          {
            "description": "signin for sign-ins",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "signin",
                "mail"
              ],
              "type": "string"
            }
          },
          {
            "description": "",
            "in": "query",
            "name": "direction",
            "required": false,
            "schema": {
              "enum": [
                "in",
                "out"
              ],
              "type": "string"
            }
          },
          {
            "description": "an address of the store's domain",
            "in": "query",
            "name": "address",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxLogs"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "The store domain's mail and sign-in log",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes": {
      "post": {
        "description": "The free mailbox when it is still to come; otherwise a paid 1 GB mailbox waiting for payment. The password is answered once. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxMailboxInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMailboxCreated"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add a mailbox",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}": {
      "delete": {
        "description": "Deletes the mailbox and its mail at Uzman Posta. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a mailbox",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/folders": {
      "get": {
        "description": "Signed in as the mailbox. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MailMxFolder"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "A mailbox's folders",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/messages": {
      "get": {
        "description": "Newest first, a page at a time. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "folder_id",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "start",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "count",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMessagePage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "A folder's messages",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/messages/{mid}": {
      "get": {
        "description": "Marks it read at the provider. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMessage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Read a message",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/messages/{mid}/action": {
      "post": {
        "description": "read, unread, flag, unflag, trash, spam or unspam. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "mid",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxActionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxActionResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Mark or move a message",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/password": {
      "post": {
        "description": "An empty password generates one; the new password is answered once. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxPasswordInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxPasswordResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Set a mailbox password",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/rename": {
      "post": {
        "description": "Same domain; the mail, password and package stay. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxRenameInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMailbox"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Give a mailbox a new address",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/send": {
      "post": {
        "description": "From the mailbox, as plain text; reply_to answers a message. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxComposeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxActionResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Send a message",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/settings": {
      "get": {
        "description": "Name, auto-reply, a copy of incoming mail, signature, sending stopped, last sign-in. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMailboxSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "A mailbox's settings",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "put": {
        "description": "Only the fields given change; answers the settings fresh. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxMailboxSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMailboxSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Change a mailbox's settings",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/mailboxes/{id}/upgrade": {
      "post": {
        "description": "Records a request for a bigger package at the platform's price; NeroCart applies it once paid. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxUpgradeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxRequest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Ask for a bigger quota",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/moves": {
      "get": {
        "description": "The store domain's moves with their progress. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "moves": {
                          "items": {
                            "$ref": "#/components/schemas/MailMxMove"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Moves from the old mail server",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "post": {
        "description": "Copies an old mailbox's mail into one of the store's mailboxes over IMAP or POP3. Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxMoveInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxMove"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Move mail from the old server",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/moves/{id}": {
      "delete": {
        "description": "The move must be the store domain's. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Stop a move",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/overview": {
      "get": {
        "description": "The mail domain, the mailboxes with the quota in use, the packages on sale and whether the free mailbox is still to come. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The store's mail",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/requests": {
      "get": {
        "description": "Newest first. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MailMxRequest"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The store's mailbox requests",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/requests/{id}/cancel": {
      "post": {
        "description": "Only one still waiting for payment; a mailbox that waited for it goes. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxRequest"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Withdraw a request",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/requests/{id}/pay": {
      "post": {
        "description": "Readies a request waiting for payment for the operator store's checkout and answers the platform storefront address that puts it in the basket and opens the checkout with the method chosen (card: applied the moment the payment succeeds; bank_transfer: waits for NeroCart to confirm the money). A request with a transfer already placed is refused (409, reason transfer_placed). Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxPayInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxPayStart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Pay a request on NeroCart's store",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/senders": {
      "get": {
        "description": "The store domain's incoming rules. Right store.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "senders": {
                          "items": {
                            "$ref": "#/components/schemas/MailMxSender"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Senders always let in or refused",
        "tags": [
          "mail-mxlayer"
        ]
      },
      "post": {
        "description": "An address or a domain, let in (allow) or refused (block). Right store.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailMxSenderInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailMxSender"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add a sender rule",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/mail-mxlayer/senders/{id}": {
      "delete": {
        "description": "The rule must be the store domain's. Right store.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Delete a sender rule",
        "tags": [
          "mail-mxlayer"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/overview": {
      "get": {
        "description": "Every installed marketplace for this store: the credential fields, whether it is connected (never a secret), its settings and the counts worth a line (live, waiting, problems, orders needing attention, returns and questions waiting). Right: marketplace.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Marketplaces",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/brands": {
      "get": {
        "description": "The marketplace's brands by name (at least two letters, at most 30 answers). Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceBrand"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Brands."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Find brands",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/categories": {
      "get": {
        "description": "Leaf categories of the marketplace (cached a week): by words (q), or the five best suggestions for one of the store's categories (for) by plain word overlap. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A store category id.",
            "in": "query",
            "name": "for",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceCategoryHit"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Categories."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Find categories",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/categories/{external}/attributes": {
      "get": {
        "description": "What the marketplace asks of a product in one of its categories, with the values offered. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "external",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceAttribute"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Attributes."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Category attributes",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/category-maps": {
      "get": {
        "description": "Every store category with its product count and the marketplace category (and fixed attribute answers) it is mapped to. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceCategoryMap"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's categories."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Category maps",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/category-maps/{category}": {
      "delete": {
        "description": "Removes the map; listings already sent stay. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Unmap a category",
        "tags": [
          "marketplace"
        ]
      },
      "put": {
        "description": "Maps a store category (and the ones under it that have no map) to a leaf category of the marketplace, with the fixed answers to its required attributes (variant attributes come from each variant's options). Variants that waited for the map are queued again. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "attributes": {
                    "additionalProperties": {
                      "$ref": "#/components/schemas/MarketplaceAttrAnswer"
                    },
                    "type": "object"
                  },
                  "external_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "external_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCategoryMap"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The map."
          },
          "400": {
            "description": "Not a leaf (`details.reason` NOT_LEAF), a value the marketplace does not offer, or a required attribute missing (`details.reason` MISSING_ATTRIBUTE)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Map a category",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/claims": {
      "get": {
        "description": "The marketplace's returns, waiting ones first, and (when one waits) the reasons a refusal may give. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceClaims"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Returns."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Returns",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/claims/{id}/approve": {
      "post": {
        "description": "Accepts every waiting item of the return on the marketplace. The goods are received on the order's return screen when they arrive. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Accepted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Accept a return",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/claims/{id}/reject": {
      "post": {
        "description": "Opens a refusal on the marketplace with a reason and an explanation. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "reason_id": {
                    "type": "string"
                  },
                  "text": {
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "required": [
                  "reason_id",
                  "text"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Sent."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Refuse a return",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/connect": {
      "post": {
        "description": "Checks the pasted credentials with one call to the marketplace, then stores them sealed (never returned) and starts the first sync. A refusal stores nothing. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "credentials": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "By the card's field keys (Trendyol: seller_id, api_key, api_secret).",
                    "type": "object"
                  },
                  "sandbox": {
                    "description": "The marketplace's test environment, when the card offers one.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "credentials"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The marketplace's card."
          },
          "400": {
            "description": "A field is missing (`details.reason` MISSING, `details.field`)."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Connect a marketplace",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/disconnect": {
      "post": {
        "description": "Forgets the credentials and stops every job for this store; listings and orders stay as history. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The marketplace's card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Disconnect",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/listings": {
      "post": {
        "description": "list: queues every variant of the products to be sent (refused or failed ones are sent again; stopped ones sell again). stop: stops selling (quantity 0 on the marketplace); never-sent ones are dropped. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "action": {
                    "enum": [
                      "list",
                      "stop"
                    ],
                    "type": "string"
                  },
                  "product_ids": {
                    "items": {
                      "type": "integer"
                    },
                    "maxItems": 500,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "product_ids",
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "changed": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "changed"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "How many variants changed."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected."
          }
        },
        "summary": "List or stop products",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/orders": {
      "get": {
        "description": "Marketplace orders that could not become orders here: stock short (retried every minute) or a line that names nothing the store sells. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceOrder"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Orders."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Orders that need the store",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/orders/{id}/unsupplied": {
      "post": {
        "description": "Tells the marketplace the store cannot supply the order (it cancels and refunds its customer) and cancels it here. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "reason_id": {
                    "description": "One of the card's cancel_reasons.",
                    "type": "string"
                  }
                },
                "required": [
                  "reason_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Reported."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Cannot supply",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/products": {
      "get": {
        "description": "The store's products, each with one status line on this marketplace and the price it is asked. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "category",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceProduct"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Products on the marketplace",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/products/{product}/price": {
      "put": {
        "description": "Sets (or, with null or 0, removes) the product's price on the marketplace, overriding the rule. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "product",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "price_minor": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Saved."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "A product's own price",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/questions": {
      "get": {
        "description": "Questions about the store's products, waiting ones first. Right: marketplace.read.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/MarketplaceQuestion"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Questions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Customer questions",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/questions/{id}/answer": {
      "post": {
        "description": "Sends the answer (10–2000 characters). Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "text": {
                    "maxLength": 2000,
                    "minLength": 10,
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Sent."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Answer a question",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/settings": {
      "put": {
        "description": "Price rule, stock buffer, default brand, delivery promise; every live listing's price and quantity is sent again. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketplaceSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The marketplace's card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected."
          }
        },
        "summary": "Save settings",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/sync": {
      "post": {
        "description": "Queues a sync pass (orders, listings, stock and prices, invoices, returns, questions). Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The marketplace's card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          }
        },
        "summary": "Sync now",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/marketplace/{code}/test": {
      "post": {
        "description": "Calls the marketplace with the stored credentials and records the result. Right: marketplace.write.",
        "parameters": [
          {
            "description": "The marketplace's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "example": "trendyol",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MarketplaceCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The marketplace's card."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such marketplace (or record)."
          },
          "409": {
            "description": "Not connected (`details.reason` NOT_CONNECTED) or the marketplace refused: `details.reason` is AUTH, FORBIDDEN, RATE_LIMITED, UNAVAILABLE, INVALID, NOT_FOUND, CONFLICT or UNKNOWN, `details.message` the marketplace's own words."
          }
        },
        "summary": "Test the connection",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/bing/connect": {
      "post": {
        "description": "Stores the pasted API key (sealed plugin secret) when given, then reconciles: adopts the site when Bing already lists it, adds it otherwise (an 'already exists' answer re-reads the list), skips verification when Bing says verified, else publishes Bing's msvalidate.01 token and asks Bing to verify; submits the sitemap when asked; reads the crawl summary. Right: search-engines.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "api_key": {
                    "description": "From Bing Webmaster Tools › Settings › API access. Never returned.",
                    "type": "string"
                  },
                  "submit_sitemap": {
                    "description": "Submit the storefront's /sitemap.xml once the site is verified (skipped when the engine already lists it).",
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A precondition is missing (`NO_KEY`, `NOT_CONFIGURED`)."
          }
        },
        "summary": "Connect Bing Webmaster",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/bing/disconnect": {
      "post": {
        "description": "Removes the stored API key. The site at Bing, its verification and the published tag stay. Right: search-engines.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Forget the Bing key",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/indexnow": {
      "post": {
        "description": "On: generates the store's IndexNow key when it has none and switches the IndexNow plugin on (the storefront serves /{key}.txt; page changes are submitted to api.indexnow.org at most once per 5 minutes). Off: nothing is queued or sent. Right: search-engines.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Switch IndexNow",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/overview": {
      "get": {
        "description": "IndexNow, Bing and Yandex for this store: one state per engine (`not_connected`, `verifying`, `verified`, `failed`), the site, the sitemap, a summary and a problem code. No key or token. Right: search-engines.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Search engine status",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/yandex/disconnect": {
      "post": {
        "description": "Forgets NeroCart's copy of the Yandex grant. The host at Yandex, its verification and the published tag stay. Right: search-engines.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Forget the Yandex grant",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/yandex/start": {
      "post": {
        "description": "Returns Yandex's consent page URL (scopes webmaster:hostinfo webmaster:verify, PKCE S256, single-use state for 10 minutes). The owner signs in on Yandex's own page. Right: search-engines.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "submit_sitemap": {
                    "description": "Submit the storefront's /sitemap.xml once the site is verified (skipped when the engine already lists it).",
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesAuthorization"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The authorization URL."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "A precondition is missing (`NO_KEY`, `NOT_CONFIGURED`)."
          }
        },
        "summary": "Start the Yandex sign-in",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/search-engines/{engine}/check": {
      "post": {
        "description": "Runs the engine's reconciliation now (adopt or add the site, verify when needed, sitemap, summary). Right: search-engines.write.",
        "parameters": [
          {
            "in": "path",
            "name": "engine",
            "required": true,
            "schema": {
              "enum": [
                "bing",
                "yandex"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "submit_sitemap": {
                    "description": "Submit the storefront's /sitemap.xml once the site is verified (skipped when the engine already lists it).",
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SearchEnginesOverview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's search engine cards."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No such engine."
          }
        },
        "summary": "Check an engine now",
        "tags": [
          "search-engines"
        ]
      }
    },
    "/api/v1/admin/x/shipping-aras/test": {
      "post": {
        "description": "Asks Aras Kargo's booking service (GetBarcode) for the label of an integration code that does not exist, with the saved web service user — and, when the customer code is saved, its tracking service (GetQueryJSON) about the same code — whether or not the carrier is switched on yet. Nothing is booked at Aras Kargo and nothing is stored. `ok` is true when Aras Kargo accepted the credentials; otherwise `error` carries Aras Kargo's words, never a password. 409 when the required credentials are not saved yet. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ArasTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether Aras Kargo accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the Aras Kargo connection",
        "tags": [
          "shipping-aras"
        ]
      }
    },
    "/api/v1/admin/x/shipping-mng/test": {
      "post": {
        "description": "Asks MNG's Identity API (POST /mngapi/api/token) for a new token with the saved API Zone application, customer number and password, whether or not the carrier is switched on yet. Nothing is booked at MNG Kargo and nothing is stored. `ok` is true when MNG Kargo accepted the credentials; otherwise `error` carries MNG Kargo's words, never a password. 409 when the required credentials are not saved yet. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MNGTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether MNG Kargo accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the MNG Kargo connection",
        "tags": [
          "shipping-mng"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ptt/test": {
      "post": {
        "description": "Asks PTT's tracking service (GonderiTakipV2 gonderiSorgu_referansNo) about a reference that does not exist, with the saved customer number and password (or the tracking user), and checks the saved barcode range, whether or not the carrier is switched on yet. Nothing is booked at PTT Kargo and nothing is stored. `ok` is true when PTT Kargo accepted the credentials; otherwise `error` carries PTT Kargo's words, never a password. 409 when the required credentials are not saved yet. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PTTTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether PTT Kargo accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the PTT Kargo connection",
        "tags": [
          "shipping-ptt"
        ]
      }
    },
    "/api/v1/admin/x/shipping-surat/test": {
      "post": {
        "description": "Asks Sürat Kargo's web service (KargoBarkodu) for the label of a tracking key that does not exist, with the saved customer code and web password, whether or not the carrier is switched on yet. Nothing is booked at Sürat Kargo and nothing is stored. `ok` is true when Sürat Kargo accepted the credentials; otherwise `error` carries Sürat Kargo's words, never a password. 409 when the required credentials are not saved yet. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SuratTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether Sürat Kargo accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the Sürat Kargo connection",
        "tags": [
          "shipping-surat"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/bulk": {
      "post": {
        "description": "Books one UPS shipment per order (up to 25), each exactly as the single ship action does, and reports each order on its own: its tracking number, or why it was not booked. A failure on one order changes nothing on it and does not stop the others. Right: orders.fulfill.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "order_ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "type": "array"
                  },
                  "service": {
                    "description": "A UPS service key; empty is the store's default.",
                    "type": "string"
                  }
                },
                "required": [
                  "order_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "results": {
                          "items": {
                            "properties": {
                              "error": {
                                "type": "string"
                              },
                              "number": {
                                "type": "string"
                              },
                              "ok": {
                                "type": "boolean"
                              },
                              "order_id": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "tracking": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "One result per order."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Create UPS shipments for several orders",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/connect": {
      "post": {
        "description": "Asks UPS for an OAuth token with the given client id and secret (empty values keep what is stored). Only when UPS issues one are the credentials sealed and saved and the integration switched on; a refusal answers `ups_credentials_refused` and saves nothing. Right: shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "account_number": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "environment": {
                    "enum": [
                      "test",
                      "production"
                    ],
                    "type": "string"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "account_number": {
                          "type": "string"
                        },
                        "checkout_rates": {
                          "type": "boolean"
                        },
                        "default_service": {
                          "type": "string"
                        },
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "environment": {
                          "enum": [
                            "test",
                            "production"
                          ],
                          "type": "string"
                        },
                        "label_format": {
                          "enum": [
                            "pdf",
                            "zpl"
                          ],
                          "type": "string"
                        },
                        "services": {
                          "items": {
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "state": {
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "environment",
                        "default_service",
                        "services",
                        "checkout_rates",
                        "label_format"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The UPS status."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "UPS did not accept the credentials."
          },
          "502": {
            "description": "UPS could not be reached."
          }
        },
        "summary": "Connect UPS",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/disconnect": {
      "post": {
        "description": "Forgets the client id and secret and switches the integration off. Shipments already booked keep their labels. Right: shipping.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "account_number": {
                          "type": "string"
                        },
                        "checkout_rates": {
                          "type": "boolean"
                        },
                        "default_service": {
                          "type": "string"
                        },
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "environment": {
                          "enum": [
                            "test",
                            "production"
                          ],
                          "type": "string"
                        },
                        "label_format": {
                          "enum": [
                            "pdf",
                            "zpl"
                          ],
                          "type": "string"
                        },
                        "services": {
                          "items": {
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "state": {
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "environment",
                        "default_service",
                        "services",
                        "checkout_rates",
                        "label_format"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The UPS status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Disconnect UPS",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/domestic/connect": {
      "post": {
        "description": "Proves UPS Türkiye's web service user by opening a session (ws.ups.com.tr), then saves it: parcels within Türkiye, cash on delivery included, are booked through UPS Türkiye. An empty password keeps the stored one. 422 ups_tr_credentials_refused, 502 ups_unreachable. Right: shipping.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "customer_number": {
                    "type": "string"
                  },
                  "expense_code": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "username": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "account_number": {
                          "type": "string"
                        },
                        "checkout_rates": {
                          "type": "boolean"
                        },
                        "default_service": {
                          "type": "string"
                        },
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "environment": {
                          "enum": [
                            "test",
                            "production"
                          ],
                          "type": "string"
                        },
                        "label_format": {
                          "enum": [
                            "pdf",
                            "zpl"
                          ],
                          "type": "string"
                        },
                        "services": {
                          "items": {
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "state": {
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "environment",
                        "default_service",
                        "services",
                        "checkout_rates",
                        "label_format"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The UPS status."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "UPS did not accept the credentials."
          },
          "502": {
            "description": "UPS could not be reached."
          }
        },
        "summary": "Connect UPS Türkiye domestic",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/domestic/disconnect": {
      "post": {
        "description": "Forgets UPS Türkiye's web service user; the integration stays on while the developer.ups.com app is connected. Right: shipping.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "account_number": {
                          "type": "string"
                        },
                        "checkout_rates": {
                          "type": "boolean"
                        },
                        "default_service": {
                          "type": "string"
                        },
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "environment": {
                          "enum": [
                            "test",
                            "production"
                          ],
                          "type": "string"
                        },
                        "label_format": {
                          "enum": [
                            "pdf",
                            "zpl"
                          ],
                          "type": "string"
                        },
                        "services": {
                          "items": {
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "state": {
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "environment",
                        "default_service",
                        "services",
                        "checkout_rates",
                        "label_format"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The UPS status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Disconnect UPS Türkiye domestic",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-ups/status": {
      "get": {
        "description": "One state (`connected` or `not_connected`), the environment, the UPS account number, the services a shipment can be booked with and the store's defaults. Never a credential. Right: orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "account_number": {
                          "type": "string"
                        },
                        "checkout_rates": {
                          "type": "boolean"
                        },
                        "default_service": {
                          "type": "string"
                        },
                        "domestic": {
                          "description": "UPS Türkiye's domestic service (parcels within Türkiye, cash on delivery).",
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        },
                        "domestic_customer": {
                          "description": "The UPS Türkiye customer number, when connected.",
                          "type": "string"
                        },
                        "environment": {
                          "enum": [
                            "test",
                            "production"
                          ],
                          "type": "string"
                        },
                        "label_format": {
                          "enum": [
                            "pdf",
                            "zpl"
                          ],
                          "type": "string"
                        },
                        "services": {
                          "items": {
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "state": {
                          "enum": [
                            "connected",
                            "not_connected"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "environment",
                        "default_service",
                        "services",
                        "checkout_rates",
                        "label_format"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The UPS status."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "UPS connection status",
        "tags": [
          "shipping-ups"
        ]
      }
    },
    "/api/v1/admin/x/shipping-yurtici/test": {
      "post": {
        "description": "Asks Yurtiçi Kargo's web service (queryShipment) about a cargo key that does not exist, with the saved web service user — and the cash-on-delivery user when one is saved — whether or not the carrier is switched on yet. Nothing is booked at Yurtiçi Kargo and nothing is stored. `ok` is true when Yurtiçi Kargo accepted the credentials; otherwise `error` carries Yurtiçi Kargo's words, never a password. 409 when the required credentials are not saved yet. Needs plugins.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/YurticiTestResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Whether Yurtiçi Kargo accepted the credentials."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "adminToken": []
          }
        ],
        "summary": "Test the Yurtiçi Kargo connection",
        "tags": [
          "shipping-yurtici"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/check": {
      "get": {
        "description": "Journals balance; the seller's book equals the order snapshots; the supplier's book equals its supply orders; confirmed payments are posted once. Right supply-ledger.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Diagnostic"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The supply ledger's consistency checks",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/payments/{id}/confirm": {
      "post": {
        "description": "Confirms a payment a seller recorded: posted in both books. Idempotent. Right supply-ledger.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayment"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Ödemeyi onayla (supplier)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/payments/{id}/dispute": {
      "post": {
        "description": "An open flag with a note the seller sees; a confirmed payment cannot be disputed. Right supply-ledger.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "note": {
                    "maxLength": 500,
                    "type": "string"
                  }
                },
                "required": [
                  "note"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayment"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Dispute a payment (supplier)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/sellers": {
      "get": {
        "description": "What each seller owes this business, per currency, over an optional period. Right supply-ledger.read.",
        "parameters": [
          {
            "description": "First day (Türkiye's calendar), included.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, included.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyBalance"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Alacaklarım (supplier)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/sellers/{id}": {
      "get": {
        "description": "{id} is the seller's tenant. Right supply-ledger.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "First day (Türkiye's calendar), included.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, included.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "required": false,
            "schema": {
              "default": "TRY",
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyStatement"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A seller's statement (supplier)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/suppliers": {
      "get": {
        "description": "What this store owes each supplier, per currency, over an optional period: brought forward, orders, cancellations, confirmed payments, carried; payments awaiting the supplier's confirmation beside. Right supply-ledger.read.",
        "parameters": [
          {
            "description": "First day (Türkiye's calendar), included.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, included.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyBalance"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Tedarikçi bakiyeleri (seller)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/suppliers/{id}": {
      "get": {
        "description": "Movements with a running balance and the recorded payments; {id} is the supplier's tenant. Right supply-ledger.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "First day (Türkiye's calendar), included.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Last day, included.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "currency",
            "required": false,
            "schema": {
              "default": "TRY",
              "pattern": "^[A-Z]{3}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyStatement"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A supplier's statement (seller)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/ledger/suppliers/{id}/payments": {
      "post": {
        "description": "Records a bank transfer the store made to the supplier; the supplier confirms or disputes it. Nothing moves money. Refused (409) under the platform PSP mode. Right supply-ledger.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyPaymentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayment"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Ödeme yapıldı (seller)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/catalog": {
      "get": {
        "description": "The network catalogue in the platform operator's tenant, by category, company, search and filters; each card priced by the store's rule. Right supply-network.read.",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "supplier",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "in_stock",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "min_cost",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "max_cost",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyCatalogCard"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Keşfet",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/catalog/{id}": {
      "get": {
        "description": "One entry with its description. Right supply-network.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyCatalogCard"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A catalogue entry",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/catalog/{id}/add": {
      "post": {
        "description": "Copies the entry into the store as a draft product priced by the store's rule, routes it to the supplier's offer and asks for the grant on the standard terms. Right supply-network.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProductLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Mağazama ekle",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/catalog/{id}/media/{n}": {
      "get": {
        "description": "The n-th picture of an entry (the supplier's stored image, or a redirect to its https address). Right supply-network.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "path",
            "name": "n",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "image/*": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The image."
          },
          "302": {
            "description": "An external picture."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A catalogue picture",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/categories": {
      "get": {
        "description": "The network category tree or a search. Right supply-network.read.",
        "parameters": [
          {
            "description": "A category id; empty lists the top level.",
            "in": "query",
            "name": "parent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search by name.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyNetworkCategory"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Network categories",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/category-map": {
      "get": {
        "description": "Network category → the store's own category. Right supply-network.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyCategoryMapping"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Category mapping",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "category_id 0 removes the mapping. Right supply-network.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyCategoryMapping"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyCategoryMapping"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Map a category",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/category-tree": {
      "get": {
        "description": "Children of a category that hold entries, with counts. Right supply-network.read.",
        "parameters": [
          {
            "in": "query",
            "name": "parent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "supplier",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyNetworkCategory"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Browse tree",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/companies": {
      "get": {
        "description": "The catalogue's company index. Right supply-network.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyCompany"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Supplier companies",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links": {
      "get": {
        "description": "The store's supply products with price, breakdown and warnings. Right supply-network.read.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "supplier",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "needs_review",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyProductLink"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Mağazamdakiler",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links/{id}": {
      "get": {
        "description": "One supply product of the store. Right supply-network.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProductLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A supply product",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links/{id}/accept-suggestion": {
      "post": {
        "description": "Applies the price a cost change queued for review. Right supply-network.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProductLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Accept the suggested price",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links/{id}/breakdown": {
      "get": {
        "description": "The breakdown at a price (default: the current one) or at the price a profit target needs. Right supply-network.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "price",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Net margin in minor units.",
            "in": "query",
            "name": "target_margin",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "Net margin as basis points of the retail net.",
            "in": "query",
            "name": "target_margin_bp",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyLinkBreakdown"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Price breakdown",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links/{id}/price": {
      "put": {
        "description": "Writes the price through the kernel (price.changed). Right supply-network.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "price_minor": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "price_minor"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProductLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Set the retail price",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/links/{id}/publish": {
      "post": {
        "description": "Puts the seller's copy on sale once the supplier has accepted; sold through the network's checkout. Right supply-network.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProductLink"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Publish an imported product",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/orders/{order}": {
      "get": {
        "description": "The seller's order page: one group per supplier with its status, lines as sold, margin snapshot and any refund. Right supply-network.read.",
        "parameters": [
          {
            "in": "path",
            "name": "order",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyOrderGroup"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "An order's supply groups",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/rules": {
      "get": {
        "description": "The store's pricing rules, most specific first. Right supply-network.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyRule"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Pricing rules",
        "tags": [
          "supply"
        ]
      },
      "post": {
        "description": "Creates or replaces the rule of a scope. Right supply-network.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyRule"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyRule"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Save a pricing rule",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/rules/{id}": {
      "delete": {
        "description": "Right supply-network.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a pricing rule",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/settings": {
      "get": {
        "description": "Ayarlar › Tedarik: default markup, rounding, minimum margin, how cost changes apply. Right supply-network.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplySellerSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Supply settings",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "Right supply-network.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplySellerSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplySellerSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Save supply settings",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/network/terms": {
      "get": {
        "description": "The standard terms and fee inputs in force (defaults while the platform has set none). Right supply-network.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyTerms"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Network terms",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers": {
      "get": {
        "description": "This business's products, a row per variant, with each variant's offer. Right supply-offers.read.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The view: network (an offer open on the network), ready (a draft or paused offer) or missing (no offer yet). Absent lists every variant.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "network",
                "ready",
                "missing"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyOfferRow"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Ürünlerim",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/categories": {
      "get": {
        "description": "The network category tree (children of parent) or a search. Right supply-offers.read.",
        "parameters": [
          {
            "description": "A category id; empty lists the top level.",
            "in": "query",
            "name": "parent",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search by name.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyNetworkCategory"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Network categories",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/variants/{variant}": {
      "get": {
        "description": "The \"Ağda sat\" panel: the offer (or null), warehouses, supplier status, terms. Right supply-offers.read.",
        "parameters": [
          {
            "in": "path",
            "name": "variant",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyVariantOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A variant's offer",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "Creates or edits the offer; a published offer's change bumps its version and is replicated. Needs an approved supplier. Right supply-offers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "variant",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyOfferInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyVariantOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Save a variant's offer",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/{id}/pause": {
      "post": {
        "description": "active → paused: off the catalogue, nothing new sold. Right supply-offers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Pause an offer",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/{id}/publish": {
      "post": {
        "description": "draft/paused → active; needs a price, a warehouse and a network category. Right supply-offers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Put an offer on the network",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/{id}/resume": {
      "post": {
        "description": "paused → active. Right supply-offers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Resume an offer",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/offers/{id}/retire": {
      "post": {
        "description": "→ retired (final): withdrawn from the catalogue and from every seller. Right supply-offers.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOffer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Retire an offer",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders": {
      "get": {
        "description": "Orders sellers placed for this business's network products, those awaiting acceptance first. Right supply-orders.read.",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "awaiting_acceptance",
                "accepted",
                "rejected",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyOrder"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Siparişler (supplier)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/settings": {
      "get": {
        "description": "Automatic acceptance and the acceptance deadline. Right supply-orders.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrderSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Supply order settings",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "Right supply-orders.write; the business must be an approved supplier.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyOrderSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrderSettings"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Save supply order settings",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}": {
      "get": {
        "description": "Right supply-orders.read.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One supply order",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}/accept": {
      "post": {
        "description": "Tells the seller (supply_order.accepted). Right supply-orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Accept a supply order",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}/handed-over": {
      "post": {
        "description": "The supplier handed the labelled parcel to the courier: the seller's order is shipped (supply_shipment.handed_over). Idempotent. Right supply-orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Kargoya verdim",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}/label": {
      "get": {
        "description": "Redeems a print link (xtenant.FetchLabel): sender = the seller's store, origin = the supplier's warehouse, the shipment code as a Code 128 barcode, the destination's district and province; an L2 label adds the recipient's name and address, never a phone or an e-mail. Recorded in the seller's and the supplier's trails. Right supply-orders.read and the token.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The label."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The print link is unknown, used or expired."
          }
        },
        "summary": "The label (SVG)",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}/label-token": {
      "post": {
        "description": "Issues a single-use link to the order's label, valid for two minutes; recorded in the supplier's trail. Right supply-orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyLabelToken"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "A label print link",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/orders/{id}/reject": {
      "post": {
        "description": "The units go back on the shelf; the seller refunds the shopper (supply_order.rejected). Right supply-orders.write.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyOrder"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Reject a supply order",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/payout-account": {
      "get": {
        "description": "The business's payout account at the payment institution under mode P, its one status in plain Turkish and what is missing. Right supply-payouts.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayoutAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Ödeme hesabı",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "The business kind and the authorised person (TCKN sealed). Right supply-payouts.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyPayoutAccountInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayoutAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Ödeme hesabı bilgileri",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/payout-account/open": {
      "post": {
        "description": "Sends the business to the payment institution as a sub-merchant of the platform's marketplace account (created, or updated). Right supply-payouts.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayoutAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Ödeme hesabını aç",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/payouts": {
      "get": {
        "description": "This business's items held at the institution: Hesabınıza geçecek / geçti, with dates. Right supply-payouts.read.",
        "parameters": [
          {
            "description": "at most 500",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyPayoutSummary"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "Ödemelerim",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/profile": {
      "get": {
        "description": "This business's application to supply the network and where it stands (right supplier.read).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The supplier application and capabilities",
        "tags": [
          "supply"
        ]
      },
      "put": {
        "description": "Saves a draft; refused (409) while the platform reviews it. Right supplier.write.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Save the supplier application",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/profile/documents": {
      "post": {
        "description": "A tax certificate, identity copy or signature circular, kept private (G-07, KVKK): never in the media library, never at a public address, never swept. multipart/form-data with `file`: a PDF without scripts, embedded files or automatic actions, or a JPEG, PNG or WebP picture (its EXIF, GPS and text metadata removed); at most 10 MiB and 10 documents per application. Refused (409) while the platform reviews the application. Right supplier.write.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyApplicationDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Kept."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add a document to the supplier application",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/profile/documents/{id}": {
      "delete": {
        "description": "Deletes the document for good. Refused (409) while the platform reviews the application. Right supplier.write.",
        "parameters": [
          {
            "description": "The document's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Remove a document from the application",
        "tags": [
          "supply"
        ]
      },
      "get": {
        "description": "The business's own document, privately (never cached). Right supplier.read.",
        "parameters": [
          {
            "description": "The document's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/jpeg": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/webp": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The document as a download: `Content-Disposition: attachment`, `Cache-Control: private, no-store`, nosniff and a sandboxing CSP."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Download one of the application's documents",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/profile/submit": {
      "post": {
        "description": "Checks the application is complete (company, tax number and office, address, contact, IBAN, at least one document) and asks the platform to approve it: the supplier capability becomes pending_approval. Right supplier.write.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyProfileView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Send the supplier application",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/score": {
      "get": {
        "description": "This supplier's score (shipping time, returns, complaints over the last 90 days), when it fell under the network's threshold and whether it dropped out of the shared catalog (ADR-0141). Right supplier.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SupplyScore"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The supplier's catalog score",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/supply/trail": {
      "get": {
        "description": "What the network did in this business: application edits, the platform reading the application (who, when), holds taken for sellers, notices received. Newest first, at most 100. Right supplier.read.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SupplyTrailEntry"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The supply network trail",
        "tags": [
          "supply"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/deliveries": {
      "get": {
        "description": "One row per event per endpoint. `state` is derived from the worker's own columns: pending, delivered, or dead once the attempts ran out.",
        "parameters": [
          {
            "in": "query",
            "name": "endpoint_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "enum": [
                "pending",
                "delivered",
                "dead"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of deliveries."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The delivery log",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/deliveries/{id}/retry": {
      "post": {
        "description": "The only useful thing to do with one that gave up. It resets the attempt count as well as clearing the flag: a retry an operator asked for is a fresh start, not attempt thirteen of twelve. A delivery that already succeeded is not found.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "queued": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Queued."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Queue a delivery again",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/endpoints": {
      "get": {
        "description": "The signing secret is never in this response. `secret_hint` is its last four characters, which is enough to tell two endpoints apart and not enough to sign with.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Offset"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of endpoints."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "Registered endpoints",
        "tags": [
          "webhooks"
        ]
      },
      "post": {
        "description": "The only response that carries the secret in full, along with the one from rotate-secret. Store it now: no later read returns it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "default": true,
                    "type": "boolean"
                  },
                  "events": {
                    "description": "Exact names (`order.paid`), a prefix (`order.*`) or `*`.",
                    "example": [
                      "order.*"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "url": {
                    "description": "An absolute http or https URL.",
                    "example": "https://merchant.example.com/hooks",
                    "type": "string"
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Created, with the secret."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "Register an endpoint",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/endpoints/{id}": {
      "delete": {
        "description": "Its delivery log goes with it: the log records what this store told that endpoint, and the endpoint no longer exists.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Deleted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove an endpoint",
        "tags": [
          "webhooks"
        ]
      },
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The endpoint."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One endpoint",
        "tags": [
          "webhooks"
        ]
      },
      "patch": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean"
                  },
                  "events": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The updated endpoint."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Change an endpoint's url, events or active flag",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/endpoints/{id}/rotate-secret": {
      "post": {
        "description": "So that a leaked secret has an answer other than deleting the endpoint. Deliveries already queued are signed with the new secret when they are sent. The replaced secret keeps signing beside the new one for an overlap window (24 hours by default, `overlap_seconds` to change it for this rotation, 0 to end it at once): during the window X-NeroCart-Signature carries two `v1=` values, `t=\u003cts\u003e,v1=\u003cnew\u003e,v1=\u003cprevious\u003e`, and a receiver accepts the request when any `v1=` matches the secret it holds. Only one previous secret is kept; a second rotation inside the window replaces it.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "overlap_seconds": {
                    "description": "How long the replaced secret still signs, in seconds. Omitted: the module's configured window (24 hours by default). 0: not at all.",
                    "format": "int64",
                    "maximum": 604800,
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpointWithSecret"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The endpoint, with its new secret."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Issue a new signing secret",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/admin/x/webhooks/endpoints/{id}/test": {
      "post": {
        "description": "Sends one `webhook.test` event to the endpoint now, signed with its secret exactly as a real delivery (X-NeroCart-Signature and the other X-NeroCart-* headers), and answers what the endpoint said and how long it took. Nothing is queued, retried or written to the delivery log.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "duration_ms": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "error": {
                          "type": "string"
                        },
                        "event_id": {
                          "type": "string"
                        },
                        "ok": {
                          "type": "boolean"
                        },
                        "status": {
                          "description": "The endpoint's HTTP status; absent when it could not be reached.",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "ok",
                        "duration_ms",
                        "event_id"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The outcome; `ok` is false when the endpoint could not be reached or answered outside 2xx."
          },
          "404": {
            "description": "No such endpoint in this store."
          }
        },
        "summary": "Send a test delivery",
        "tags": [
          "webhooks"
        ]
      }
    },
    "/api/v1/store/address/place": {
      "get": {
        "deprecated": true,
        "description": "Retired 2026-10-29 (owner): the Google address help is removed and this operation is no longer served (404). Kept here for the v1 contract only. The address of a suggested place (Places API (New) Place Details with the address fields only), mapped onto the checkout form: for Türkiye `state` is the il, `city` the ilçe, and `line1` the mahalle with the street and `No:` building number; `line2` a subpremise. Kept briefly per store. A Google failure is `address: null`.",
        "parameters": [
          {
            "description": "The suggestion's place_id.",
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The autocomplete session token the storefront made for this address entry (8-36 URL-safe characters), passed to Google to group the calls for billing. Anything else is ignored.",
            "in": "query",
            "name": "session",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The visitor's cart token: an open cart of this store.",
            "in": "query",
            "name": "cart",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AddressPlace"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The address, or null."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`address_assist_off`: the store has not switched the address help on (plugin off, no API key, or this half off); `not_found`: no open cart with this token."
          },
          "429": {
            "description": "Too many address lookups from this client (per store and address, and per cart); retry after the Retry-After seconds."
          }
        },
        "summary": "One suggestion's address, as checkout form fields",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/address/suggest": {
      "get": {
        "deprecated": true,
        "description": "Retired 2026-10-29 (owner): the Google address help is removed and this operation is no longer served (404). Kept here for the v1 contract only. Up to five addresses matching what was typed, from Google Maps Platform's Places API (New) Autocomplete, called by the kernel with the store's own key (ADR-0048); the browser never calls Google. Limited to the countries of the store's google-maps-address plugin, and to `country` when it is one of them (another country gets none). A query under three characters, or any Google failure, is an empty list, not an error. Needs an open cart. The query is never logged.",
        "parameters": [
          {
            "description": "What the shopper typed in the address line (3-200 characters).",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The autocomplete session token the storefront made for this address entry (8-36 URL-safe characters), passed to Google to group the calls for billing. Anything else is ignored.",
            "in": "query",
            "name": "session",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The visitor's cart token: an open cart of this store.",
            "in": "query",
            "name": "cart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The address's country (ISO 3166-1 alpha-2), to narrow the suggestions.",
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AddressSuggestions"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The suggestions (possibly none)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`address_assist_off`: the store has not switched the address help on (plugin off, no API key, or this half off); `not_found`: no open cart with this token."
          },
          "429": {
            "description": "Too many address lookups from this client (per store and address, and per cart); retry after the Retry-After seconds."
          }
        },
        "summary": "Address suggestions as the shopper types (Google Places)",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/address/validate": {
      "post": {
        "deprecated": true,
        "description": "Retired 2026-10-29 (owner): the Google address help is removed and this operation is no longer served (404). Kept here for the v1 contract only. Asks Google's Address Validation API about the address and answers a hint: `CONFIRMED`, `UNCONFIRMED`, `SUSPICIOUS` (with the suspicious component types) or `UNKNOWN` (the country is not one of the plugin's, or Google could not answer), and Google's corrected address as form fields when it differs from what was typed. Checkout never consults it: the shopper may place the order whatever it says. Needs an open cart; the address is never logged.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressValidateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AddressValidation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The verdict."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`address_assist_off`: the store has not switched the address help on (plugin off, no API key, or this half off); `not_found`: no open cart with this token."
          },
          "429": {
            "description": "Too many address lookups from this client (per store and address, and per cart); retry after the Retry-After seconds."
          }
        },
        "summary": "Check an address before the order is placed (Google Address Validation)",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/affiliates/{code}/click": {
      "post": {
        "description": "The storefront calls it when its partner link is opened. 404 for no active partner with the code.",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Counted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Count an opening of a partner's link",
        "tags": [
          "marketing"
        ]
      }
    },
    "/api/v1/store/assistant/chat": {
      "post": {
        "description": "A visitor's question with the conversation before it (kept by the browser only; at most the last 10 turns are read, each at most 1000 characters, the question last). The answer is grounded on the server: one AI call turns the conversation into searches, the store's own catalogue search runs them (published products, in stock first, priced in the request's market and language; a dealers-only price is never shown), and a second AI call writes a short answer from those facts alone, checked again — product cards only for products the search found, no price the facts do not hold, no health claim. With the store's AI budget spent or the provider failing, the answer is the plain search results with a polite line (fallback true). Uses the store's own AI key only. Nothing the visitor wrote is logged or stored; the store keeps monthly counters. A question about an order already placed (its status, where the parcel is, tracking) is never answered by the AI: the answer asks for the order number and the e-mail address used at checkout (ask_order true), which the chat sends back in the request's own `order` field. With `order` the request is an order lookup, answered from a template without the AI: the store's order with both matching (the e-mail ignoring case and spaces, the number with or without its prefix, #, dashes or spaces), else one generic not-found line; at most 5 lookups per 15 minutes per visitor and per address, and an order number is refused for 15 minutes after 5 failed attempts. The found order carries no address, name, phone, price or payment detail; neither value is logged. The answer is written in the language the visitor writes in (`language`), the product cards in the page's.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssistantChatInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AssistantAnswer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The answer."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`assistant_off`: the store has not switched the shopping assistant on, or has no AI key of its own."
          },
          "429": {
            "description": "Too many questions from this visitor, this address or for this store, too many order lookups, or an order number locked after failed attempts; retry after the Retry-After seconds."
          }
        },
        "summary": "Ask the store's shopping assistant",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/brands": {
      "get": {
        "description": "Each vendor of an active, listed product, with its page address, logo and words when saved; by name.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Brand"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The brands."
          }
        },
        "summary": "The brands of the store's products",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/builder/templates/{ref}": {
      "get": {
        "description": "The storefront draws a template before it is inserted (the editor's preview at three widths, ADR-0085 VB-7): its sections with library pictures at their current address. Only under a valid preview token of the store and with vb_kits; never cached.",
        "parameters": [
          {
            "description": "starter:\u003cid\u003e or own:\u003cid\u003e.",
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Two-letter language the starters are written in (default tr; a language they lack reads English).",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A preview token of the store (the editor's frame).",
            "in": "query",
            "name": "preview",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreBuilderTemplatePreview"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A template for the editor's preview",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/cart-recovery/restore": {
      "post": {
        "description": "The basket to put back in the browser (its token, for the storefront's own HttpOnly cookie), its market and the discount code to apply. 404 LINK_EXPIRED: unknown or older than 14 days; 404 CART_GONE; 409 ALREADY_ORDERED.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryTokenInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CartRecoveryRestore"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Open a basket reminder's link",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/cart-recovery/stop": {
      "post": {
        "description": "The reminder's \"stop these reminders\" link: the basket's sequence ends. Idempotent.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryTokenInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "stopped": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "stopped"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Stop a basket's reminders",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts": {
      "post": {
        "description": "Returns the cart id, which is an unguessable token. Possessing it is the authorisation — there is no account, and there never has to be.",
        "parameters": [
          {
            "description": "The storefront, for clients that set it once rather than per request.",
            "in": "header",
            "name": "X-Channel",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "channel": {
                    "description": "Which storefront opened the basket. The `X-Channel` header says the same thing store-wide; the body wins when both are present. Fixed at creation, because it is what every line's price is resolved against — a basket that changed storefront halfway would hold lines priced on two and no honest way to say which total is right.",
                    "example": "wholesale",
                    "type": "string"
                  },
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/CartResponse"
          }
        },
        "summary": "Open a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          },
          {
            "description": "A destination country (ISO 3166-1 alpha-2): the answer carries tax_preview, the tax the lines hold or add there (the checkout's summary).",
            "in": "query",
            "name": "tax_country",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z]{2}$",
              "type": "string"
            }
          },
          {
            "description": "The destination's state or province, with tax_country.",
            "in": "query",
            "name": "tax_state",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CartResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/contact": {
      "put": {
        "description": "The checkout's email, phone and language, and the commercial-message boxes the shopper ticked: a ticked box is recorded as a consent at once (source checkout; only for a basket with something in it), so an abandoned basket can be reminded about (ADR-0074). The email is a contact only: it never decides a price.",
        "parameters": [
          {
            "in": "path",
            "name": "cartId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartContactInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Where to reach the shopper of a basket",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/customer": {
      "delete": {
        "description": "On sign-out: group prices no longer apply and every line is priced again. Needs no session.",
        "parameters": [
          {
            "in": "path",
            "name": "cartId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Price a basket as a guest's again",
        "tags": [
          "cart"
        ]
      },
      "put": {
        "description": "With the customer's session (X-Customer-Session) and a verified email: their groups' price lists apply to the basket from now on and every line is priced again. An unverified account prices as a guest. 401 without a session.",
        "parameters": [
          {
            "in": "path",
            "name": "cartId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Price a basket for the signed-in customer",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/email": {
      "put": {
        "description": "The address an abandoned-cart flow reaches the shopper on. A shopper types it into the checkout form mid-session, before checkout exists to capture it, and this is where it is recorded. An empty string clears it, which is the shopper's own way to withdraw the address. Like every cart mutation it extends the cart's TTL, and it revives a cart the sweeper has already marked `abandoned`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "description": "An empty string clears the address.",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CartResponse"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Set the shopper's email on a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/gift-cards": {
      "get": {
        "description": "The usable cards the shopper applied; they pay at checkout what they can of the total.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AppliedGiftCard"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The gift cards on a cart",
        "tags": [
          "cart"
        ]
      },
      "post": {
        "description": "The code is posted, never put in a URL. The card must be active, unexpired, with a balance, in the cart's currency (else 422 gift_card_unusable; an unknown code is 404 gift_card_unknown). At most five cards per cart. Spends the visitor's lookup budget.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftCardCodeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AppliedGiftCard"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The cart's cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Validation"
          },
          "429": {
            "description": "Too many code lookups from this visitor; Retry-After says when to try again."
          }
        },
        "summary": "Apply a gift card to a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/gift-cards/{id}": {
      "delete": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AppliedGiftCard"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The cart's cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Take a gift card off a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/line-items": {
      "post": {
        "description": "Adding records the price now. Checkout is what makes a price authoritative, and it refuses rather than silently repricing. A personalised product's line carries `personalisation`: its values are checked against the product's fields (required, length, characters, the choice, the font, a date, a picture this basket uploaded for the field) and what they add goes into the line's unit price. The same variant with the same values adds to its line; other values make a line of their own. 400 details: reason `personalisation_invalid`, field, problem (unknown, required, too_long, characters, choice, font, date, image, image_type, image_size, image_small, unavailable, currency, duplicate, not_fillable) and product_slug (a quick add from a listing can send the shopper to the product's page). A variant with a quantity rule (ADR-0091 §1) takes only quantities its rule allows over all its lines in the basket: 400 quantity_rule with QuantityRefusal details. A product sold to dealers only is refused to anybody else: 403 dealer_only with DealerOnlyRefusal details.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "personalisation": {
                    "description": "What the shopper asked for on this line (ADR-0089).",
                    "items": {
                      "$ref": "#/components/schemas/PersonalisationValue"
                    },
                    "maxItems": 20,
                    "type": "array"
                  },
                  "quantity": {
                    "default": 1,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "subscription_days": {
                    "description": "The product page's subscribe choice: absent keeps the line's choice, 0 makes it a one-off, N repeats it every N days (one of the intervals the store offers).",
                    "maximum": 365,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "variant_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "variant_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CartResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add a variant to the cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/line-items/{lineId}": {
      "delete": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          },
          {
            "$ref": "#/components/parameters/LineID"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CartResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a line",
        "tags": [
          "cart"
        ]
      },
      "patch": {
        "description": "A quantity of zero removes the line, which is what a stepper stepping down to nothing means. subscription_days changes how often the line repeats (0: a one-off); a body with only it leaves the quantity alone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          },
          {
            "$ref": "#/components/parameters/LineID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "quantity": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "subscription_days": {
                    "maximum": 365,
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CartResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Change a line's quantity or how often it repeats",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{cartId}/uploads": {
      "post": {
        "description": "A picture the shopper wants on their piece — a photo to print, a drawing to engrave — for one image field of one product (ADR-0089). multipart/form-data with `file`, `product_id` and `field`. The bytes go through the media pipeline: sniffed against JPEG, PNG and WebP only (no SVG, no HTML, no polyglot), EXIF/XMP and text chunks stripped, sized variants made; then checked against the field (its types, its byte limit — 10 MiB unless the merchant set another, never above 20 MiB — and its minimum pixels). The picture belongs to this basket: only its lines can use it, by `upload_id` in AddLineItem's `personalisation`. The order claims the pictures its lines use; the rest are removed hourly once the basket is gone or checked out, or a week after upload. 400 details: reason `personalisation_invalid`, field, problem (unknown, image_type, image_size, image_small, unavailable). 409 a checked-out basket; 409 `demo_store` on a theme demo store. 429 `rate_limited`: 20 pictures per basket, 120 an hour per store.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CartID"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "field": {
                    "description": "The image field's key (Product.personalisation[].key).",
                    "type": "string"
                  },
                  "file": {
                    "format": "binary",
                    "type": "string"
                  },
                  "product_id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "file",
                  "product_id",
                  "field"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PersonalisationUpload"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Stored for this basket."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`rate_limited`."
          }
        },
        "summary": "Upload a picture for a personalised line",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/carts/{token}/discount": {
      "delete": {
        "description": "Clearing the code is the same write as setting one, with an empty code. A cart that has already been checked out refuses this for the same reason PUT does.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Take the discount code off a cart",
        "tags": [
          "cart"
        ]
      },
      "put": {
        "description": "Answers with what the code is worth for this basket, computed as checkout computes it: the code together with every automatic promotion the basket also gets (a richer automatic promotion may leave the code less to take). That amount is a preview, not a promise: nothing is consumed here, and checkout decides again under its own lock. A code that is valid now and exhausted in ten minutes is refused then, which is the only honest place to refuse it. A cart that has already been checked out refuses this: there is nothing left to discount, and the row would be one nothing reads. A scoped code is refused when this basket holds none of the products, collections or categories it names — a valid code can be refused for this basket alone, and the message says so. A refused code answers 400 (404 for an unknown code, 409 for a checked-out cart) with `details` a `DiscountRefusal`.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "email": {
                    "description": "Optional. `once_per_email` cannot be previewed without it.",
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppliedDiscount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What the code is worth."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Put a discount code on a cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/categories": {
      "get": {
        "description": "Nested by default, because a storefront menu is nested. `?flat=1` returns the same rows depth-first, which is what an indented picker wants: every row carries `depth` and `child_count`, so a client can indent and expand without rebuilding the tree. Titles, descriptions and slugs are served in the request language (?lang= or Accept-Language) with a per-field fallback to the default language; a slug may be the language's own or the default one.",
        "parameters": [
          {
            "description": "Search titles and paths, case-insensitively.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`root`, or a category id: return that node's direct children only.",
            "in": "query",
            "name": "parent",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return a depth-first flat list instead of nested children.",
            "in": "query",
            "name": "flat",
            "schema": {
              "enum": [
                1
              ],
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "Order the page by one of these fields; omit for the listing's own order. Anything else is a 400 naming the ones that exist. Text keys are folded by PostgreSQL, and every ordering breaks ties on a key unique in the result set, so two pages of one listing never repeat or skip a row. Honoured only on the `?q=` search branch; sent with `?parent=`, `?flat=1` or a whole-tree listing it is a 400, because a tree's order is the position an operator gave it. The sort is applied before the limit, so `sort=title` returns the alphabetically first matches rather than the shallowest ones alphabetised. `full_name` orders by the rendered path, which is what the row shows.",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "created_at",
                "full_name",
                "id",
                "title"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The tree, or the flattened list."
          }
        },
        "summary": "The category tree",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/categories/{slug}": {
      "get": {
        "description": "Descendants are included, because that is what picking a category means: someone who asks for Apparel wants the shirts too, and a filter that returned only products filed at the exact node would show an empty page for every branch. The meta describes the products, since they are the pageable part. Titles, descriptions and slugs are served in the request language (?lang= or Accept-Language) with a per-field fallback to the default language; a slug may be the language's own or the default one.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CategoryPage"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The category flattened into the response, with a page of its products."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A category and the products filed under it",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/chat": {
      "post": {
        "description": "Only while the store's live-chat add-on is on. Answers the chat's token, for the visitor's browser alone.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatStartInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatStarted"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Start a live chat",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/attachments": {
      "post": {
        "description": "A picture, a PDF or a video, checked by its bytes. At most 20 files a chat and 15 an hour from one address.",
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "description": "A picture or a PDF up to 10 MB, a video up to 25 MB.",
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many files."
          }
        },
        "summary": "Send a file in the visitor's chat",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/attachments/{file}": {
      "get": {
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file: a picture or a video inline, a PDF as a download; private, never cached."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A file of the visitor's chat",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/close": {
      "post": {
        "description": "Both sides get the conversation by e-mail; writing again opens it.",
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Closed."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Close the visitor's chat",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/handover": {
      "post": {
        "description": "Hands the chat from the store's assistant to the staff (once): a note to the visitor, and the store told as for a new chat.",
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Handed over, or already the staff's."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Ask for a person",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/messages": {
      "get": {
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ChatMessage"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The messages."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The visitor's chat messages after one",
        "tags": [
          "storefront"
        ]
      },
      "post": {
        "description": "At most 20 messages in ten minutes; a closed chat opens again.",
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The message."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many messages."
          }
        },
        "summary": "Write in the visitor's chat",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/chat/view": {
      "get": {
        "description": "Whether the store's assistant still answers (mode bot) or a person does, and the messages after one.",
        "parameters": [
          {
            "description": "The token POST /api/chat answered.",
            "in": "header",
            "name": "X-Chat-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatVisitorView"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The visitor's chat and whose it is",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/checkout": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "currency": {
                          "example": "USD",
                          "type": "string"
                        },
                        "methods": {
                          "description": "The same set as `payment_methods`, in the same order, with the name each provider gives itself — the string to put beside a radio button. Both shapes exist on purpose and neither replaces the other: `payment_methods` is the array of codes every storefront already reads, and a future tidy-up that collapses them breaks those readers to save a key.",
                          "example": [
                            {
                              "code": "cod",
                              "name": "Cash on delivery"
                            },
                            {
                              "code": "stripe",
                              "name": "stripe"
                            }
                          ],
                          "items": {
                            "properties": {
                              "code": {
                                "description": "What the API speaks: the code in the checkout URL.",
                                "example": "cod",
                                "type": "string"
                              },
                              "countries": {
                                "description": "The delivery countries the method is offered for (cash on delivery, havale / EFT: by sales region); absent: every country.",
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "flows": {
                                "description": "How the page can take the payment, as the gateway is set up now. `hosted`: the checkout answers a redirect URL or an HTML page to render. `card_fields`: the page collects the card and sends it in payment_data with `flow` = `3ds`. `direct_post`: the browser posts the card straight to the provider (client_data.flow = direct); the card never reaches this API. `client_sdk`: the provider's script completes the payment with client_data. Empty for an offline method.",
                                "items": {
                                  "enum": [
                                    "hosted",
                                    "card_fields",
                                    "direct_post",
                                    "client_sdk"
                                  ],
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "installments": {
                                "description": "The card may be split into installments; a card's options come from GET /api/checkout/{code}/installments.",
                                "type": "boolean"
                              },
                              "name": {
                                "description": "The label to show a person. Falls back to the code when the provider offers no name, which is the same answer GET /api/admin/settings gives for the same provider.",
                                "example": "Cash on delivery",
                                "type": "string"
                              },
                              "no_card_holder": {
                                "description": "The card form of a `card_fields` or `direct_post` flow asks no holder's name: the provider takes none (Payten's 3D Pay posts pan, expiry and cv2 only). Absent: the name is asked.",
                                "type": "boolean"
                              },
                              "offline": {
                                "description": "Settled away from the page — cash on delivery, a transfer: no card, no redirect.",
                                "type": "boolean"
                              },
                              "origins": {
                                "description": "The provider origins (`scheme://host[:port]`) the checkout page must let the browser reach for this method's flow, as the gateway is configured now — for the page's Content-Security-Policy. `form_action`: where a `direct_post` card form is posted; `script`, `frame`, `connect`: where a `client_sdk` script, its frames and its calls go. Absent when the flow needs none (redirects, offline methods).",
                                "properties": {
                                  "connect": {
                                    "items": {
                                      "type": "string"
                                    },
                                    "type": "array"
                                  },
                                  "form_action": {
                                    "items": {
                                      "type": "string"
                                    },
                                    "type": "array"
                                  },
                                  "frame": {
                                    "items": {
                                      "type": "string"
                                    },
                                    "type": "array"
                                  },
                                  "script": {
                                    "items": {
                                      "type": "string"
                                    },
                                    "type": "array"
                                  }
                                },
                                "type": "object"
                              },
                              "pay_later": {
                                "description": "The instalment / buy-now-pay-later offer a storefront may show beside a price (ADR-0121): \"4 taksitle …\", \"Pay in 3 with Klarna\". Absent when the method makes none or its owner switched the message off. The storefront computes the part from the price it shows; the provider is not asked.",
                                "properties": {
                                  "brand": {
                                    "description": "The buy-now-pay-later provider's name for the message (\"Klarna\"); absent for a card's instalments.",
                                    "type": "string"
                                  },
                                  "count": {
                                    "description": "How many parts the price is split into (2–36).",
                                    "type": "integer"
                                  },
                                  "interest_free": {
                                    "description": "The shopper pays the price itself in `count` equal parts. When false the parts carry the provider's charge: show \"up to `count` instalments\", never an amount.",
                                    "type": "boolean"
                                  },
                                  "max_minor": {
                                    "description": "The highest price the offer applies to; absent for none.",
                                    "format": "int64",
                                    "type": "integer"
                                  },
                                  "min_minor": {
                                    "description": "The lowest price (store currency, minor units) the offer applies to; absent for none.",
                                    "format": "int64",
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "count",
                                  "interest_free"
                                ],
                                "type": "object"
                              },
                              "saved_cards": {
                                "description": "The owner switched saved cards on for this method (CH7): a signed-in, verified shopper may save the card (`payment_data.save_card` = `1`) and pay with one saved (`payment_data.saved_card_id`, from GET /api/customer/cards). Absent: off.",
                                "type": "boolean"
                              },
                              "three_d_secure": {
                                "description": "The payment may pass a 3-D Secure challenge.",
                                "type": "boolean"
                              },
                              "wallets": {
                                "description": "The digital wallets the owner switched on for this method (CH6). The wallet is taken on the provider's own page or element; the storefront offers its button only where the shopper's browser supports the wallet too. Absent: none.",
                                "items": {
                                  "enum": [
                                    "apple_pay",
                                    "google_pay"
                                  ],
                                  "type": "string"
                                },
                                "type": "array"
                              }
                            },
                            "required": [
                              "code",
                              "flows",
                              "installments",
                              "name",
                              "offline",
                              "three_d_secure"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "payment_methods": {
                          "example": [
                            "cod",
                            "stripe"
                          ],
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "test_mode": {
                          "description": "The store is in test mode (ADR-0137): show a \"Test modu\" ribbon on the checkout. Only methods that take no real money are listed (the test card `test_card`, gateways in their test environment, offline methods); an order placed now is a test order.",
                          "type": "boolean"
                        },
                        "whatsapp_order_updates": {
                          "description": "The store sends order updates on WhatsApp (ADR-0058) to a shopper who asks for them at checkout: offer the \"Sipariş durumunu WhatsApp'tan bildir\" box (unticked) and, when ticked, put metadata.whatsapp_updates = {\"granted\": true, \"text\": …, \"form_version\": …} on the checkout.",
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Installed payment codes, and the same list with display names."
          }
        },
        "summary": "List the payment methods this store accepts",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/checkout-links/{token}/open": {
      "post": {
        "description": "Makes a new basket of the link's lines (those that cannot go in are skipped and counted), with its discount code and e-mail, and answers its token. A link switched off or expired is 410 checkout_link_gone.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OpenedCheckoutLink"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The basket."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "description": "The link is switched off or expired."
          }
        },
        "summary": "Open a payment link",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/checkout/carriers/{code}/webhook": {
      "post": {
        "description": "A core-owned route for carrier callbacks. The carrier's module verifies the signature (401 when it cannot) and maps the event onto the engine's tracking states; the engine finds the shipment by the carrier's reference or tracking number, deduplicates by the event id and applies it — delivered, failed delivery and returned to sender move the shipment, the rest are recorded and announced as fulfillment.tracking_updated. A cash-on-delivery remittance in the event settles the order.",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Accepted."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Carrier tracking callback",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/checkout/rates": {
      "get": {
        "description": "A quote rather than a price list: the price depends on what is in the cart, so the cart's own token is the input rather than a subtotal the caller could invent. An empty rates array is an answer, not an error - this store does not deliver to that destination - and a storefront has to render it either way. A store with no rates configured is still on Config.FlatShippingMinor, and this returns nothing. Only the rates written in the basket's currency are offered, their band read against the basket's subtotal in it; a market whose currency has no rate for the destination gets an empty list.",
        "parameters": [
          {
            "description": "The cart token.",
            "in": "query",
            "name": "cart",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO country code.",
            "in": "query",
            "name": "country",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO state or province code, where the store prices by it.",
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The destination's city, passed to carriers that quote live rates by it.",
            "in": "query",
            "name": "city",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The destination's postal code, passed to carriers that quote live rates by it.",
            "in": "query",
            "name": "postal_code",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "carbon": {
                          "description": "The store shows the carbon estimate (options carry co2e_grams where the weight is known).",
                          "type": "boolean"
                        },
                        "currency": {
                          "description": "The basket's currency, which every quote is in.",
                          "type": "string"
                        },
                        "duties_mode": {
                          "description": "The cart's market's duties mode for this destination: ddp adds each option's landed_cost.total to the total; dap and off add nothing. off when no customs border is crossed.",
                          "enum": [
                            "off",
                            "dap",
                            "ddp"
                          ],
                          "type": "string"
                        },
                        "duties_notice": {
                          "description": "Show \"duties and import taxes may be charged on delivery\" (a DAP market with the store's note on, a cross-border address).",
                          "type": "boolean"
                        },
                        "rates": {
                          "items": {
                            "$ref": "#/components/schemas/ShippingQuote"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The delivery options for this basket and destination."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "What it costs to send this basket there",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/checkout/{code}": {
      "post": {
        "description": "Validates the cart, reserves inventory and creates the order in one transaction, then starts payment outside it — a gateway having a slow day must not become the store having a slow day.\n\nIf a line's price changed, its product went inactive, or stock ran out, the whole checkout is refused with 409 and per-line detail; the cart is refreshed to current prices so the shopper can confirm again. With `expected_total`, a total that no longer holds is refused with 409 too, `details` then being a `TotalChanged` object (`reason` = `total_changed`) instead of the per-line array.\n\nSend an `Idempotency-Key` header. The same key replays the original result instead of creating a second order; if the first attempt created the order but payment initiation failed, a retry resumes payment on that same order. A replayed or resumed answer carries the order's `access_token` like the first one, so a shopper whose answer was lost can still open their order. A chosen `shipping_rate_id` that no longer covers the basket is a 409 with `details.reason` = `shipping_rate_unavailable`; an address the store does not deliver to (in the basket's currency) is a 400 with `details.reason` = `no_delivery`.",
        "parameters": [
          {
            "description": "A payment method code, such as `cod`.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "payment": {
                          "$ref": "#/components/schemas/PaymentIntent"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order, and what the client must do to pay."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ErrorEnvelope"
                    }
                  ],
                  "example": {
                    "error": {
                      "code": "conflict",
                      "details": [
                        {
                          "current_price_minor": 2499,
                          "reason": "price_changed",
                          "sku": "TEE-M-BLK",
                          "variant_id": 42
                        }
                      ],
                      "message": "the cart is no longer valid at these prices"
                    }
                  }
                }
              }
            },
            "description": "The cart is no longer valid at these prices (`details`: per-line conflicts, each naming its cart line by `line_id`; reasons price_changed, inactive, insufficient_stock, not_for_sale_in_currency, not_sold_to_country — the product is not sold to the delivery country under its selling rules, ADR-0146 — source_changed, personalisation_changed — the product's personalisation fields changed and the line's values no longer fit, ADR-0089 — dealer_only — the product is sold to dealers only and the buyer is not one, no price is named — and quantity_rule — the variant's units are below its minimum or not a multiple of its step, with min, step, pack and requested, ADR-0091), or the total is not the expected one (`details`: TotalChanged)."
          }
        },
        "summary": "Check out with a payment method",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/checkout/{code}/installments": {
      "get": {
        "description": "Asks the payment provider what a card, known by its first digits (BIN), may be split into for an amount, and what each count costs the shopper in all. Only for a payment method that quotes installments; an idle (not yet configured) method answers 404 like a missing one. The answer is the provider's and is not stored: checkout still sends the chosen count in `installments`, and what was actually charged comes back on the payment.",
        "parameters": [
          {
            "description": "A payment method code, such as `iyzico`.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The card's first 6 to 8 digits.",
            "in": "query",
            "name": "bin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The amount to split, in minor units.",
            "in": "query",
            "name": "amount",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "ISO currency code; the store's base currency when omitted.",
            "in": "query",
            "name": "currency",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InstallmentQuote"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The card and its installment options."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The provider could not quote."
          }
        },
        "summary": "Installment options for a card",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/checkout/{code}/webhook": {
      "post": {
        "description": "A core-owned route for payment callbacks. A gateway that parses its own callbacks has each event verified by its signature, matched to its payment, deduplicated by the provider's event id and applied by the engine; a bad signature is refused with 401. Older modules receive the raw request body and verify it themselves.\n\nA provider that sends no event id (iyzico, PayTR) has one derived from the event's content, so a repeat is still a no-op; a provider that expects a particular answer gets it (PayTR: the plain-text body `OK`).",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Accepted by the provider."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Gateway callback",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/collections": {
      "get": {
        "description": "Only collections holding at least one active product are listed. A collection that is empty, or that holds nothing but drafts, is a work in progress, and linking to it would produce an empty page. Titles, descriptions and slugs are served in the request language (?lang= or Accept-Language) with a per-field fallback to the default language; a slug may be the language's own or the default one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Collection"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of collections, in curation order."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "List the collections a storefront should show",
        "tags": [
          "collections"
        ]
      }
    },
    "/api/v1/store/collections/{slug}": {
      "get": {
        "description": "`meta` describes the embedded products: the collection itself is a single record, and the only thing on this response a client can page through is what is in it. Products come back in the order they were curated. Titles, descriptions and slugs are served in the request language (?lang= or Accept-Language) with a per-field fallback to the default language; a slug may be the language's own or the default one.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CollectionPage"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The collection with a page of its active products."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get a collection and the active products in it",
        "tags": [
          "collections"
        ]
      }
    },
    "/api/v1/store/consents/opt-out/{token}": {
      "get": {
        "description": "The link every commercial message carries. GET shows what it would withdraw (masked) and changes nothing; POST withdraws the consent at once — also what RFC 8058 List-Unsubscribe-Post sends.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OptOutView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The consent, masked."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "What an opt-out link withdraws",
        "tags": [
          "checkout"
        ]
      },
      "post": {
        "description": "The link every commercial message carries. GET shows what it would withdraw (masked) and changes nothing; POST withdraws the consent at once — also what RFC 8058 List-Unsubscribe-Post sends.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OptOutView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The withdrawn consent, masked."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Opt out of commercial messages",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/contact": {
      "post": {
        "description": "The storefront's contact_form section (ADR-0062). Validates name (1–120), email, phone (optional, digits and + ( ) - ), topic (≤ 80), message (10–5000) and the KVKK acknowledgement (`consent` true with the `consent_text` shown). `website` is a honeypot and `started_at` the time the form was rendered (Unix ms): a filled honeypot, a form sent within 3 seconds of being shown, or one without `started_at` is answered 202 like any other and dropped. At most 5 messages an hour per visitor address and 60 per store: 429 `rate_limited` with Retry-After. A stored message is emailed to the store's contact address and announced on the staff channels (Telegram, WhatsApp) without the visitor's details; it is kept 12 months. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactSubmission"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Received."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`rate_limited`: too many messages from this address or to this store in the last hour."
          }
        },
        "summary": "Send a message through the store's contact form",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/articles": {
      "get": {
        "description": "Articles published in a language, pinned ones first, then newest; filtered by category, tag or author, or the articles nearest another (`related`: the same category first, then shared tags; ADR-0073).",
        "parameters": [
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "A blog category's slug.",
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A tag.",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An author's slug.",
            "in": "query",
            "name": "author",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An article's slug: the articles nearest it, without it.",
            "in": "query",
            "name": "related",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "articles": {
                          "items": {
                            "$ref": "#/components/schemas/StoreArticle"
                          },
                          "type": "array"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The articles."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Blog articles",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/articles/{slug}/comments": {
      "get": {
        "description": "The approved comments under an article in a language, oldest first (at most 200), each with the store's answer. Never the writer's email.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "enum": [
                "tr",
                "en",
                "de",
                "fr",
                "it",
                "es",
                "nl",
                "da",
                "sv",
                "pl",
                "ru",
                "ar"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "comments": {
                          "items": {
                            "$ref": "#/components/schemas/StoreBlogComment"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The comments."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "An article's comments",
        "tags": [
          "content"
        ]
      },
      "post": {
        "description": "A reader's comment (ADR-0073). Refused (409) when the store's comments are off or the article's are closed. A filled honeypot (`website`) or a form sent within 3 seconds of being shown is answered like a held comment and dropped. At most 5 per address and 60 per store an hour (429 with Retry-After). In `moderated` mode every comment waits for the store; in `auto` it is shown at once unless it looks like spam (many links, shouting). Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogCommentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BlogCommentReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "What became of the comment."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many comments from this address or store."
          }
        },
        "summary": "Comment on an article",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/blog": {
      "get": {
        "description": "The blog's categories (with their live articles in the language), the authors who have live articles, the 100 most used tags, the comment mode and the page size (ADR-0073): for archive pages, filters and the RSS feed.",
        "parameters": [
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "enum": [
                "tr",
                "en",
                "de",
                "fr",
                "it",
                "es",
                "nl",
                "da",
                "sv",
                "pl",
                "ru",
                "ar"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreBlogIndex"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The index."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The blog's index",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/coupons": {
      "get": {
        "description": "Resolves the discounts coupon widgets name (ADR-0085 §10): only ids a published page or popup of the store holds (or, with a preview token, the page it opens) are answered, so the read cannot list discounts. `code` is set only while the discount can be used (active, started, not ended, under its limit); usage counts and limits are never exposed. Never cached.",
        "parameters": [
          {
            "description": "Comma-separated discount ids (at most 20).",
            "in": "query",
            "name": "ids",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A preview token: the page it opens counts too.",
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "coupons": {
                          "items": {
                            "$ref": "#/components/schemas/StoreCoupon"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The coupons."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Coupon widgets' discounts",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/legal/{kind}": {
      "get": {
        "description": "The live legal text of a kind from the legal module (unchanged: its version and hash are what a checkout accepts), with the store's introduction page for that kind when published.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "distance_sales",
                "preliminary_info",
                "kvkk_notice",
                "cookie_policy",
                "return_policy",
                "privacy_policy",
                "terms_of_use"
              ],
              "type": "string"
            }
          },
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreLegalPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A legal page",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/pages": {
      "get": {
        "description": "Slugs live in a language, for a sitemap.",
        "parameters": [
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "pages": {
                          "items": {
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "local_slug": {
                                "description": "The page's address in this language: its own slug there (migration 0129), else `slug`.",
                                "type": "string"
                              },
                              "published_at": {
                                "format": "date-time",
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The pages."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Published pages",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/pages/{slug}": {
      "get": {
        "description": "The live section document of a page (the home page is `home`) in one language; no fallback to another language. With a valid preview token, the working copy.",
        "parameters": [
          {
            "description": "Any of the page's slugs: its slug, or its address in any language (the answer's `slugs` names the language's own).",
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A Tema Stüdyosu preview token: answers with the working copy, uncached.",
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With a preview token for the page: that one version of it in the language, whatever its state (the editor's side-by-side compare, ADR-0085 VB-8).",
            "in": "query",
            "name": "version",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreContentPage"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The page."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A published page",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/popups": {
      "get": {
        "description": "The popups published in a language (ADR-0085 §9, VB-5) whose schedule is on, highest priority first, each with its rules and its document (free layouts, media addresses current). With `path` (a storefront path, with or without the language), only those whose page conditions take it; none at all on the checkout, an order's or the account's pages. The visitor's side of the rules (device, new or returning visitor, cart, trigger, frequency, consent) is the storefront's to apply. With the store's time zone, which the weekdays and hours of the rules are in.",
        "parameters": [
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The storefront path the popups are for.",
            "in": "query",
            "name": "path",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "popups": {
                          "items": {
                            "$ref": "#/components/schemas/StorePopup"
                          },
                          "type": "array"
                        },
                        "time_zone": {
                          "description": "The store's time zone (IANA), which a popup's days and hours are in.",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The popups."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The live popups",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/popups/{id}/coupon": {
      "post": {
        "description": "A published popup's coupon widget in \"unique\" mode (ADR-0133) hands each visitor a single-use code minted from its discount (a copy with a usage limit of 1, listed under the discount's codes). The visitor is the storefront's random token (kept in its own HttpOnly cookie), stored only as a hash: the same token gets the same code again, and no request reaches another visitor's. The discount is read from the popup's live version, never from the request; a discount that ended, is off or is used up answers 409 campaign_ended. Limited per address. Never cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "node": {
                    "description": "The coupon widget's node id.",
                    "type": "string"
                  },
                  "visitor_token": {
                    "maxLength": 128,
                    "minLength": 20,
                    "pattern": "^[A-Za-z0-9_-]+$",
                    "type": "string"
                  }
                },
                "required": [
                  "node",
                  "visitor_token"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PopupCode"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The code."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many codes or spins from this address in this store; retry later."
          }
        },
        "summary": "A unique coupon's code for this visitor",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/popups/{id}/events": {
      "post": {
        "description": "Adds one to today's (UTC) count of a published popup: a view, a close, a conversion (its form sent, its coupon copied or applied), or — counted as a conversion too — a code copied or a sign-up (ADR-0133). Counts only; a conversion, a copy or a sign-up also notes the store's daily visitor hash (visits.go, no cookie) with the time, so an order placed later in the same visit counts toward the popup's revenue.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "event": {
                    "enum": [
                      "view",
                      "close",
                      "conversion",
                      "copy",
                      "signup"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "event"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "recorded": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Counted."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Count a popup's view, close, conversion, code copied or sign-up",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/popups/{id}/spin": {
      "post": {
        "description": "The wheel of a published popup (ADR-0133): the server draws the segment by the weights its live version holds (crypto random; a segment whose discount ended, is off or is used up is out of the draw) and answers it with, for a prize, a single-use code minted from the segment's discount. Once per visitor token (the same answer again) and, when the wheel asks for an e-mail, once per address (409 already_spun). The page never chooses the segment, the prize or the discount. A ticked permission box asks the address to confirm the newsletter (double opt-in) in the wheel's own wording. Limited per address. Never cached.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PopupSpinInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PopupSpin"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The spin."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many codes or spins from this address in this store; retry later."
          }
        },
        "summary": "Spin a popup's wheel for this visitor",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/redirects": {
      "get": {
        "description": "Every redirect rule of the store, for the storefront's middleware. A rule for one language wins over a rule for every language.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "redirects": {
                          "items": {
                            "$ref": "#/components/schemas/StoreRedirect"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rules."
          }
        },
        "summary": "Redirect rules",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/content/theme": {
      "get": {
        "description": "Colours, fonts, logo (resolved URL) and menus; version 0 when none is published. With a valid preview token, the draft.",
        "parameters": [
          {
            "description": "A Tema Stüdyosu preview token: answers with the working copy, uncached.",
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreTheme"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The theme."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The published theme",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/cookie-consent": {
      "get": {
        "description": "What the storefront's cookie banner asks and which third-party tags each answer allows (ADR-0038): whether the banner is on, the consent version a stored choice must name (a visitor whose choice names an older one is asked again), the store's own wording per language if any, the four categories with the tools (enabled plugins) in each, and the tags grouped by category. `active` is whether the banner must be shown: on, and at least one non-essential tag to ask about. While the banner is off no tag is handed out: nothing non-essential may load without consent. Not cacheable by intermediaries.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CookieConsentConfig"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The configuration."
          }
        },
        "summary": "The store's cookie consent configuration",
        "tags": [
          "legal"
        ]
      },
      "post": {
        "description": "Stores one choice made in the banner or the preferences dialog as an anonymous record: a random consent id (the one sent back, if the browser kept an earlier one, else a new one), the categories, the version answered, the time and a user agent class (desktop, mobile, tablet, bot, other). No IP address is stored in any form and no full user agent. `accept_all` must accept every category, `reject_all` none; `withdraw` takes back a category granted earlier. A version other than the store's current one answers 409 `consent_version_changed` (ask again); a store whose banner is off answers 409 `cookie_consent_off`. Limited per client and store (10 a minute) besides the general limits: 429 `rate_limited` with Retry-After. Records are deleted after 730 days.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CookieConsentChoice"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CookieConsentReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Recorded."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many consent records from this client; retry after the Retry-After seconds."
          }
        },
        "summary": "Record a visitor's cookie choice (anonymous)",
        "tags": [
          "legal"
        ]
      }
    },
    "/api/v1/store/customer/addresses": {
      "get": {
        "description": "Defaults first. Empty for an unverified account.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerAddress"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The addresses."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          }
        },
        "summary": "The account's saved addresses (Adreslerim)",
        "tags": [
          "account"
        ]
      },
      "post": {
        "description": "At most 20 per account. Making it a default moves the default from the address that had it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAddress"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The saved address."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`address_incomplete`."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`verify_first`."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_addresses`."
          }
        },
        "summary": "Save an address",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/addresses/{id}": {
      "delete": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Remove a saved address",
        "tags": [
          "account"
        ]
      },
      "patch": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerAddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAddress"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The address."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`address_incomplete`."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`verify_first`."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Change a saved address",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/cards": {
      "get": {
        "description": "Saved cards (CH7): what the payment provider's card storage holds for this account — brand, bank, last four digits and expiry, never a number. `provider` narrows the list to one payment method. Empty until the owner switches saved cards on for a provider and the shopper saves a card at checkout. The card token and user key are sealed in the database and never returned.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "description": "A payment method code, such as `iyzico`.",
            "in": "query",
            "name": "provider",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/SavedCard"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The cards, newest first."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended."
          }
        },
        "summary": "The signed-in shopper's saved cards",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/cards/{id}": {
      "delete": {
        "description": "Removes the card from the payment provider's storage (when the provider is set up) and from the account.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a saved card",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats": {
      "get": {
        "description": "Every chat started with the account's proved e-mail, newest first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ChatConversation"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chats."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "Mesajlarım: the customer's chats",
        "tags": [
          "account"
        ]
      },
      "post": {
        "description": "Under the account's name and e-mail, about one of their orders when order_number is given; the store's assistant answers first when it is on.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "maxLength": 2000,
                    "type": "string"
                  },
                  "order_number": {
                    "description": "One of the customer's own orders as the subject.",
                    "type": "string"
                  },
                  "topic": {
                    "description": "An application (the platform's own store only): to supply or sell in the network, or for a store.",
                    "enum": [
                      "supplier",
                      "seller",
                      "store"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat with its messages."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Start a chat from the account",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats/{id}": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat with its messages."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One of the customer's chats",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats/{id}/attachments": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat with its messages."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many files."
          }
        },
        "summary": "Send a file in one of the customer's chats",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats/{id}/attachments/{file}": {
      "get": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "in": "path",
            "name": "file",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file: a picture or a video inline, a PDF as a download; private, never cached."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A file of one of the customer's chats",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats/{id}/close": {
      "post": {
        "description": "Both sides get the conversation by e-mail; writing again opens it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Close one of the customer's chats",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/chats/{id}/messages": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "body": {
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The chat with its messages."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Write in one of the customer's chats",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/company": {
      "get": {
        "description": "Its name, the buyer's role, and for its admin the orders its buyers placed (the last 100). 404 when the buyer has no company.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCompany"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The company."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The signed-in buyer's company",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/credit": {
      "get": {
        "description": "Usable store credit, one amount per currency; empty until the address is verified.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreCredit"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The credit."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "The signed-in customer's store credit",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/credit/apply": {
      "post": {
        "description": "Puts their usable credit in the cart's currency on the cart (as many cards as a basket takes). A verified address only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cart_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "cart_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/AppliedGiftCard"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The cart's cards."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Apply the signed-in customer's store credit to a cart",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/dealer": {
      "get": {
        "description": "Whether the store takes applications, whether the account is a dealer now, and its latest application (ADR-0091 §3). no-store.",
        "parameters": [
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerStatus"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "The account's dealer status",
        "tags": [
          "account"
        ]
      },
      "post": {
        "description": "A verified account's application (company, VKN/TCKN with check digits, tax office with a VKN, phone, the KVKK notice). One open application per account (409 dealer_application_exists); 404 dealer_applications_closed when the store takes none; 403 verify_first for an unverified address; 429 past 3 a day per account or 30 an hour per store. A honeypot or a form sent too fast is answered the same and dropped. The store is told by email and its staff channels. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealerApplicationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DealerReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Received"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many requests; try again later."
          }
        },
        "summary": "Apply to buy as a dealer",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/email": {
      "post": {
        "description": "Needs the password. Emails a confirmation link (24 hours) to the new address; the account keeps its address until the link is opened (POST /customer/email/confirm).",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "new_email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "password",
                  "new_email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`wrong_password`, `invalid_email` or `same_email`."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Change the email address",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/email/confirm": {
      "post": {
        "description": "Spends an email-change link: the account's address becomes the new one, verified, and the guest orders placed with it are attached.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The account with its new address."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_token`."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`email_unavailable`: another customer of the store has this address."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Confirm a new email address",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/login": {
      "post": {
        "description": "Works before the address is verified. A verified account's guest orders placed with its address are attached on the way in. A wrong password and an address with no account are the same error and take the same time. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSignIn"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Signed in."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_credentials`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Sign in with email and password",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/logout": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          }
        },
        "summary": "End this session",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/logout-all": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          }
        },
        "summary": "End every session of the account (this one too)",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/loyalty": {
      "get": {
        "description": "With their invitation code when the store gives referral points; empty until the address is verified.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyAccount"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The points."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "The signed-in customer's points",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/loyalty/redeem": {
      "post": {
        "description": "At least the programme's minimum; becomes store credit (0183) in the base currency. A verified address only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "points": {
                    "type": "integer"
                  }
                },
                "required": [
                  "points"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LoyaltyAccount"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The points after."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Turn points into store credit",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/me": {
      "delete": {
        "description": "KVKK/GDPR erasure of the address in this store (the same as the panel's): the customer record, its sessions, links and addresses are deleted; orders stay, as the law requires, with the person's name, phone and street address removed. Refused while an order, return or refund is in progress.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`wrong_password`."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`orders_in_progress`: finish them first; `details` counts them."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Close the account",
        "tags": [
          "account"
        ]
      },
      "get": {
        "description": "Also slides the session's expiry.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The account."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          }
        },
        "summary": "The signed-in account",
        "tags": [
          "account"
        ]
      },
      "patch": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccount"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The account."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`name_required` or `validation_failed`."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`verify_first`: the address is not verified yet."
          }
        },
        "summary": "Change name and phone",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/oauth/callback": {
      "post": {
        "description": "Takes what the provider sent back (`state`, `code`, Apple's first-time `user`) with the `binding` the storefront kept. The state is used once. The code is exchanged, the ID token is verified (signature against the provider's JWKS, issuer, audience, expiry, nonce) and the shopper is found by their provider identity or, the first time, by the e-mail address the provider verified: linked to an existing account, or a verified account is opened. An unverified address places nobody (422 `oauth_email_unverified`); a password-only account that was never verified loses its password when linked. 401 `oauth_failed` / `oauth_expired`; 429 after repeated failures. Answers like a sign-in, with the session for the storefront's server only, plus `return_to` and `new`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerOAuthCallback"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerOAuthSignIn"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "description": "The sign-in failed or expired."
          },
          "409": {
            "description": "The store does not offer this provider."
          },
          "422": {
            "description": "The provider has not verified an e-mail address."
          },
          "429": {
            "description": "Too many attempts."
          }
        },
        "summary": "Complete signing in with Google or Apple",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/oauth/providers": {
      "get": {
        "description": "Which of `google` and `apple` the store has set up (its own client id and secret entered in the panel), in the order the buttons show. Empty when the store offers none: the storefront then shows no button. Not cacheable.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerOAuthProviders"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          }
        },
        "summary": "The sign-ins the store offers (Google, Apple)",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/oauth/start": {
      "post": {
        "description": "Makes the state, nonce and PKCE pair, stores the hashes and the public challenge, and returns the provider's authorisation URL to send the browser to, with `binding` (the PKCE verifier) for the storefront's server to keep in an HttpOnly cookie until the callback. `redirect_uri` must be https on one of the store's own addresses at /api/account/oauth/callback; `return_to` is a path on the store (anything else is dropped). 409 `oauth_not_configured` when the store does not offer the provider.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerOAuthStart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerOAuthStarted"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "409": {
            "description": "The store does not offer this provider."
          }
        },
        "summary": "Begin signing in with Google or Apple",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/orders": {
      "get": {
        "description": "Newest first. Empty for an account whose address is not verified.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerOrder"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of orders."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          }
        },
        "summary": "The account's orders (Siparişlerim)",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/password": {
      "post": {
        "description": "Needs the current password. Every other session ends; this one stays. The shopper is emailed that the password changed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "current_password": {
                    "type": "string"
                  },
                  "new_password": {
                    "type": "string"
                  }
                },
                "required": [
                  "current_password",
                  "new_password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`wrong_password`, or a password rule."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Change the password",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/password-reset": {
      "post": {
        "description": "Emails a reset link (1 hour, single use) when the address has an account in this store. Identical answer for every address. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_email`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Forgot password: email a reset link",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/password-reset/confirm": {
      "post": {
        "description": "Sets the password, marks the address verified (the link proves the mailbox), ends every session, drops the account's other links, attaches its guest orders and signs the shopper in. A name and marketing tick typed at sign-up but never verified are discarded.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSignIn"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "New password set, signed in."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_token`, or a password rule (`password_too_short`, `password_like_email`, …)."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Set a new password from a reset link",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/platform": {
      "get": {
        "description": "On the platform's own store only (404 elsewhere): the stores the account's proved e-mail belongs to as staff.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlatformAccount"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The account's stores."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The stores a NeroCart customer runs",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/register": {
      "post": {
        "description": "Creates an account on the store's customer record for the address and emails a verification link (24 hours, single use). When the address already has an account nothing is created and its owner is emailed the way back in instead. The answer is identical either way, and the email is sent after the answer, so neither the body, the status nor the timing says whether an address has an account. Throttled per address and client. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerRegistration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_email`, `name_required`, `password_too_short`, `password_too_long`, `password_like_email`, `kvkk_required`, or `validation_failed`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Open a customer account (sign up)",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/subscriptions": {
      "get": {
        "description": "Empty until the address is verified.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ShopperSubscription"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The subscriptions."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "summary": "The signed-in customer's repeat orders",
        "tags": [
          "account"
        ]
      },
      "post": {
        "description": "Every 7 to 365 days; when due, a payment link of its lines is e-mailed — nothing is charged without the customer. A verified address only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "interval_days": {
                    "maximum": 365,
                    "minimum": 7,
                    "type": "integer"
                  },
                  "order_number": {
                    "type": "string"
                  }
                },
                "required": [
                  "order_number",
                  "interval_days"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShopperSubscription"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The subscription."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Repeat one of the customer's orders",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/subscriptions/{id}": {
      "patch": {
        "description": "Pause, resume, cancel, skip the next or change the interval.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShopperSubscriptionPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShopperSubscription"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The subscription."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Change the customer's repeat order",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/verify": {
      "post": {
        "description": "Spends a verification link together with the account's password (the link alone would let somebody who signed up with another person's address claim that person's orders by getting them to click). Marks the address verified, attaches the store's guest orders placed with it, grants a marketing consent ticked at sign-up (double opt-in) and signs the shopper in.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSignIn"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Verified and signed in."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`invalid_token`: unknown, used or expired link; `invalid_credentials`: the password does not match."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Verify the account's email address",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/verify/resend": {
      "post": {
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerAccepted"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Accepted."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store. The storefront clears its cookie and shows the sign-in page."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`too_many_attempts`: too many attempts from this address or for this account; `details.retry_after_seconds` says how long to wait."
          }
        },
        "summary": "Send a new verification link",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/wishlist": {
      "get": {
        "description": "Product ids, newest first. A guest keeps favourites in the browser; they are merged in with POST after sign-in.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Wishlist"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The favourites."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store."
          }
        },
        "summary": "The account's favourites (Favorilerim)",
        "tags": [
          "account"
        ]
      },
      "post": {
        "description": "Adds the active products named in `product_ids` (at most 200); an unknown or archived product is skipped and one already there keeps its date. The list holds at most 200 products: 409 when it is full.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "product_ids": {
                    "items": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "maxItems": 200,
                    "type": "array"
                  }
                },
                "required": [
                  "product_ids"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Wishlist"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The favourites after the merge."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store."
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Add products to the favourites (merge)",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/customer/wishlist/{product_id}": {
      "delete": {
        "description": "A product not on the list is no error.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          },
          {
            "in": "path",
            "name": "product_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`unauthorized`: no session, or one that has ended or belongs to another store."
          }
        },
        "summary": "Remove a product from the favourites",
        "tags": [
          "account"
        ]
      }
    },
    "/api/v1/store/downloads/{token}": {
      "get": {
        "description": "Counts one opening; 410 once the link has expired or was used up.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "description": "Expired or used up."
          }
        },
        "summary": "Download a file",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/geo/tr/districts": {
      "get": {
        "description": "The ilçeler of an il, in Turkish alphabetical order. From PTT's official postal code list, embedded; the same for every store; cached a day (ADR-0120).",
        "parameters": [
          {
            "description": "The il: its plate number (34) or its name (İstanbul; case and Turkish letters folded).",
            "in": "query",
            "name": "province",
            "required": true,
            "schema": {
              "maxLength": 60,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TRDistrictList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The ilçeler."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "An il's ilçeler",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/geo/tr/neighbourhoods": {
      "get": {
        "description": "The mahalleler (and köyler) of an ilçe with their postal codes — one almost always; a few large mahalleler have several, the first is the commonest guess. From PTT's official postal code list, embedded; the same for every store; cached a day (ADR-0120).",
        "parameters": [
          {
            "description": "The il: its plate number (34) or its name (İstanbul; case and Turkish letters folded).",
            "in": "query",
            "name": "province",
            "required": true,
            "schema": {
              "maxLength": 60,
              "type": "string"
            }
          },
          {
            "description": "The ilçe's name (Kadıköy; case and Turkish letters folded).",
            "in": "query",
            "name": "district",
            "required": true,
            "schema": {
              "maxLength": 60,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TRNeighbourhoodList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The mahalleler."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "An ilçe's mahalleler with their postal codes",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/geo/tr/postal-codes/{code}": {
      "get": {
        "description": "Every mahalle with the postal code (empty when the list does not know it). From PTT's official postal code list, embedded; the same for every store; cached a day (ADR-0120).",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[0-9]{5}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TRPostalAnswer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The places."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Where a Turkish postal code is",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/geo/tr/provinces": {
      "get": {
        "description": "The 81 iller with their plate numbers, in Turkish alphabetical order, for the checkout's il select. From PTT's official postal code list, embedded; the same for every store; cached a day (ADR-0120).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TRProvinceList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The iller."
          }
        },
        "summary": "Türkiye's iller",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/gift-cards/balance": {
      "post": {
        "description": "The code is posted. Status is active, disabled or expired. Spends the visitor's lookup budget.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftCardCodeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftCardBalance"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The balance."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many code lookups from this visitor; Retry-After says when to try again."
          }
        },
        "summary": "A gift card's balance",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/store/identity": {
      "get": {
        "description": "The store's own details a theme lays out (ADR-0061): announcement, footer text, social links, contact, payment icons and footer trust badges, WhatsApp number and message, free-shipping amount, instalment and delivery lines. With a preview token: the theme draft's copy.",
        "parameters": [
          {
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreIdentity"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The identity."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "summary": "The store's identity",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/legal": {
      "get": {
        "description": "One live version per kind, in the reader's language (else the store's default, else Turkish).",
        "parameters": [
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "documents": {
                          "items": {
                            "properties": {
                              "document_id": {
                                "format": "int64",
                                "type": "integer"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "language": {
                                "type": "string"
                              },
                              "published_at": {
                                "description": "When this version went live (the sitemap's lastmod).",
                                "format": "date-time",
                                "type": "string"
                              },
                              "required_at_checkout": {
                                "type": "boolean"
                              },
                              "title": {
                                "type": "string"
                              },
                              "version": {
                                "type": "integer"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The documents."
          }
        },
        "summary": "The store's published legal texts",
        "tags": [
          "legal"
        ]
      }
    },
    "/api/v1/store/legal/{kind}": {
      "get": {
        "description": "The live version with the seller's details filled in, and — when cart_id is given — the basket's products, shipping, tax, total including every tax, payment method and delivery, figured for the checkout's choices so far (payment_method, shipping_rate, country, state): what the shopper reads before accepting. A basket with nothing to send reads digital delivery with no address, and the text's {{#physical}}…{{/physical}} / {{#digital}}…{{/digital}} sections keep only what applies to the basket.",
        "parameters": [
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "distance_sales",
                "preliminary_info",
                "kvkk_notice",
                "cookie_policy",
                "return_policy",
                "privacy_policy",
                "terms_of_use"
              ],
              "type": "string"
            }
          },
          {
            "description": "Two-letter language; defaults to the request's.",
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cart_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With cart_id: the payment method chosen at checkout; absent, or one the basket is not offered, names every method it is offered.",
            "in": "query",
            "name": "payment_method",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "description": "With cart_id: the delivery option chosen; absent takes the first offered, as checkout does.",
            "in": "query",
            "name": "shipping_rate",
            "required": false,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "With cart_id: the destination's ISO country (the billing country for a basket with nothing to send) the delivery option and the tax are figured for; absent, the store's country.",
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z]{2}$",
              "type": "string"
            }
          },
          {
            "description": "With cart_id and country: the destination's region.",
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RenderedLegalDocument"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rendered text."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A published legal text, rendered",
        "tags": [
          "legal"
        ]
      }
    },
    "/api/v1/store/markets": {
      "get": {
        "description": "Public. The store's default market first, then by code. A storefront sends a market's `code` as the X-Market header; product reads, carts and checkout then price in its currency.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StoreMarket"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The store's markets."
          }
        },
        "summary": "List the markets this store sells in",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/menus/{handle}": {
      "get": {
        "description": "A store-owned menu (ADR-0061): main (the header), footer, footer-1 … footer-4 (the footer's columns). Menus belong to the store, not to a theme, and survive every theme switch. With a preview token: the theme draft's copy.",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreMenu"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The menu."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "One of the store's menus",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/meta/data-deletion": {
      "post": {
        "description": "Named in the platform Meta app's settings (Data deletion request URL). Verifies the signed_request against the Instagram app's and the Meta app's secret (and the modules' sharing the app); disconnects, in every store, the social feed connections made with that person's login (tokens, account name, id and picture, cached posts and their pictures), records the request and answers Meta's required JSON (top level, no envelope): the status page's address and a confirmation code. 400 when no secret verifies it; 503 when the work did not finish (Meta calls again).",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "properties": {
                  "signed_request": {
                    "description": "base64url(HMAC-SHA256 of the encoded payload, keyed with the app secret) \".\" base64url(JSON payload with algorithm, user_id, issued_at).",
                    "type": "string"
                  }
                },
                "required": [
                  "signed_request"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "confirmation_code": {
                      "pattern": "^[0-9a-f]{24}$",
                      "type": "string"
                    },
                    "url": {
                      "format": "uri",
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "confirmation_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Deleted."
          },
          "400": {
            "description": "The signed_request does not verify."
          },
          "503": {
            "description": "Not finished; try again."
          }
        },
        "security": [],
        "summary": "Meta's data deletion callback (platform)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/meta/data-deletion/status": {
      "get": {
        "description": "The page Meta links the person to: with Accept: text/html a plain bilingual page (Turkish and English), otherwise JSON. Names no store and no person. 404 for a code nobody was given.",
        "parameters": [
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{24}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MetaDeletionStatus"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The status."
          },
          "404": {
            "description": "No such confirmation code."
          }
        },
        "security": [],
        "summary": "A Meta data deletion's status (public)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/meta/deauthorize": {
      "post": {
        "description": "Named in the platform Meta app's settings (Deauthorize callback URL). The same signed_request check; disconnects that person's social feed connections in every store and records the request.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "properties": {
                  "signed_request": {
                    "description": "base64url(HMAC-SHA256 of the encoded payload, keyed with the app secret) \".\" base64url(JSON payload with algorithm, user_id, issued_at).",
                    "type": "string"
                  }
                },
                "required": [
                  "signed_request"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "confirmation_code": {
                      "pattern": "^[0-9a-f]{24}$",
                      "type": "string"
                    },
                    "url": {
                      "format": "uri",
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "confirmation_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Disconnected."
          },
          "400": {
            "description": "The signed_request does not verify."
          },
          "503": {
            "description": "Not finished; try again."
          }
        },
        "security": [],
        "summary": "Meta's deauthorize callback (platform)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/newsletter": {
      "post": {
        "description": "Records a sign-up request with the wording shown and emails a one-time confirmation link (notify queue). No consent exists until the address confirms (POST /newsletter/confirm). Answers the same whether or not the address is known or already subscribed. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewsletterSignup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NewsletterSignupResult"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Pending confirmation."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Ask to subscribe to the newsletter (double opt-in)",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/newsletter/confirm": {
      "post": {
        "description": "Turns the emailed link's token into the e-mail consent (source newsletter_form), with the request's and the confirmation's proof. Opening the link again answers the same. Cache-Control: no-store.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/NewsletterConfirmation"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Confirmed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Confirm a newsletter subscription",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/oauth/token": {
      "post": {
        "description": "Form-encoded: grant_type=authorization_code, code, redirect_uri, client_id and client_secret (or HTTP Basic), code_verifier when a challenge was sent. The token is an API key bound to the store, narrowed to the approved rights. Answers in RFC 6749's own shape.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "grant_type": {
                    "enum": [
                      "authorization_code"
                    ],
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  }
                },
                "required": [
                  "grant_type",
                  "code",
                  "redirect_uri"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthToken"
                }
              }
            },
            "description": "The token."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "description": "invalid_request, invalid_grant or unsupported_grant_type."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "description": "invalid_client."
          }
        },
        "summary": "Trade an app's code for its access token (RFC 6749 §4.1.3)",
        "tags": [
          "oauth"
        ]
      }
    },
    "/api/v1/store/oauth/{provider}/callback": {
      "get": {
        "description": "The one redirect URI every store's merchant returns to from Instagram, Facebook or TikTok (registered once in each platform app: https://\u003cplatform domain\u003e/api/oauth/{provider}/callback). Verifies the state's signature and expiry, uses its nonce once, checks the return page is still on a host of the store it names, exchanges the code from the server and redirects (303) to that page with ?social=\u003cprovider\u003e\u0026social_result=\u003cword\u003e. A state that fails any check gets a static page (400) and no redirect. Never cached, never sent on as a referrer.",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "facebook",
                "tiktok"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "code",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "error",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "Back to the store's panel with the result."
          },
          "400": {
            "description": "Invalid, used or expired state (HTML page)."
          }
        },
        "security": [],
        "summary": "The social feeds' OAuth callback (platform)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/orders/lookup": {
      "post": {
        "description": "A shopper who kept neither the order's link nor an account finds the order with what they have: its number and the e-mail address it was placed with. A match answers the number and the access token — the credential of GET /api/orders/{number}. The number is taken as typed or in capitals, with or without a leading \"#\"; the address is compared whole, without regard to case. A number that does not exist and an address that is not the order's are the same 404, so the route does not say which numbers exist. Lookups are budgeted per visitor and per order number (429 with Retry-After). Answered Cache-Control: no-store.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "number": {
                    "example": "1001",
                    "type": "string"
                  }
                },
                "required": [
                  "number",
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "access_token": {
                          "description": "Pass it to GET /api/orders/{number}?token=…",
                          "type": "string"
                        },
                        "number": {
                          "example": "1001",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order's number and its access token."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many lookups from this visitor or of this order number; Retry-After says when to try again."
          }
        },
        "summary": "Find your own order by its number and e-mail address",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}": {
      "get": {
        "description": "Guest checkout means there is no account to log into, so the order's access token — returned once at checkout — is the credential. A wrong token is reported as not found, so this cannot be used to discover which order numbers exist.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/OrderResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Look up your own order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/downloads": {
      "get": {
        "description": "For whoever holds the order's access token (the order page).",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/OrderDownload"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The links."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A paid order's download links",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/legal": {
      "get": {
        "description": "The accepted legal texts as rendered at checkout, with their hashes; the order's access token is the credential.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "acceptances": {
                          "items": {
                            "$ref": "#/components/schemas/LegalAcceptance"
                          },
                          "type": "array"
                        },
                        "emailed_to": {
                          "description": "The address the contracts are emailed to (the order's), present when the store sends them (ADR-0111).",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The acceptances."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "What a guest accepted on their order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/legal/{kind}/file": {
      "get": {
        "description": "The distance sales contract or the pre-contractual information form exactly as the shopper accepted it, as a PDF (HTML for a right-to-left language such as Arabic); the order's access token is the credential.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "distance_sales",
                "preliminary_info"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The contract as a PDF, or HTML for a right-to-left language."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "An accepted contract as a file",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/licence-keys": {
      "get": {
        "description": "The codes of a paid order that are delivered (not held for the store's review), with the order's access token as the credential — the same as GET /api/orders/{number}; a wrong token is not found. Answered Cache-Control: no-store. The first read of each code is recorded (viewed_at). The order read itself carries only counts (line_items[].licence_keys).",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GuestLicenceKeys"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The delivered codes."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Your order's codes",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/notes": {
      "get": {
        "description": "The notes the shop marked for the customer, behind the same access-token check as the order itself. A wrong token is reported as not found. Internal notes and their authors are never shown.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerOrderNote"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The customer notes, oldest first."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Read the shop's notes on your order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/pay/{code}": {
      "post": {
        "description": "Starts a new payment for an order placed and not paid — the card was refused on the bank's 3-D Secure page, the shopper left the provider's page, or they want another method — without placing anything again (ADR-0134). The order's access token is the credential, as on GET /api/orders/{number}; a wrong number or token is a 404. `code` is any method the store offers now (GET /api/checkout), `card_router` included; not `in_store` or `on_account`. Choosing another method records it on the order (audited); a bank transfer writes its instructions, or refuses a currency it has no account in (400, `details.reason` = `payment_method_unavailable`), as does cash on delivery for an order with nothing to send. The amount is the order's due amount (gift cards already applied stay applied). An open payment with the same method is resumed (the provider sees the same initiation key); open payments with other methods are left as they are. Refused with 409 when the order is cancelled (`order_cancelled`), paid or holding money at a provider (`order_paid`), refunded (`order_refunded`), or not waiting for a payment from its page — confirmed for payment at the door, for one (`order_not_payable`). Send an `Idempotency-Key` header: the same key with the same body replays the first answer; with a different body it is a 400. Answers with the checkout's own shape: the order (with its `access_token`) and the payment intent to act on.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A payment method code the store offers, such as `card_router` or a gateway's code.",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order's access token.",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Names this attempt; the storefront generates one per button press.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayAgainInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "payment": {
                          "$ref": "#/components/schemas/PaymentIntent"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The order, and what the client must do to pay."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Pay an unpaid order again (the shopper, with the order's link)",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/purchase-mark": {
      "post": {
        "description": "The storefront says it rendered the order's purchase mark on its confirmation page (ADR-0137): one row per order, counted, for the admin's measurement check. The order's access token is the credential; a wrong number or token is a 404. A test order records nothing. No body.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order's access token.",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Noted."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Note that the confirmation served the GA4 purchase mark",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/orders/{number}/returns": {
      "post": {
        "description": "The order's access token is the credential, as on GET /api/orders/{number}; a wrong number or token is a 404. Records a return in `requested` for the lines named, holding their units so two requests cannot claim the same unit; nothing moves until the store authorizes it, and the store may reject it. Only goods that left the store can be asked back: an order not yet shipped, a quantity above what was sold, shipped, or already asked back is a 400. The shopper decides nothing else — no shipping refund, no metadata (an unknown field is a 400). The request is audited as the customer's and announced as `return.requested`. Answers with the shopper's order, `return_requests` included. An `Idempotency-Key` header makes the request safe to repeat: the same key on the same order with the same lines and reason answers 201 with the order as the first request left it and asks for nothing again (header `Idempotent-Replayed: true`); the key with a different request is a 400. Without a key every request is its own.",
        "parameters": [
          {
            "in": "path",
            "name": "number",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order's access token.",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Names this request; the storefront generates one per form it renders.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerReturnInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The shopper's order with the new request.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when the answer is a replay of an earlier request with the same key.",
                "schema": {
                  "enum": [
                    "true"
                  ],
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Ask for a return (the shopper, with the order's link)",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/store/payments/{id}/complete": {
      "post": {
        "description": "Called by the storefront when the shopper comes back from a hosted payment page or a 3-D Secure challenge, with the data the provider appended to the return URL. The engine asks the provider what happened; the browser's word alone never marks anything paid. Answers with the payment's state only.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "data": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "amount_mismatch": {
                          "description": "The provider reported a different amount than the payment's; nothing was applied and the store has to look at it. A storefront tells the shopper the payment is under review rather than still waiting.",
                          "type": "boolean"
                        },
                        "decline_code": {
                          "description": "Why the bank turned the card down, when known (Payment.decline.code); the storefront says it in plain language.",
                          "type": "string"
                        },
                        "payment_id": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The payment's state."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Complete a payment after the shopper returns",
        "tags": [
          "checkout"
        ]
      }
    },
    "/api/v1/store/plugins": {
      "get": {
        "description": "Every enabled plugin with its public settings — the hello bar's message, the chat widget's key, the analytics tag — and nothing else. A storefront reads this once per page and renders what it finds.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PluginPublic"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Enabled plugins."
          }
        },
        "summary": "The plugins a storefront should render",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/product-fields": {
      "get": {
        "description": "By slug: the store's shown fields that have a value, in order, for the product page's specification table.",
        "parameters": [
          {
            "in": "query",
            "name": "product",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ProductFieldValue"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The fields."
          }
        },
        "summary": "A product's shown fields",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/product-pricing": {
      "get": {
        "description": "GET /api/product-pricing/{id} for up to 60 products at once (`ids=1,2,3`): the storefront lays a signed-in dealer's prices over a cached listing (ADR-0091 §2). A product not for sale here is left out; one sold to dealers only answers `prices_hidden` and no variant to anybody else. Personal (no-store) with a session; Vary: X-Customer-Session.",
        "parameters": [
          {
            "description": "Comma-separated product ids (at most 60).",
            "in": "query",
            "name": "ids",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductPricingList"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "What several products cost this visitor",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/product-pricing/{id}": {
      "get": {
        "description": "Per variant, in the request's market: one unit's price for this visitor (a signed-in member's group price), the price for everybody, and the quantity breaks that lower it — by the rule the cart and the checkout apply (ADR-0074). Personal (no-store) with a session. A product sold to dealers only answers prices_hidden and no variant to anybody else (ADR-0091 §2); Vary: X-Customer-Session.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductPricing"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "What a product costs this visitor",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/product-questions": {
      "get": {
        "description": "By slug, newest first, at most 50; the asker's first name and an initial only.",
        "parameters": [
          {
            "in": "query",
            "name": "product",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PublicProductQuestion"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The questions."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "A product's published questions",
        "tags": [
          "catalog"
        ]
      },
      "post": {
        "description": "Held until the store answers or publishes it; the answer is e-mailed when an address is given. The bot check applies; an automated-looking post is answered the same and dropped.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductQuestionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "received": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "received"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Received."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many questions in this store this hour; try again later."
          }
        },
        "summary": "Ask about a product",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/product-relations": {
      "get": {
        "description": "The merchant's picks, active products only, in their order; and what was bought together with it.",
        "parameters": [
          {
            "in": "query",
            "name": "product",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreProductRelations"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The picks."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "A product's picked products, by slug",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/product-sets": {
      "get": {
        "description": "For the product page: every set the product (by slug) is in whose products are all active and whose promotion is live; titles in the request's language.",
        "parameters": [
          {
            "in": "query",
            "name": "product",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "sets": {
                          "items": {
                            "$ref": "#/components/schemas/ProductSet"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "sets"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The sets."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The live sets a product is in",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/products": {
      "get": {
        "description": "Only active products are visible. A draft or archived product is reported as not found rather than forbidden, because its existence is not a shopper's business. Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there. Text is served in the request language (?lang= or Accept-Language) with a per-field fallback to the default language, and q also matches the product's translation in that language.",
        "parameters": [
          {
            "description": "Search (ADR-0040): the product's own text and its published translation in the request language — title, subtitle, description, SKUs and barcodes, its category's and collections' names. Words match from their start in any case, with or without Turkish and accented letters (\"cay\" finds \"Çay\"), through the language's stemmer (\"cezveler\" finds \"Cezve\") and as a substring; when nothing matches, near-misses in the title do (typos). Visibility is unchanged: the search only narrows what the listing shows. Without `sort`, the best match comes first.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "description": "Filter by a category attribute's recorded value, as `handle:value` — for example `attr=bag-case-material:Canvas`. Repeat the parameter to add more. Several values of the SAME handle widen the result (canvas OR leather, because a shopper who ticks both wants either); different handles narrow it (canvas AND black, because they describe one item). Only the first colon separates, so `color:Black:ish` is the value \"Black:ish\". Matching is exact, not a substring. An entry with no colon, no handle or no value is ignored rather than refused, so a truncated URL narrows to everything or to nothing instead of taking the listing away. The values are the ones stored under `metadata.category` by the category's own field list.",
            "example": "bag-case-material:Canvas",
            "explode": true,
            "in": "query",
            "name": "attr",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "description": "Which storefront is asking. Absent takes the default channel; a store with no channels reads the whole catalogue, exactly as before channels existed. An unknown or inactive code is refused with a 400 rather than quietly served the default — a typo in a storefront's configuration should fail at its first request, not sell the wrong catalogue for a week.",
            "example": "wholesale",
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`price`: each product's cheapest active variant for one unit in the request's market — the price a basket there would take — with products not for sale in the market last in both directions. `title`: by name. `created_at`: by age (`order=desc` is newest first). `sold`: units in the store's confirmed, shipped and delivered orders of the last 90 days (`order=desc` is best sellers first, ADR-0073). Absent: newest first by id, or best match first under `q`. An unknown key is a 400.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": [
                "created_at",
                "price",
                "sold",
                "title"
              ],
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/SortOrder"
          },
          {
            "description": "`true`: only products with an active variant that can be bought now — not tracked, sold on past zero, or with units available. Anything but true/false/1/0/yes/no is a 400.",
            "in": "query",
            "name": "in_stock",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/ListingColor"
          },
          {
            "$ref": "#/components/parameters/ListingSize"
          },
          {
            "$ref": "#/components/parameters/ListingSale"
          },
          {
            "$ref": "#/components/parameters/ListingPriceMin"
          },
          {
            "$ref": "#/components/parameters/ListingPriceMax"
          },
          {
            "$ref": "#/components/parameters/ListingCollection"
          },
          {
            "$ref": "#/components/parameters/ListingCategory"
          },
          {
            "$ref": "#/components/parameters/ListingType"
          },
          {
            "description": "1 on the storefront's search results page: the search counts in the search terms report (0187).",
            "in": "query",
            "name": "record",
            "required": false,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A page of products."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "List active products",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/products/facets": {
      "get": {
        "description": "Colour and size (the products' own options: colour is an option whose display is `color`, or, left automatic, one named Renk/Color/Colour/Farbe; size by name), in stock, on sale and the price span over the same base set GET /products lists (search, collection, category, attributes, channel), in the request's market. Counts are disjunctive: a value's count keeps every other current filter (ADR-0063).",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "in_stock",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "explode": true,
            "in": "query",
            "name": "attr",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "$ref": "#/components/parameters/ListingColor"
          },
          {
            "$ref": "#/components/parameters/ListingSize"
          },
          {
            "$ref": "#/components/parameters/ListingSale"
          },
          {
            "$ref": "#/components/parameters/ListingPriceMin"
          },
          {
            "$ref": "#/components/parameters/ListingPriceMax"
          },
          {
            "$ref": "#/components/parameters/ListingCollection"
          },
          {
            "$ref": "#/components/parameters/ListingCategory"
          },
          {
            "$ref": "#/components/parameters/ListingType"
          },
          {
            "description": "Category attribute handles (repeated or comma-separated, at most 6) whose values to count beside colour and size (ADR-0076). The values ticked are the listing's own attr=handle:value; each handle's counts leave out its own filter.",
            "explode": true,
            "in": "query",
            "name": "facet_attr",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ListingFacets"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The facets."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A listing's filters with counts",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/products/sku/{sku}": {
      "get": {
        "description": "SKU is the catalog's stable key for import and export, which makes it the natural handle for a storefront deep link too. Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there.",
        "parameters": [
          {
            "in": "path",
            "name": "sku",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get a product by one of its variant SKUs",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/products/slug/{slug}": {
      "get": {
        "description": "Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there. The slug may be the product's slug in the request language or its default-language slug; the response carries the localized slug and every language's slug in localization.slugs.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get an active product by slug",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/products/{id}": {
      "get": {
        "description": "Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "$ref": "#/components/parameters/Lang"
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProductResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get an active product",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/push": {
      "get": {
        "description": "The VAPID public key a browser subscribes with (RFC 8292); empty while notifications are off.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StorePush"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The settings."
          }
        },
        "summary": "Whether the store sends notifications, and its key",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/push/subscriptions": {
      "post": {
        "description": "The browser's PushSubscription (endpoint and keys). Only a browser push service's address is taken. A signed-in shopper's subscription carries their e-mail.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CustomerSessionHeader"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushSubscriptionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Subscribed."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Subscribe a browser to the store's notifications",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/push/unsubscribe": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "endpoint": {
                    "type": "string"
                  }
                },
                "required": [
                  "endpoint"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Forgotten."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "Forget a browser's subscription",
        "tags": [
          "storefront"
        ]
      }
    },
    "/api/v1/store/quantity-offers": {
      "get": {
        "description": "Vitrin eklentileri › Paket seçici (ADR-0157): for each quantity the store offers (at most four), N of the variant at this visitor's price before and after the store's automatic promotions, evaluated as the cart read evaluates them (promotions that do not combine included, ADR-0156) with no lock and no usage. `offers` is empty when the add-on is off, the product is not among those it shows on, or the variant has no price in the market's currency. Personal (no-store) with a session; Vary: X-Customer-Session. Since addendum 2: only the promotions the merchant chose count (all when none), `layout` says side or stacked, and a set card (`set_id`, `items`) prices a product set's products together, the set's own promotion included; `available` is false when one of them cannot be sold now.",
        "parameters": [
          {
            "description": "The variant the cards are for.",
            "in": "query",
            "name": "variant_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "description": "A signed-in customer's session (ADR-0049).",
            "in": "header",
            "name": "X-Customer-Session",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/QuantityOffers"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The pack selector's cards for a variant",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/quote-requests": {
      "post": {
        "description": "A quote request for a basket (`cart_id`) or the products named (`lines`), stored in the contact inbox as a message of kind quote with its lines — never a price (ADR-0091 §4). The store is told as for a contact message; the buyer gets a copy. The contact form's honeypot, fill time and hourly limits apply (429). 404 quotes_disabled when the store takes none. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ContactReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Received"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "description": "Too many requests; try again later."
          }
        },
        "summary": "Ask for a quote (\"Teklif iste\")",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/recent-purchases": {
      "get": {
        "description": "While the store's recent-purchase-popup add-on is on: the latest orders of the last 14 days that went through (paid, or confirmed and on their way), one per product, newest first, at most 12 — the product's address, its title in the request's language, its picture, the city the order goes to and how long ago. Nothing else about the buyer. Off, 404 `recent_purchases_off`. Cacheable for 60 seconds.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "purchases": {
                          "items": {
                            "$ref": "#/components/schemas/RecentPurchase"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "purchases"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The recent purchases."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Recent purchases for the storefront's note (Son satın alma bildirimi)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/review-requests/{token}": {
      "get": {
        "description": "The storefront's review page (/{lang}/review/{token}, Turkish /tr/yorum/{token}): the product the link asks about (in the request's language), how the review will be signed (first name and the initial of the surname) and whether the link was already used. 404 `LINK_EXPIRED`: unknown here, or older than 60 days.",
        "parameters": [
          {
            "description": "The link's token, from the review request e-mail.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 32,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewRequestView"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The link."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A review request link: what it asks about",
        "tags": [
          "catalog"
        ]
      },
      "post": {
        "description": "The review written from the e-mail's link: `rating` (1–5), `title` (optional), `body` (10–4000 characters), `consent` and `consent_text`; the product, the e-mail and the name come from the link, never the client. Recorded as a verified purchase and waits for the store's moderation; the link is used up. When the store gives a thank-you, the receipt carries a single-use code — for every review, whatever its rating. Photos: multipart/form-data with the review as JSON in `review` and up to 3 files in `photos`, as POST /api/reviews. 404 `LINK_EXPIRED`; 409 `already_reviewed` (the link was used, or this product was already reviewed from this address).",
        "parameters": [
          {
            "description": "The link's token, from the review request e-mail.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 32,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewSubmission"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "photos": {
                    "items": {
                      "format": "binary",
                      "type": "string"
                    },
                    "maxItems": 3,
                    "type": "array"
                  },
                  "review": {
                    "description": "The ReviewSubmission as JSON.",
                    "type": "string"
                  }
                },
                "required": [
                  "review"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewRequestReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Received."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "summary": "Write the review a request link asks for",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/review-requests/{token}/unsubscribe": {
      "post": {
        "description": "The e-mail's opt-out link: the address gets no review request from this store again, and its waiting requests are dropped. Idempotent; works however old the link is.",
        "parameters": [
          {
            "description": "The link's token, from the review request e-mail.",
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 32,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "unsubscribed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "unsubscribed"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "No more review requests",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/reviews": {
      "get": {
        "description": "Only approved reviews; never an address. `sort` newest (default), helpful (most helpful first), rating_desc or rating_asc (highest and lowest are the older names); `with_photos=1` lists only reviews with an approved photo (meta.total then counts those). Each review carries its approved photos, its helpful count and the store's reply. A product not for sale in this store is 404 (ADR-0063).",
        "parameters": [
          {
            "description": "The product's slug in any of its languages.",
            "in": "query",
            "name": "product",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The product's id, when no slug is given.",
            "in": "query",
            "name": "product_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "newest",
                "helpful",
                "rating_desc",
                "rating_asc",
                "highest",
                "lowest"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only reviews with an approved photo.",
            "in": "query",
            "name": "with_photos",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProductReviewsPage"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The summary and one page (meta counts the approved reviews)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A product's approved reviews and their summary",
        "tags": [
          "catalog"
        ]
      },
      "post": {
        "description": "Waits for the store's moderation. Verified when the signed-in account (X-Customer-Session) has a paid or shipped order of the product, or `order_number` names such an order with this email. A honeypot, a form sent within 3 s or without `started_at` is answered the same and dropped. 409 `already_reviewed`: one per product and address while pending or approved. 429 `rate_limited`: 5 an hour per visitor address, 120 per store. Photos: send multipart/form-data with the review as JSON in `review` and up to 3 files in `photos` (JPEG, PNG or WebP, at most 5 MiB each; sniffed, metadata stripped, filed in the media library's \"Değerlendirmeler\" folder, served only once the review is approved). A refused photo is 400 with details.field `photos` and details.reason (type, too_large, count, image_size, damaged, unavailable); 60 photos an hour per store (429). Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewSubmission"
              }
            },
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "photos": {
                    "items": {
                      "format": "binary",
                      "type": "string"
                    },
                    "maxItems": 3,
                    "type": "array"
                  },
                  "review": {
                    "description": "The ReviewSubmission as JSON.",
                    "type": "string"
                  }
                },
                "required": [
                  "review"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Received."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`rate_limited`."
          }
        },
        "summary": "Write a review",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/reviews/recent": {
      "get": {
        "description": "For a home \"testimonials\" section: approved reviews of products this store sells, newest first, `limit` 1–48 (default 6), `min_rating` 1–5, `with_photos=1` only those with an approved photo. Each carries its product (slug, title, picture) in the request's language.",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 6,
              "maximum": 48,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "min_rating",
            "schema": {
              "maximum": 5,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "with_photos",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/StoreReview"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reviews."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The store's newest approved reviews",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/reviews/{id}/helpful": {
      "post": {
        "description": "One vote per visitor and review: the storefront's cookie token (`voter_token`) when given, else the visitor's address, stored only as a hash. Only approved reviews (any other is 404). A second vote is answered 200 with `already_voted` and counts nothing. 429 `rate_limited`: 30 an hour per address, 3 per review and address a day, 600 an hour per store.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "voter_token": {
                    "description": "A random token the storefront keeps in a cookie for this visitor.",
                    "pattern": "^[A-Za-z0-9_-]{16,128}$",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewVote"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Counted (or already counted)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "`rate_limited`."
          }
        },
        "summary": "Mark a review helpful",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/shipping/offers": {
      "get": {
        "description": "The checkout's own rate table asked without a cart, for a product page's structured data (OfferShippingDetails, P1-19): the subtotal is the item's price in the given currency, and every country is quoted with the most specific zone that names it without a state. Only table rates in that currency whose band holds the subtotal are listed; live carrier rates have no price without a cart and are left out; a country nothing covers is left out. A store with no rates configured (flat shipping) answers configured = false and no destinations.",
        "parameters": [
          {
            "description": "ISO 4217 code; the store's base currency when omitted.",
            "in": "query",
            "name": "currency",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The basket subtotal to price, in minor units of the currency.",
            "in": "query",
            "name": "subtotal_minor",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "ISO 3166-1 alpha-2 codes, comma-separated or repeated; at most 100.",
            "in": "query",
            "name": "country",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ShippingOffers"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The rates per country."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "What delivering one item costs, per destination country",
        "tags": [
          "shipping"
        ]
      }
    },
    "/api/v1/store/site": {
      "get": {
        "description": "What the multi-tenant storefront runtime resolves a request's Host to (constitution §12A, ADR-0030): tenant and store, the store's hosts and canonical origin, its languages and the published theme version — the parts of every cache key. A host that routes to no store answers 404 `unknown_host` whatever the deployment's mode, and the storefront answers it with the platform 404. Edge-cacheable per host for 30 seconds.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreSite"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The resolved store."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The store this host serves (storefront runtime resolution)",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/site-files/{name}": {
      "get": {
        "description": "The verification file a provider reads at the root of the store's domains (Ayarlar › Site doğrulama): the storefront answers /{name} (Apple Pay's file at /.well-known/apple-developer-merchantid-domain-association) with `body` as `content_type`. An HTML body is stored without any active part. 404 for a name outside the providers' shapes or not set.",
        "parameters": [
          {
            "description": "A provider's file name: google{16 hex}.html, BingSiteAuth.xml, yandex_{16 hex}.html, baidu_verify_{code}.html, naver{32 hex}.html, pinterest-{5 hex}.html, tiktok{token}.txt, or apple-developer-merchantid-domain-association (also taken with .txt, as a browser saves it).",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "maxLength": 120,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SiteFile"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The file, with its body."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A site-ownership file of the store",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/size-guide": {
      "get": {
        "description": "The guide naming the product, else one naming a collection it is in, else the store's default; 404 when none (ADR-0063).",
        "parameters": [
          {
            "description": "The product's slug in any of its languages.",
            "in": "query",
            "name": "product",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The product's id, when no slug is given.",
            "in": "query",
            "name": "product_id",
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Lang"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreSizeGuide"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The guide."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The size guide a product shows",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/social-feeds/{platform}": {
      "get": {
        "description": "The posts the store's feed of one platform shows (the theme section and the free-design live component \"Sosyal medya akışı\"), newest first, as the last sync stored them: pictures are copies in the store's media library, never the platform's CDN. A feed that is off answers enabled false and no posts. Players (embed_url) are third-party content the storefront loads only after the visitor's click or marketing consent. The answer carries the look the feed's plugin chose in its sheet (display): a section or live component applies the values named in display.chosen over its own unless it opts out.",
        "parameters": [
          {
            "in": "path",
            "name": "platform",
            "required": true,
            "schema": {
              "enum": [
                "instagram",
                "youtube",
                "tiktok",
                "x",
                "facebook",
                "linkedin",
                "pinterest"
              ],
              "type": "string"
            }
          },
          {
            "description": "How many posts (1–50). Absent: as many as the plugin's display settings show (display.count; 8 when none was chosen).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SocialFeed"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The feed."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A social media feed's posts",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/stock-alerts": {
      "post": {
        "description": "back_in_stock (default) on a sold-out variant — 409 IN_STOCK when it can be bought — or price_drop (the market's price now is remembered). The box must be ticked with its wording. A repeat is the same request. 404 ALERTS_OFF when the store takes none; 429 rate_limited (10 an hour from one address). Sent once, then done; every message carries a link that cancels the person's other requests. Cloudflare Turnstile (ADR-0096): when keys apply to the request's host — the platform's on a NeroCart host, the store's own on its own domain — the `X-Turnstile-Token` header must carry a token Cloudflare confirms, else 400 `turnstile_failed` (details.field `turnstile`). Cloudflare unreachable lets the request through on the route's other protections.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TurnstileToken"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAlertInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockAlertReceipt"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "description": "Too many requests from here."
          }
        },
        "summary": "Ask to be told once",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/stock-alerts/config": {
      "get": {
        "description": "For the product page's \"Gelince haber ver\" form: on, and whether a phone number is taken (ADR-0074).",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StockAlertConfig"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Whether the store takes stock alerts",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/stock-alerts/unsubscribe": {
      "post": {
        "description": "A message's link: every waiting request of that recipient at this store is cancelled. 404 LINK_EXPIRED for an unknown link.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryTokenInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "stopped": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "stopped"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Cancel a person's waiting alerts",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/store-brand": {
      "get": {
        "description": "Public and read only, resolved from the host like the other storefront routes: the store's name and the addresses of its live theme's logo and favicon (empty when none). The merchant admin's sign-in screen, shown before anyone signs in on the store's own host, and its side bar show them. Nothing else is in it. An address no store answers for is `404 unknown_host`. Cacheable per host for 30 seconds.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreBrand"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The store's name and pictures."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The store's name, logo and favicon",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/store-domain": {
      "get": {
        "description": "The primary host, its https URL and the www/apex policy — what canonical links are built from, never the raw Host header.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreDomainInfo"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The canonical host."
          }
        },
        "summary": "The store's canonical host",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/store-status": {
      "get": {
        "description": "`open: false` while the account is suspended or closing: the storefront shows a neutral notice and no checkout is possible.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreStatus"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The status."
          }
        },
        "summary": "Whether the store is open",
        "tags": [
          "store"
        ]
      }
    },
    "/api/v1/store/stories": {
      "get": {
        "description": "In order, at most 30; the home page's row of stories.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Story"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The stories."
          }
        },
        "summary": "The store's active stories",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/theme/alternate-templates": {
      "get": {
        "description": "The live theme's alternates of the product, collection and page templates (ADR-0068), for the screens where a product, collection or page picks one. Public: template names only.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreAlternateTemplates"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Alternates by base template."
          }
        },
        "summary": "The theme's alternate templates",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/theme/demo": {
      "get": {
        "description": "Resolves a gallery preview token of this store (POST /admin/theme/gallery/{id}/preview answered demo: true) to the theme's own demo store: the storefront renders the preview on that host's store, so the gallery shows the theme with its own demo catalogue and pages, never the merchant's products (ADR-0072). A token of another store, an expired one or one that is not a demo preview is 403; a theme whose demo store is not seeded is 404. Never cached.",
        "parameters": [
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ThemeDemoTarget"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The demo store."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "The demo store a theme gallery preview opens",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/theme/template/{name}": {
      "get": {
        "description": "The template the store's theme renders a page with (theme engine 2.0.0, ADR-0061): its sections in order, each with its settings and blocks, and the theme's section groups. The theme instance's override when the store has one, else the package's; a 1.x package answers the engine's 1.1 template set. An alternate (product.wide) falls back to its base, category and search to collection. With a preview token: the theme draft's, or a gallery theme's choice. An engine section's look setting left unset follows the theme's global setting of the same meaning.",
        "parameters": [
          {
            "description": "home, product, collection, category, search, cart, page, 404 … or an alternate such as page.contact.",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "preview",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/StoreThemeTemplate"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The template."
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "A template of the store's theme",
        "tags": [
          "content"
        ]
      }
    },
    "/api/v1/store/variants": {
      "get": {
        "description": "Variants are their own collection rather than a sub-path of a product: `/api/products/{id}/variants` would collide with the slug and sku lookups. Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there.",
        "parameters": [
          {
            "in": "query",
            "name": "product_id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/PageNumber"
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Variant"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The product's variants."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "List a product's variants",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/variants/{id}": {
      "get": {
        "description": "Variant prices are in the request's market (see `X-Market`); `for_sale` says whether each variant can be bought there.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathID"
          },
          {
            "description": "The market to price in, by code. Absent: `?market=`, then the visitor's country (`?country=` or the CDN's CF-IPCountry), then the store's default market. An unknown code is a 400.",
            "in": "header",
            "name": "X-Market",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The variant."
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Get a variant",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/v1/store/variants/{id}/offers": {
      "get": {
        "description": "Active offers from approved sellers, cheapest first.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PublicOffer"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Who is selling this, for a shopper",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/store/vendors": {
      "get": {
        "description": "Approved only, and not from a query parameter: a storefront cannot ask for the pending ones by adding ?status=pending.",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PublicVendor"
                      },
                      "type": "array"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Approved sellers",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/store/vendors/{slug}": {
      "get": {
        "description": "A pending or suspended seller answers 404 rather than 403: that a slug is taken is itself something a shopper has no business learning.",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicVendor"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "description": "No such shop"
          }
        },
        "summary": "One seller’s shop",
        "tags": [
          "Vendors"
        ]
      }
    },
    "/api/v1/store/visits": {
      "post": {
        "description": "A page view, a heartbeat while the page is in front, or the order confirmation page. First-party and cookieless: the visitor is a hash of the day's random salt, the address and the browser, the salts are deleted after two days, and no address is stored. Bots and unknown kinds are dropped. Always 204 for a well-formed body.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Taken (or dropped)."
          },
          "400": {
            "$ref": "#/components/responses/Validation"
          }
        },
        "summary": "The storefront's own visitor beacon",
        "tags": [
          "storefront"
        ]
      }
    },
    "/health": {
      "get": {
        "description": "Reports that the process is running. Touches no dependency, so a database hiccup never causes an orchestrator to restart a healthy process.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "status": {
                          "example": "ok",
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The process is alive."
          }
        },
        "summary": "Liveness probe",
        "tags": [
          "system"
        ]
      }
    },
    "/health/ready": {
      "get": {
        "description": "Reports that this process can serve traffic: the database answers, every migration this binary knows is applied, and, once the process serves, its outbox dispatcher and job loop are running. The body names the applied migrations this binary does not know (`migrations.unknown`) when it serves a newer schema by explicit allowance (ADR-0032).",
        "responses": {
          "200": {
            "description": "Ready to serve."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The database is unavailable."
          }
        },
        "summary": "Readiness probe",
        "tags": [
          "system"
        ]
      }
    }
  },
  "security": [],
  "servers": [
    {
      "description": "This store",
      "url": "/"
    }
  ],
  "tags": [
    {
      "description": "Liveness, readiness and the API contract.",
      "name": "system"
    },
    {
      "description": "Products and the variants that are actually sold.",
      "name": "catalog"
    },
    {
      "description": "Curated groupings of products, as a storefront sees them.",
      "name": "collections"
    },
    {
      "description": "Guest baskets. The cart id is the only credential.",
      "name": "cart"
    },
    {
      "description": "Turning a cart into an order, and taking payment.",
      "name": "checkout"
    },
    {
      "description": "Guest order lookup.",
      "name": "orders"
    },
    {
      "description": "Managing products, variants and stock.",
      "name": "admin:catalog"
    },
    {
      "description": "Curating collections and what is in them.",
      "name": "admin:collections"
    },
    {
      "description": "Managing the category tree and where products sit in it.",
      "name": "admin:categories"
    },
    {
      "description": "Managing orders, payments, shipments and the carts behind them.",
      "name": "admin:orders"
    },
    {
      "description": "Provider payments behind an order: capture, void and reconcile (M5).",
      "name": "admin:payments"
    },
    {
      "description": "What the store sold, aggregated over a window.",
      "name": "admin:reports"
    },
    {
      "description": "CSV import and export.",
      "name": "admin:data"
    },
    {
      "description": "Signing operators in to the admin panel, and managing who they are.",
      "name": "admin:auth"
    },
    {
      "description": "The media library: images, video and 3D models, shared across products.",
      "name": "admin:media"
    },
    {
      "description": "What each role may do in this store.",
      "name": "admin:roles"
    },
    {
      "description": "The store as a running system rather than as a shop: the health report, and the maintenance passes that act on what it finds.",
      "name": "admin:ops"
    },
    {
      "description": "Who did what: the store's record of every operator action.",
      "name": "admin:audit"
    },
    {
      "description": "The store's own configuration, as the panel reads it.",
      "name": "admin:settings"
    },
    {
      "description": "The store's plumbing: the event outbox, and what could not be delivered.",
      "name": "admin:platform"
    },
    {
      "description": "Consent to commercial messages (ETK / İYS), suppressions and the sender identity.",
      "name": "admin:messaging"
    },
    {
      "description": "The store's published legal texts (mesafeli satış sözleşmesi, ön bilgilendirme formu, KVKK, çerez, iade/cayma), rendered for the shopper.",
      "name": "legal"
    },
    {
      "description": "Versioned legal texts per store and language, the seller's legal details, and what each order accepted. The engine ships skeletons marked for a lawyer's review; nothing here is legal advice.",
      "name": "admin:legal"
    },
    {
      "description": "Turkish e-invoicing (e-Arşiv / e-Fatura) through an integrator module. Idle until a provider is configured; the invoice is issued by a job when an order's last parcel ships.",
      "name": "admin:invoicing"
    },
    {
      "description": "Published pages, the theme and the newsletter form (content service, ADR-0025).",
      "name": "content"
    },
    {
      "description": "Tema Stüdyosu: pages, section documents, the editorial workflow, preview tokens and the theme.",
      "name": "admin:content"
    }
  ]
}